sonarr and radarr fail to start on reboot RPI4

Hi,
I have started up a new Dietpi system to replace an existing installation. RPI4 booting from a SSD on USB3 port. Have tried reinstalling the system several times with the same result every time. Installing 7.5.2 bullseye version, but have upgraded to 7.6.2 with the same result.

radarr, sonarr, nzbget and emby all install fine and run perfectly UNTIL the system is restarted, then sonarr and radarr wont restart. If I do ‘dietpi-software reinstall sonar’ or ‘dietpi-software reinstall radarr’ then they come back to life and everything is fine.

It seems that services are just not restarting. Her is the output of joournelctl:

sonarr.service: Failed to set up mount namespacing: /run/systemd/unit-root/var/log/sonarr: No such file or directory
sonarr.service: Failed at step NAMESPACE spawning /usr/bin/mono: No such file or directory
radarr.service: Failed to set up mount namespacing: /run/systemd/unit-root/var/log/radarr: No such file or directory
radarr.service: Failed at step NAMESPACE spawning /opt/radarr/Radarr: No such file or directory

As I said, everything works when reinstalled, just not with a reboot.

Any suggestions would be greatly appreciated!
Steve

we had a couple of cases like this but no solution until now https://dietpi.com/forum/t/resolved-radarr-and-sonarr-services-failed/5527/1

How do you restart your system?

I had this same issue, and was able to solve it after a day spent looking around. The issue for me seemed to be with the permissions hardening in the sonarr.service.

If you edit the systemd entry point, comment everything out under the “#Hardening” and restart the Raspberry Pi, and I was able to get Sonarr working. [Radarr was already functional for me]

Nasty, the problem is that all paths listed in the systemd units ReadWritePaths setting need to exist. Also the output of above shows it: https://dietpi.com/forum/t/sonarr-and-radarr-fail-to-start-on-reboot-rpi4/5747/1

The log directory is missing in your case. So commenting the hardenings wouldn’t help as Sonarr and Radarr still require the log directory to start:

mkdir /var/log/sonarr
chown sonarr /var/log/sonarr

The other directory which could possibly missing is /media.

Just found a solution to let systemd ignore non-existing paths and applied it for all such cases, since we want a meaningful error message and not something cryptic about NAMESPACE which no-one was able to interpret until now :sunglasses:: https://github.com/MichaIng/DietPi/commit/5320442

Thank you VERY much!

Steve