我在跑步乌班图17.0464 位,我想设置同步和另外两个应用程序在机器启动后启动,而不需要有人登录并手动启动它们。
我已将所有应用程序安装到以下目录中:
/home/msa/syncthing/
/home/msa/minecraft-server/
/home/msa/test/
对于每个应用程序,我都使用启动命令创建了一个 bash 启动脚本:
/home/msa/syncthing/start.sh
/home/msa/minecraft-server/start.sh
/home/msa/test/start.sh
这同步事物启动文件包含以下内容:
./syncthing
这我的世界服务器启动文件包含以下内容:
java -Xms1024M -Xmx2048M -jar minecraft_server.jar nogui
这测试启动文件包含以下内容:
java -Xms1024M -Xmx2048M -jar test.jar
我发现这个版本的Ubuntu使用系统,并创建了一个名为同步服务在/etc/systemd/系统/包含这个:
[Unit]
Description = Syncthing service description (todo)
After = network.target
[Service]
ExecStart = /home/msa/syncthing/start.sh
[Install]
WantedBy = multi-user.target
然后我运行了这个命令:
systemctl enable syncthing.service
它返回,符号链接已成功创建,因此我启动了该服务:
systemctl start syncthing.service
它不起作用。我运行了这个命令:
systemctl status syncthing
并得到这个:
root@MinecraftServerAdvanced:/etc/systemd/system# systemctl status syncthing.service
● syncthing.service - Syncthing service description (todo)
Loaded: loaded (/etc/systemd/system/syncthing.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2017-05-06 19:47:54 CEST; 4s ago
Process: 789 ExecStart=/home/msa/syncthing/start.sh (code=exited, status=203/EXEC)
Main PID: 789 (code=exited, status=203/EXEC)
kvě 06 19:47:54 MinecraftServerAdvanced systemd[1]: Started Syncthing service description (todo).
kvě 06 19:47:54 MinecraftServerAdvanced systemd[1]: syncthing.service: Main process exited, code=exited, status=203/E
kvě 06 19:47:54 MinecraftServerAdvanced systemd[1]: syncthing.service: Unit entered failed state.
kvě 06 19:47:54 MinecraftServerAdvanced systemd[1]: syncthing.service: Failed with result 'exit-code'.
root@MinecraftServerAdvanced:/etc/systemd/system#
我究竟做错了什么?