我正在尝试在启动时使用systemd
.
这是我的.service
文件
[Unit]
Description=Lavalink Server
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=bubble
WorkingDirectory=/home/bubble/Desktop/Project\ Proton
ExecStart=/usr/bin/java -jar ./Lavalink/Lavalink.jar
[Install]
WantedBy=multi-user.target
但是,启动失败。以下是 Journalctl 日志:
Apr 07 14:45:44 sen-zen systemd[1]: Started lavalink_server.service.
Apr 07 14:45:44 sen-zen systemd[13520]: lavalink_server.service: Changing to the requested working directory failed: No such file or directory
Apr 07 14:45:44 sen-zen systemd[13520]: lavalink_server.service: Failed at step CHDIR spawning /usr/bin/java: No such file or directory
Apr 07 14:45:44 sen-zen systemd[1]: lavalink_server.service: Main process exited, code=exited, status=200/CHDIR
Apr 07 14:45:44 sen-zen systemd[1]: lavalink_server.service: Failed with result 'exit-code'.
它说Failed at step CHDIR spawning /usr/bin/java: No such file or directory
但是,这是输出whereis java
┌─[bubble@sen-zen] - [~] - [547]
└─[$] whereis java [15:06:06]
java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz
我尝试对此进行搜索,但没有发现任何真正解决我的问题的东西。我做错了什么,有人可以帮助我吗?