Systemd 在尝试启动时似乎无法找到该单元,但所有其他操作似乎都可以正常工作。
bash-4.2# systemctl daemon-reload
bash-4.2# systemctl start xyzzy.service
Failed to start xyzzy.service: Unit not found.
bash-4.2# systemctl cat xyzzy
# /etc/systemd/system/xyzzy.service
[Unit]
BindsTo=aabbcc.service
After=aabbcc.service
[Service]
User=xyzzy
Group=xyzzy
Type=simple
Restart=always
ExecStart=/opt/xyzzy/scripts/xyzzy_start.sh
RestartSec=1
StartLimitInterval=5
[Install]
WantedBy=aabbcc.service
bash-4.2# systemctl status xyzzy
● xyzzy.service - xyzzy
Loaded: loaded (/etc/systemd/system/xyzzy.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Dec 19 21:28:11 ......
Dec 19 21:28:39 ...... systemd[1]: Stopping xyzzy...
Dec 19 21:28:39 ...... systemd[1]: Stopped xyzzy.
Hint: Some lines were ellipsized, use -l to show in full.
bash-4.2# systemd-analyze verify /etc/systemd/system/xyzzy.service
Error: org.freedesktop.systemd1.NoSuchUnit: Unit not found.
Failed to create xyzzy.service/start: No such file or directory