我创建了crsupp.service和cloudradio.sh文件,并尝试启动用NodeJS制造的Discord机器人。
当我输入systemctl start crsupp
然后再输入systemctl status crsupp
时,我得到了:
● crsupp.service - CRBeta
Loaded: loaded (/etc/systemd/system/crsupp.service; disabled; vendor preset: enabled)
Active: failed (Result: start-limit-hit) since Wed 2019-05-01 13:48:08 UTC; 293ms ago
Process: 27479 ExecStart=/home/justwolf/crsupp/cloudradio.sh (code=exited, status=203/EXEC)
Main PID: 27479 (code=exited, status=203/EXEC)
May 01 13:48:08 Nara systemd[1]: crsupp.service: Service hold-off time over, scheduling restart.
May 01 13:48:08 Nara systemd[1]: Stopped CRBeta.
May 01 13:48:08 Nara systemd[1]: crsupp.service: Start request repeated too quickly.
May 01 13:48:08 Nara systemd[1]: Failed to start CRBeta.
May 01 13:48:08 Nara systemd[1]: crsupp.service: Unit entered failed state.
May 01 13:48:08 Nara systemd[1]: crsupp.service: Failed with result 'start-limit-hit'.
crsupp.service:
[Unit]
Description=CRSupp
[Service]
Environment=NODE_ENV=production
User=root
WorkingDirectory=/home/justwolf/crsupp
ExecStart=cloudradio.sh
Restart=always
[Install]
WantedBy=default.target
cloudradio.sh:
#!/usr/bin/env node
node index.js
答案 0 :(得分:0)
重启问题是g_main_context_default()
问题,可以通过增加重启间隔来解决,这已经在another question中得到解决。
不过,对于您的代码,在我看来,您似乎已经编写了Node bash脚本,但实际上并未在其中放置有效的Node代码。如果您要使用该服务做的只是启动Node脚本,则可以直接从该服务中完成
systemd