我的服务如下所示:
[Unit]
Description=Run Forever
[Service]
User=root
WorkingDirectory=/home/elbrus/perp
ExecStart=/bin/bash -c 'python3 perpetual.py'
Restart=always
[Install]
WantedBy=multi-user.target
由于某种原因,我不断收到以下错误:
perpetual.service: Changing to the requested working directory failed: No such file or directory
systemd[41116]: perpetual.service: Failed at step CHDIR spawning /bin/bash: No such file or directory
systemd[1]: perpetual.service: Main process exited, code=exited, status=200/CHDIR
systemd[1]: perpetual.service: Failed with result 'exit-code'.
尽管文件夹 100% 存在并且我的权限如下所示:
-rwxrwxrwx 1 root root 931
这让我完全抓狂,因为这个相同的 systemd 服务正在多个其他服务器上运行。只是 DigitalOcean 的这个我无法上班。