Sonarr systemd service not working Xubuntu

**Sonarr version 2.0.0.4146
**Mono version 4.2.3.4
OS: xubuntu 16.04
((Debug logs)) (posted to hastebin or similar):
Here is the error

● sonarr.service - Sonarr Daemon
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead) (Result: exit-code) since Fri 2016-06-03 18:40:52 PDT; 43min ago
 Main PID: 8062 (code=exited, status=203/EXEC)

Jun 03 18:46:48 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:1] Assignment outside of section. Ignoring.
Jun 03 18:46:48 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:12] Invalid escape sequences in line, correcting: "-/
Jun 03 18:46:48 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:13] Missing '='.
Jun 03 18:49:59 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:13] Missing '='.
Jun 03 18:54:38 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:1] Assignment outside of section. Ignoring.
Jun 03 18:54:38 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:14] Missing '='.
Jun 03 19:02:37 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:1] Assignment outside of section. Ignoring.
Jun 03 19:02:37 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:18] Missing '='.
Jun 03 19:23:54 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:1] Assignment outside of section. Ignoring.
Jun 03 19:23:54 herrinNAS systemd[1]: [/lib/systemd/system/sonarr.service:18] Missing '='.

sonarr.service file

cat > sonarr.service << EOF
[Unit]
Description=Sonarr Daemon
After=syslog.target network.target

[Service]
User=zh
Group=zh

Type=simple
ExecStart=/usr/lib/mono /opt/NzbDrone/NzbDrone.exe> -nobrowser
TimeoutStopSec=20
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

I am trying to do the systemd auto boot on xubuntu 16.04 and I am getting multiple errors when I try to start or enable the service. I have copied the script from github and the only changed I made are the username, groupname and paths, all of which I know are correct. Here is what I am seeing when I try to enable. Any ideas or things to try and do? Any help would be appreciated. Would it be worth trying to do a fresh install and if so how do I go about clearning all of the config files in the system so they do not cause this issue during the next install? New to ubuntu so bare with me.

The systemd unit should be

[Unit]
Description=Sonarr Daemon
After=syslog.target network.target

[Service]
User=zh
Group=zh

Type=simple
ExecStart=/usr/lib/mono /opt/NzbDrone/NzbDrone.exe> -nobrowser
TimeoutStopSec=20
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target

the cat > sonarr.service << EOF is to do a “here document” redirect to a file

That took care of most of them but I am still getting a failed to start sonarr daemon. Here is what its telling me, I did daemon restart, enabled and disabled service and still getting an error. He is what it tells me

● sonarr.service - Sonarr Daemon
   Loaded: loaded (/lib/systemd/system/sonarr.service; enabled; vendor preset: enabled)
   Active: inactive (dead) (Result: exit-code) since Fri 2016-06-03 21:15:31 PDT; 3min 13s ago
  Process: 1081 ExecStart=/usr/lib/mono /opt/NzbDrone/NzbDrone.exe> -nobrowser (code=exited, status=203
 Main PID: 1081 (code=exited, status=203/EXEC)

Jun 03 21:15:30 herrinNAS systemd[1]: sonarr.service: Unit entered failed state.
Jun 03 21:15:30 herrinNAS systemd[1]: sonarr.service: Failed with result 'exit-code'.
Jun 03 21:15:31 herrinNAS systemd[1]: sonarr.service: Service hold-off time over, scheduling restart.
Jun 03 21:15:31 herrinNAS systemd[1]: Stopped Sonarr Daemon.
Jun 03 21:15:31 herrinNAS systemd[1]: sonarr.service: Start request repeated too quickly.
Jun 03 21:15:31 herrinNAS systemd[1]: Failed to start Sonarr Daemon.

The wiki points to /usr/lib/mono, i have sonarr also running in ubuntu 16 in an lxc, the default mono binary is located in /usr/bin/mono if you used the mono from standard ubuntu repos. So change the execstart to /usr/bin/mono

Anyway check with which mono

Also after you have it working add this

StandardOutput=null

to the [service] section otherwise the syslog is gonna heavily spammed by sonarr logs.

That worked, I also found a > next to NzbDrone.exe which was also causing an issue. Thanks again!

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