我需要使用 systemctl 从远程机器上自动运行我的 node.js 脚本。
我已经制作了一个 .service 文件并将其放入/etc/systemd/system/
. 这是 .service 文件:
[Unit]
Description=laporan
[Service]
ExecStart=/var/www/laporan/nodeserver/server.js
Restart=always
User=nobody
Group=root
Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production
WorkingDirectory=/var/www/laporan/nodeserver
[Install]
WantedBy=multi-user.target
但是每次我尝试启动服务时,它都会返回如下错误(输出systemctl status laporan
):
● laporan.service - laporan
Loaded: loaded (/etc/systemd/system/laporan.service; enabled)
Active: failed (Result: start-limit) since Mon 2016-09-12 09:15:06 WITA; 11min ago
Process: 121690 ExecStart=/var/www/laporan/nodeserver/server.js (code=exited, status=203/EXEC)
Main PID: 121690 (code=exited, status=203/EXEC)
Sep 12 09:15:05 kominfomdc systemd[1]: Unit laporan.service entered failed state.
Sep 12 09:15:06 kominfomdc systemd[1]: laporan.service start request repeated too quickly, refusing to start.
Sep 12 09:15:06 kominfomdc systemd[1]: Failed to start laporan.
Sep 12 09:15:06 kominfomdc systemd[1]: Unit laporan.service entered failed state.
这个错误到底是什么?我错过了什么吗?