我启用了 7 个服务,其中 6 个依赖于第一个服务的启动,并且运行良好。 3 个启动正常,其他 3 个不会在启动时启动,但如果我运行sudo systemctl 启动服务它运行良好。
你能帮忙吗?
守护进程
[Unit]
Description=SABnzbd Client
After=network.target [email protected]
[Service]
Type=simple
User=tatsu
Group=tatsu
ExecStart=/usr/bin/python3 -OO /opt/SABnzbd/SABnzbd.py --browser 0 -s 192.168.0.227:8080
Restart=always
[Install]
WantedBy=multi-default.target
地位
● sabnzbd.service - SABnzbd Client
Loaded: loaded (/etc/systemd/system/sabnzbd.service; enabled; vendor preset: enabled)
Active: inactive (dead)
运行后状态须藤 systemctl 启动 sabnzbd
● sabnzbd.service - SABnzbd Client
Loaded: loaded (/etc/systemd/system/sabnzbd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-16 09:07:50 GMT; 9s ago
Main PID: 749 (python3)
Tasks: 22 (limit: 1147)
Memory: 61.6M
CGroup: /system.slice/sabnzbd.service
└─749 /usr/bin/python3 -OO /opt/SABnzbd/SABnzbd.py --browser 0 -s 192.168.0.227:8080
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,686::INFO::[SABnzbd:1427] Starting web-interface on 192.168.0.227:
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,687::INFO::[_cplogging:216] [16/Nov/2020:09:07:54] ENGINE Bus STAR
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,794::INFO::[_cplogging:216] [16/Nov/2020:09:07:54] ENGINE Serving
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,795::INFO::[_cplogging:216] [16/Nov/2020:09:07:54] ENGINE Bus STAR
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,796::INFO::[SABnzbd:1464] Starting SABnzbd.py-3.1.1
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,807::INFO::[dirscanner:117] Dirscanner starting up
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,813::INFO::[urlgrabber:96] URLGrabber starting up
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,813::INFO::[notifier:122] Sending notification: SABnzbd - SABnzbd
Nov 16 09:07:54 tatsu-dl python3[749]: 2020-11-16 09:07:54,836::INFO::[postproc:232] Completed Download Folder /downloads/com
Nov 16 09:07:55 tatsu-dl python3[749]: 2020-11-16 09:07:55,269::INFO::[zconfig:71] No Bonjour/ZeroConfig support installed
其他3个对于各自的应用程序是相同的
答案1
问题出在您的安装部分:
[Install]
WantedBy=multi-default.target
multi-default.target
不是一件事。 systemd.特殊(7)列出您可以依赖的目标。default.target
如果这是总线的一部分--user
,或者multi-user.target
如果这是系统总线的一部分,则应该使用。看来您正在使用系统总线。
首先使用systemctl disable <service>
删除 的符号链接multi-default.target
,然后将安装部分更改为:
[Install]
WantedBy=multi-user.target
然后systemctl daemon-reload
加载更改并systemctl enable <service>
再次使用。