我做了这个服务。
#!/bin/bash
node ../../home/NodeServer/server.js
所有它应该做的是启动服务器的启动, 所以我想做的是:
sudo systemctl enable startServer.service
但我得到了这个错误。
startServer.sh.service is not a native service, redirecting to systemd-sysv-insall.
Executing: /lib/systemd/systemd-sysv-install enable startServer.sh
update-rc.d: error: startServer.sh Default-Start contains no runlevels, aborting.
当我尝试做
sudo systemctl start startServer.service
它的工作原理和预期一样。
我有同样的问题。我解决它再次键入的文件,因为它似乎有一个奇怪的字符,被打破的解析器。希望这能帮助你