You are not logged in.

#1 2016-12-13 20:52:55

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Two SystemD Scripts Fail To Start

This has happened to me multiple times over the years and I still can't figure out what fixes it because sometimes it works and other times it doesn't.

I have cloned SickRage and CouchPotato from their respective Git repositories (since I like the auto-update feature which installing it from the AUR doesn't support IIRC) and modified the service files to include a few different flags for the python scripts. I have them running as root right now (yes I know bad idea, but I nuked my 8 TB ZFS pool a few days ago and I'm trying to get things bad ASAP without fighting with permission issues right now, I'll change them to an unprivileged account later) and the service files for them fail to start for some unknown reason, yet when I copy the ExecStart line and run it manually it works without issue. Seeing as they're running as root they should have no issues with permissions so I have no idea what the issue can be.

[root@server ~]# systemctl status sickrage.service
● sickrage.service - SickRage Daemon
   Loaded: loaded (/usr/lib/systemd/system/sickrage.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2016-12-13 15:38:59 EST; 1min 22s ago
  Process: 3704 ExecStart=/usr/bin/python2.7 /opt/sickrage/SickBeard.py --daemon --nolaunch --datadir=/opt/sickrage (code=exited, status=216/GROUP)

Dec 13 15:38:59 server.brandongolway.us systemd[1]: Starting SickRage Daemon...
Dec 13 15:38:59 server.brandongolway.us systemd[1]: sickrage.service: Control process exited, code=exited status=216
Dec 13 15:38:59 server.brandongolway.us systemd[1]: Failed to start SickRage Daemon.
Dec 13 15:38:59 server.brandongolway.us systemd[1]: sickrage.service: Unit entered failed state.
Dec 13 15:38:59 server.brandongolway.us systemd[1]: sickrage.service: Failed with result 'exit-code'.

journalctl -u sickrage

Dec 13 15:38:59 server.brandongolway.us systemd[1]: Starting SickRage Daemon...
Dec 13 15:38:59 server.brandongolway.us systemd[1]: sickrage.service: Control process exited, code=exited status=216
Dec 13 15:38:59 server.brandongolway.us systemd[1]: Failed to start SickRage Daemon.
Dec 13 15:38:59 server.brandongolway.us systemd[1]: sickrage.service: Unit entered failed state.
Dec 13 15:38:59 server.brandongolway.us systemd[1]: sickrage.service: Failed with result 'exit-code'.
Dec 13 15:42:32 server.brandongolway.us systemd[1]: Starting SickRage Daemon...
Dec 13 15:42:32 server.brandongolway.us systemd[1]: sickrage.service: Control process exited, code=exited status=216
Dec 13 15:42:32 server.brandongolway.us systemd[1]: Failed to start SickRage Daemon.
Dec 13 15:42:32 server.brandongolway.us systemd[1]: sickrage.service: Unit entered failed state.
Dec 13 15:42:32 server.brandongolway.us systemd[1]: sickrage.service: Failed with result 'exit-code'.

sickrage.service

[Unit]
Description=SickRage Daemon

[Service]
User=root
Group=sickrage

Type=forking
GuessMainPID=no
ExecStart=/usr/bin/python2 /opt/sickrage/SickBeard.py --daemon --nolaunch

[Install]
WantedBy=multi-user.target

couchpotato.service

[Unit]
Description=CouchPotato application instance
After=network.target

[Service]
ExecStart="/usr/bin/python2 /opt/couchpotato/CouchPotato.py --console_log"
Type=simple
User=root
Group=wheel

[Install]
WantedBy=multi-user.target

CouchPotato fails with the same errors as SickRage. If I use the type simple for SickRage it works without issue.

Last edited by brando56894 (2016-12-13 20:58:07)

Offline

#2 2016-12-14 22:07:32

jjb2016
Member
From: Oxfordshire
Registered: 2016-02-29
Posts: 73

Re: Two SystemD Scripts Fail To Start

Briefly, what do SickRage and CouchPotato do?  Do they have any sort of dependency on other services (such as ZFS, filesystems, network activity) which may need to be added into their service unit files?

Last edited by jjb2016 (2016-12-14 22:07:52)

Offline

#3 2016-12-14 23:04:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Two SystemD Scripts Fail To Start

brando56894 wrote:

If I use the type simple for SickRage it works without issue.

Then do that.  There are guidelines on systemd services in the github repo with sickrage.  Why do you not start it as advised there?

As for the second one, the quotes around ExecStart are a problem.  ExecStart expects an executable and it's parameters, not a string that must be parsed by a shell.  Just remove the quotes.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2016-12-15 00:43:38

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Two SystemD Scripts Fail To Start

Trilby wrote:
brando56894 wrote:

If I use the type simple for SickRage it works without issue.

Then do that.  There are guidelines on systemd services in the github repo with sickrage.  Why do you not start it as advised there?

When you clone the repo and edit the service file the default setup is using forking and runs it as a daemon, the other types are available but they're commented out so I just left it at the default.

Using simple now doesn't work either for some reason

[Unit]
Description=SickRage Daemon

[Service]
User=root
Group=sickrage

Type=simple
ExecStart=/usr/bin/python2 /opt/sickrage/SickBeard.py --nolaunch

[Install]
WantedBy=multi-user.target
[root@server ~]# status sickrage
● sickrage.service - SickRage Daemon
   Loaded: loaded (/usr/lib/systemd/system/sickrage.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-12-14 19:34:28 EST; 4s ago
  Process: 25452 ExecStart=/usr/bin/python2 /opt/sickrage/SickBeard.py --nolaunch (code=exited, status=216/GROUP)
 Main PID: 25452 (code=exited, status=216/GROUP)

Dec 14 19:34:28 server.brandongolway.us systemd[1]: Started SickRage Daemon.
Dec 14 19:34:28 server.brandongolway.us systemd[1]: sickrage.service: Main process exited, code=exited, status=216/GROUP
Dec 14 19:34:28 server.brandongolway.us systemd[1]: sickrage.service: Unit entered failed state.
Dec 14 19:34:28 server.brandongolway.us systemd[1]: sickrage.service: Failed with result 'exit-code'.

I didn't see anything in the SickRage Wiki regarding systemd unit files.


Trilby wrote:

As for the second one, the quotes around ExecStart are a problem.  ExecStart expects an executable and it's parameters, not a string that must be parsed by a shell.  Just remove the quotes.

Thanks that fixed it, I don't remember adding those....

Offline

#5 2016-12-15 02:07:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Two SystemD Scripts Fail To Start

I had never heard of sickrage - I don't even have a clue what it is.  But the *very* first result of a websearch for it goes to the github page which includes guidance on writing systemd service files:
https://github.com/SiCKRAGETV/SiCKRAGE/ … it.systemd


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2016-12-15 04:47:06

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Two SystemD Scripts Fail To Start

Is there a way to get more information regarding why it's failing?

Offline

#7 2016-12-15 16:18:56

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Two SystemD Scripts Fail To Start

Start by using the little bit of info it has already given: "status=216/GROUP". Given that you are "trying to get things bad [back?] ASAP", you probably forgot to create a sickrage group.

Offline

#8 2016-12-15 16:32:59

brando56894
Member
From: NYC
Registered: 2008-08-03
Posts: 681

Re: Two SystemD Scripts Fail To Start

Raynman wrote:

Start by using the little bit of info it has already given: "status=216/GROUP". Given that you are "trying to get things bad [back?] ASAP", you probably forgot to create a sickrage group.

Yep that was it, I changed the group and it worked as expected. Also the keys on my keyboard keep sticking, it's pretty annoying haha

Offline

Board footer

Powered by FluxBB