0

I've created a system user jackett (useradd -r jackett) and I'm trying to run a systemd service under it on CentOS 7.

Service File:

[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

Service Status:

[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.

htop Shows Process Running Under Root enter image description here

  • @JeffSchaller lrwxrwxrwx 1 root root 9 Feb 23 22:25 /usr/bin/mono -> mono-sgen this is what I get. Should I change the owner to jackett? – AlGallaf Feb 23 at 21:39
  • @JeffSchaller It shows the following -rwxr-xr-x 1 root root 4591120 Jan 17 11:50 /usr/bin/mono-sgen. – AlGallaf Feb 23 at 21:43
  • I haven't experimented to know for sure, but you could also try capital-U User instead of user... reference – Jeff Schaller Feb 23 at 21:50
  • 1
    Capital-U! Thanks @JeffSchaller! Service is working now under jackett user. – AlGallaf Feb 23 at 21:53
0

The trouble is apparently that systemd is particular about case: User instead of 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

Reference:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.