首页 > 解决方案 > 从 systemd 单元文件永远运行 index.js

问题描述

Beaglebone Debian 8.7;节点 v10.10.0

https://www.alibabacloud.com/blog/running-your-node-js-application-on-ecs-with-systemd-or-forever_594909

如上面链接中所述,尝试永远运行 .js 文件。这是我的 .service 单元文件的内容。

[Unit]
Description=myServer
DefaultDependencies=no
After=network-online.target
Wants=network-online.target

[Service]
Type=forking
ExecStart=/root/.nvm/versions/node/v10.10.0/bin/forever  start  path/index.js
ExecStop=/root/.nvm/versions/node/v10.10.0/bin/forever  stop  path/index.js
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

使用命令# systemctl start myServer.service我收到以下错误。

node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
myServer.service: Control process exited, code=exited status=1

但是使用命令永远启动 path/index.js;一切正常。

安装了 Forever-monitor。与控制台命令相比,为什么我的服务不起作用。

标签: node.jsdebianbeagleboneblackforeverforever-monitor

解决方案


推荐阅读