[SOLVED] Trying to enable systemd sonar.service gives error message

Sonarr version (exact version): installed today/most recent (can’t find linux command to check version…)
Mono version (if Sonarr is not running on Windows):Stable 4.6.2.16/ac9e222
OS: Raspberry Pi Debian/Jessie
((Debug logs)): pi@raspberrypi:~ $

Error message:
sudo systemctl enable sonarr.service
Failed to execute operation: Bad message

(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)
Description of issue:

SOLUTION: remove the ‘EOF’ from the bottom of the sonar.service file… @markus101 maybe remove this from the wiki guide?

The above error message occurs when trying to enable the systemd service (I know systemd works fine as its used to launched deluge on same system)

I am able to launch manually just fine with /usr/bin/mono /opt/NzbDrone/NzbDrone.exe

Followed the sonar wiki guide for systemd autostart. Found another thread relating to similar issue - said having absolute path solved it, but as you can see below, hasn’t helped me.

Heres the “sonar.service” file - path: /lib/systemd/system/sonarr.service
Created in home directory and then moved to the systemd/system folder.

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

[Service]
User=pi
Group=pi

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

[Install]
WantedBy=multi-user.target
EOF

Removing cat > sonarr.service << EOF has no effect.

Rights:
-rw-r--r-- 1 root root 295 Feb 5 14:04 sonarr.service

Further:

pi@raspberrypi:~ $ sudo systemctl status sonarr.service
● sonarr.service - Sonarr Daemon
   Loaded: error (Reason: Bad message)
   Active: inactive (dead)

Feb 05 14:53:33 raspberrypi systemd[1]: [/lib/systemd/system/sonarr.service:17] Missing '='.
Feb 05 14:53:53 raspberrypi systemd[1]: [/lib/systemd/system/sonarr.service:17] Missing '='.

Also tired running the service file from /etc/systemd/system, which is where deluge does (which works for deluge…)

No, it’s supposed to be there, so the cat command knows where to terminate the import.

Odd! Not sure what’s happening then.

When I removed it - all goes well.

pi@raspberrypi:~ $ systemctl status sonarr.service
● sonarr.service - Sonarr Daemon
Loaded: loaded (/lib/systemd/system/sonarr.service; enabled)
Active: active (running) since Sun 2017-02-05 15:19:48 AEST; 1min 19s ago
Main PID: 628 (Main)
CGroup: /system.slice/sonarr.service
└─628 /usr/bin/mono /opt/NzbDrone/NzbDrone.exe -nobrowser

If I add it back in, I get the Failed to execute operation: Bad message error again and it won’t enable/start.

Maybe it’s just a Raspberry Pi OS thing?

Did you create the file yourself or did you run the cat command to create it?

Tried it both ways to make sure that wasn’t tripping it up, earlier on in my troubleshooting.

With cat it shouldn’t even write that line to the file, but if you created a file with that text I can see it being a problem.

No worries. Can’t say for sure, but likely user error.

Allow me to elaborate:

cat > sonarr.service “Take the console input and pipe it into a file named ‘sonarr.service’”
<< EOF “till I type EOF in the console”
[Unit]....WantedBy... Content we want put in the file
EOF to tell cat to stop, as instructed earlier.
Result, you end up with ‘sonarr.service’ with the [Unit]....WantedBy... content. All from the cmdline needing only cat, works on any distro without resorting to vim/nano/etc.

The systemd wiki stuff was written by someone who was a cmdline aficionado. IMHO it’s not clear at all, but i’m lazy today, not gonna edit it.

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