Radarr service wouldn't start until I removed some hardening

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
gouthamravee
Posts: 4
Joined: Sun Mar 21, 2021 5:35 am

Radarr service wouldn't start until I removed some hardening

Post by gouthamravee »

Fresh install of Radarr through dietpi installer would not auto start through systemctl.

This is the error I kept getting in the systemctl logs through journalctl

Code: Select all

Mar 20 23:03:21 radarr systemd[548]: radarr.service: Failed to set up mount
namespacing: No such file or directory
Mar 20 23:03:21 radarr systemd[548]: radarr.service: Failed at step NAMESPAC
E spawning /opt/radarr/Radarr: No such file or directory
The directory /opt/radarr/ does exist and so did the file Radarr in there. I was able to start Radarr manually using

Code: Select all

sudo -u radarr /opt/radarr/Radarr -nobrowser -data=/mnt/dietpi_userdata/radarr
After some more research I tried turning off some of the hardening settings, and it looks like this specific setting
ReadWritePaths=/opt/radarr /mnt /media /var/log/radarr /tmp
is causing the failure.

I don't know why because as far as I can see this setting should make all the paths after it read/write to the radarr service.

Right now I'm running with all the hardening rules except for
ProtectSystem=Strict and ReadWritePaths.

Also how come y'all don't use these same hardening rules for sonarr?
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Radarr service wouldn't start until I removed some hardening

Post by Joulinar »

Hi,

hmm I'm not realy able to replicate your issue with radarr. I did a test installation on a RPi3B+ 32bit without issues. Radarr service is working ootb without any changes made. :?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Radarr service wouldn't start until I removed some hardening

Post by MichaIng »

Have you moved /opt ot /mnt/dietpi_userdata to any special mount point? I saw once the letter being mounted to /home/user which would not only break or Sonarr/Radarr/...arr (all the same), but also the default Debian MariaDB package and others.

Which SBC/platform are you using? Debian Stretch or Buster (or Bullseye)?
gouthamravee
Posts: 4
Joined: Sun Mar 21, 2021 5:35 am

Re: Radarr service wouldn't start until I removed some hardening

Post by gouthamravee »

Thank you for the responses y'all!

I use dietpi on my VMs on proxmox. I always do a vanilla install of the dietpi UEFI image.
Debian buster, though I do force the kernel to update to the latest version, I think it updated to 5.11.

No directories were moved, everything is where it is installed by default. Also everything is on one volume/'drive'. I don't move any part of the VM to other drives. I have a data storage for my media files, that's provided by OMV through SMB. I mount that network folder to the VM, no issues there accessing the files.

I did force it to install Radarr V3, but I was having the issue even before then. I figured Radarr V3 would fix it, but nah, either way at the end of the day it was the hardening rules that prevented it from running. I did also make sure the radarr user had permission to read/write/execute everything inside /opt/radarr and mnt/dietpie_userdata/radarr
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Radarr service wouldn't start until I removed some hardening

Post by MichaIng »

It should not prevent the service start, but where is the SMB drive mounted?

Indeed the underlying Mono/.NET library had or has issues to write to directories that are not owned by the executing user and do not support POSIX permissions. But Radarr v3 AFAIK worked around that. That however still should not break the whole service to start :?.
gouthamravee
Posts: 4
Joined: Sun Mar 21, 2021 5:35 am

Re: Radarr service wouldn't start until I removed some hardening

Post by gouthamravee »

I used the dietpi config to setup the network mounts.

I mounted two network folders, both are in /mnt

For the radarr v3 install I went with the .net core variant instead of mono.

Here is what the service file looks like right now

Code: Select all

[Unit]
Description=Radarr Daemon (DietPi)
Wants=network-online.target
After=network-online.target dietpi-boot.service

[Service]
SyslogIdentifier=Radarr
User=radarr
Group=dietpi
UMask=002
ExecStart=/opt/radarr/Radarr -nobrowser -data=/mnt/dietpi_userdata/radarr
TimeoutStopSec=50
KillMode=process
Restart=on-failure

# Hardening
#ProtectSystem=full
ProtectHome=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectControlGroups=true
#ReadWritePaths=/opt/radarr /mnt /media /var/log/radarr /tmp

[Install]
WantedBy=multi-user.target
and the contents of /mnt

Code: Select all

dietpi@radarr:~$ ls -halt /mnt
total 20K
drwxr-xr-x 18 root   root   4.0K Mar 22 02:17 ..
drwxrwxr-x  7 dietpi dietpi 4.0K Mar 20 22:19 dietpi_userdata
drwxr-xr-x  7 root   root   4.0K Mar 20 22:17 .
drwxrwx---  2 radarr dietpi    0 Mar  9 11:03 movies
drwxrwx---  2 radarr dietpi    0 Feb  2 21:41 downloads
drwxrwxr-x  2 dietpi dietpi 4.0K Sep 17  2020 nfs_client
drwxrwxr-x  2 dietpi dietpi 4.0K Sep 17  2020 ftp_client
I had to modify UID and GID on the fstab entries so that the radarr user could read/write to the two mounts.
I had to make the same change on my sonarr VM, except with the sonarr user.
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Radarr service wouldn't start until I removed some hardening

Post by Joulinar »

usually it should be enough to put all user into dietpi user group and to assign r/w permission to this group
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
gouthamravee
Posts: 4
Joined: Sun Mar 21, 2021 5:35 am

Re: Radarr service wouldn't start until I removed some hardening

Post by gouthamravee »

If you're talking about the changes I had to make to fstab, that's because of how I have the shares setup in Open Media Vault. The dietpi group doesn't exist in OMV and I think the ACLs on there cause issues to read/write. I can connect to the share without issues, but anything else requires setting the UID/GID on fstab to the specific user.

Which I'm okay with, I'd rather have those folders accessible by specific users rather than a group.
Post Reply