Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Ubuntu 20.04 LTS: Editing the user for a service run by a snap package

Writer Mia Lopez

I installed Sonarr from the Ubuntu application center, and from what I can tell it is part of a snap package. The service cannot access a hard drive mount I am using. I set up the drive in order to be owned by a user and group I specified. Sonarr appears to be running as a system application (based on what I read) and cannot look into directories on this mount, even though I made sure I ran chmod 777 on the relevant directories. Other services I run have no issues accessing the mount or writing to it. Only Sonarr. I did alot of searching and concluded that I need to change the user that the service runs under.

This is where googling has failed me. All the solutions are years old and I could not adapt them:

  1. I looked for the service configuration file in /lib/systemd and could not find it.
  2. Sonarr is now installed as a snap package and does not appear to use systemd for services. I dont know what it uses. It also does not need a user to install mono first.
  3. I found a snap file that appears to launch the sonarr service, but it has "DO NOT EDIT" on the first line. So I backed away.

So in order to proceed I need to know the following:

  1. Are services installed by snap managed from somewhere else?
  2. How can I find the configuration file for the service and change it to run as a specific user (e.g. me)
  3. If I set it to run as a specific user, does that mean the user has to be logged in for the service to work?

2 Answers

  1. Generally yes. Snaps are supposed to be self-contained, so rarely provide services that the rest of the system can use.

  2. Snaps are read-only. You cannot change files (like config files) within the Snap. Since this is an application with a web interface for configuration and account management, seems like you should be making your customization there.

    If the customization options that the Snap author provided are inadequate, then perhaps a Snap is not the best choice for you. Consider a different install option.

  3. If so, file a bug report with the Snap's author.

Um, individual Snaps are usually supported by the author of that Snap instead of by us. Bugs and problems with Snaps should be reported to the Snap author instead of to us. Issues with a Snap author's configuration choices are not really a problem that we can solve.

2

Snaps come with a number of limitations with regards to accessing locations outside of a user's home directory. If you're looking to have Sonarr run with very specific configuration settings, you might want to go with the non-Snap version.

Here's the basic installation directions:

  1. Open a Terminal (if one is not open already)
  2. Remove the existing Sonarr snap:
    sudo snap remove sonarr
    Note: Use snap list to list installed snaps to find the exact name for Sonarr if it's different to the one above.
  3. Add Sonarr's repository to your software sources list:
    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0xA236C58F409091A18ACA53CBEBFF6B99D9B78493
    echo "deb master main" | sudo tee /etc/apt/sources.list.d/sonarr.list
  4. Update apt:
    sudo apt update
  5. Install Sonarr, which is called nzbdrone:
    sudo apt install nzbdrone 
  6. Start the service:
    mono --debug /opt/NzbDrone/NzbDrone.exe

Be sure to confirm that UFW is configured to allow Sonarr access to the dedicated mount location.

Source: Sonarr's Installation Wiki

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy