Running forever index.js from a systemd unit file

325 views Asked by At

Beaglebone Debian 8.7; Node v10.10.0

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

Attempting to run .js file forever as discussed in the above link. This is the contents of my .service unit file.

[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

With command # systemctl start myServer.service I get the following errors.

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

However with the command forever start path/index.js; everything works fine.

Forever-monitor is installed. Why doesn't my service work compared to a console command.

0

There are 0 answers