How to stop Sonarr updates from reverting user and group in systemd

Sonarr version: 2.0.0.5225
Mono version: 5.12.0
Antergos Linux
Cinnamon 3.8.7
Kernel 4.17.5-1-Arch

I was running Sonarr 2.0.0.5225 and configured it to run as a specific user and group:

[Unit]
Description=Sonarr Service
After=network.target

[Service]
User=gene
Group=users
ExecStart=/usr/bin/sonarr -nobrowser -data=/var/lib/sonarr
Type=simple
TimeoutStopSec=20
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target

Then 2.0.0.5228 came along and after the update, it reverted back to ‘sonarr’ for the user and group:

[Unit]
Description=Sonarr Service
After=network.target

[Service]
User=sonarr
Group=sonarr
ExecStart=/usr/bin/sonarr -nobrowser -data=/var/lib/sonarr
Type=simple
TimeoutStopSec=20
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target

…needless to say, this totally busted everything but after simply editing the .service file and putting back in gene:users, I was back up and running. Is it normal for updates to revert those fields? Or should I send a message to the package maintainer on AUR to correct something?

OR, this is indeed normal and a workaround would be to stop using systemd and just call Sonarr from ‘Startup Applications’ via: /usr/bin/sonarr -nobrowser -data=/var/lib/sonarr

Thanks

Well.
One, we don’t provide the Antergos Linux package, so I suggest you contact the package maintainer.
Two, you can have .override files in systemd to override specific fields instead of editing package-provided unit files.

Thanks for pointing me in the right direction! Creating /usr/lib/systemd/system/sonarr.service.d/override.conf and in that file, I entered:

[Service]
User=roadhazard
Group=users

…restarted and all is well.

Thanks for sharing the solution. I used this to fix the same issue I was having with PLEX.

Also,

sudo systemctl edit ‘service name’ will automatically create the override file for you.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.