-
Notifications
You must be signed in to change notification settings - Fork 27
Home
SimpleTracker edited this page Jan 28, 2024
·
35 revisions
若以 Root 用户运行, 则:
- 放入 /etc/systemd/system/ (全局系统服务) 下;
- 重载 Systemd Daemon 以识别新服务:
systemctl daemon-reload
; - 启动服务:
systemctl start qbittorrent-clientblocker.service
; - 为服务设置开机自启 (可选):
systemctl enable qbittorrent-clientblocker.service
;
若以 普通 用户运行, 则:
- 放入 /etc/systemd/user/ (全局用户服务) 或 ~/.local/share/systemd/user/ (单用户服务) 下;
- 重载 Systemd Daemon 以识别新服务:
systemctl --user daemon-reload
; - 启动服务:
systemctl --user start qbittorrent-clientblocker.service
; - 为服务设置开机自启 (可选):
systemctl --user enable qbittorrent-clientblocker.service
;
qbittorrent-clientblocker.service
[Unit]
Description=qBittorrent-ClientBlocker service
Wants=network-online.target
After=qbittorrent-nox.service
[Service]
Type=simple
Restart=always
WorkingDirectory=%h/.config/qBittorrent-ClientBlocker/
ExecStart=/usr/local/bin/qBittorrent-ClientBlocker
[Install]
WantedBy=multi-user.target
- 放入 /etc/systemd/system/ (全局系统服务) 下;
- 重载 Systemd Daemon 以识别新服务:
systemctl daemon-reload
; - 启动服务:
systemctl start qbittorrent-clientblocker@实例.service
; - 为服务设置开机自启 (可选):
systemctl enable qbittorrent-clientblocker@实例.service
;
qbittorrent-clientblocker(at).service (替换 (at) 为 @)
[Unit]
Description=qBittorrent-ClientBlocker service
Wants=network-online.target
After=qbittorrent-nox.service
[Service]
Type=simple
Restart=always
User=%i
WorkingDirectory=/etc/qBittorrent-ClientBlocker/%i/
ExecStart=/usr/local/bin/qBittorrent-ClientBlocker
[Install]
WantedBy=multi-user.target
Thanks @amefs #9