システムユーザーjackett
(useradd -r jackett
)を作成し、CentOS 7でそのユーザーとしてsystemdサービスを実行してみました。
サービスファイル:
[Unit]
Description=Jackett Daemon
After=network-online.target
[Service]
Type=simple
user=jackett
group=jackett
ExecStart=/usr/bin/mono --debug /opt/Jackett/JackettConsole.exe --NoRestart
[Install]
WantedBy=multi-user.target
サービスステータス:
[root@server Jackett]# systemctl status jackett
● jackett.service - Jackett Daemon
Loaded: loaded (/usr/lib/systemd/system/jackett.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2019-02-23 23:42:23 +03; 11min ago
Main PID: 24735 (mono)
CGroup: /system.slice/jackett.service
└─24735 /usr/bin/mono --debug /opt/Jackett/JackettConsole.exe --NoRestart
Feb 23 23:42:24 server mono[24735]: 02-23 23:42:24 Info Loading Cardigann definition /opt/Jackett/Definitions/yourexotic.yml
Feb 23 23:42:24 server mono[24735]: 02-23 23:42:24 Info Loading Cardigann definition /opt/Jackett/Definitions/zamundanet.yml
Feb 23 23:42:24 server mono[24735]: 02-23 23:42:24 Info Loading Cardigann definition /opt/Jackett/Definitions/zelkaorg.yml
Feb 23 23:42:24 server mono[24735]: 02-23 23:42:24 Info Loading Cardigann definition /opt/Jackett/Definitions/zooqle.yml
Feb 23 23:42:24 server mono[24735]: 02-23 23:42:24 Info Loading Cardigann definition /opt/Jackett/Definitions/ztracker.yml
Feb 23 23:42:24 server mono[24735]: 02-23 23:42:24 Info Adding aggregate indexer
Feb 23 23:42:25 server mono[24735]: Hosting environment: Production
Feb 23 23:42:25 server mono[24735]: Content root path: /opt/Jackett/Content
Feb 23 23:42:25 server mono[24735]: Now listening on: http://[::]:9117
Feb 23 23:42:25 server mono[24735]: Application started. Press Ctrl+C to shut down.
答え1
問題は明らかにsystemdが次のUser
代わりにcase:に特別な注意を払うことですuser
。
[Unit]
Description=Jackett Daemon
After=network-online.target
[Service]
Type=simple
User=jackett
Group=jackett
ExecStart=/usr/bin/mono --debug /opt/Jackett/JackettConsole.exe --NoRestart
[Install]
WantedBy=multi-user.target
引用: