FAQ  •  Register  •  Login

Permissions for Serviio without root

<<

gkozto

Serviio newbie

Posts: 4

Joined: Thu Mar 13, 2014 11:56 am

Post Mon Apr 28, 2014 11:46 pm

Permissions for Serviio without root

Hi,
I've run Serviio before as root, and now when I start the service as normal user, I can't play anything (I get "file not supported" error for every file). Everything works, when I start serviio as root. I guess when I first ran serviio as root, I changed permissions for some files, and now I can't reach the database files without superuser permissions. My question is, which are the files I need to change the permissions for, and what permissions should I use? I'm using Kubuntu.

Thanks.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu May 01, 2014 7:03 pm

Re: Permissions for Serviio without root

there should be some tips in the Linux section on the wiki.
<<

Luckyfriend222

Streaming enthusiast

Posts: 46

Joined: Thu Jul 04, 2013 7:49 am

Post Fri May 02, 2014 8:07 am

Re: Permissions for Serviio without root

I'm running Serviio on Fedora 20.

What I did was, all my files on local disk have normal user permissions, say, for Larry. So file's permission is 664 (rw-rw-r-- larry larry). Then under the installation instruction for serviio, there is a section where you specify user to run serviio as, there I put root in, to ensure that all is working.

4a.Fedora >= 15 - Systemd script

Create the systemd script /lib/systemd/system/serviio.service with the following code: (If content library is available via nfs or cifs, add remote-fs.target in After=)

[Unit]
Description=Start the serviio DLNA server in headless mode
After=local-fs.target network.target

[Service]
Type=simple
User=root
ExecStart=/opt/serviio/bin/serviio.sh
ExecStop=/opt/serviio/bin/serviio.sh -stop
Restart=on-abort

[Install]
WantedBy=multi-user.target


This is according to installation instructions found @ http://wiki.serviio.org/doku.php?id=howto:linux:install:fedora

This setup works for me. Serviio doesn't physically change file permissions of files added to the library, so making the user root should not have a problem. It seems that your files on your file system is physically your problem. Their permissions, and ownership, should be set to normal user.

Hope this helps!
<<

gkozto

Serviio newbie

Posts: 4

Joined: Thu Mar 13, 2014 11:56 am

Post Fri May 02, 2014 12:08 pm

Re: Permissions for Serviio without root

Luckyfriend222 wrote:I'm running Serviio on Fedora 20.

What I did was, all my files on local disk have normal user permissions, say, for Larry. So file's permission is 664 (rw-rw-r-- larry larry). Then under the installation instruction for serviio, there is a section where you specify user to run serviio as, there I put root in, to ensure that all is working.



Thank your for your answer. I understand you're running serviio as root. Is this mandatory? I'd like to run serviio as a normal user without root.
<<

Luckyfriend222

Streaming enthusiast

Posts: 46

Joined: Thu Jul 04, 2013 7:49 am

Post Fri May 02, 2014 12:18 pm

Re: Permissions for Serviio without root

gkozto wrote:
Luckyfriend222 wrote:I'm running Serviio on Fedora 20.

What I did was, all my files on local disk have normal user permissions, say, for Larry. So file's permission is 664 (rw-rw-r-- larry larry). Then under the installation instruction for serviio, there is a section where you specify user to run serviio as, there I put root in, to ensure that all is working.



Thank your for your answer. I understand you're running serviio as root. Is this mandatory? I'd like to run serviio as a normal user without root.



According to other users (some on this forum) you should not run it as root. The setup as I've mentioned above worked the best for me. I also had problems with "file not supported", which turned out to be permissions. Therefore the actual Serviio service gets run as root. The installation folder under opt is still owned by normal user.
<<

grolschie

DLNA master

Posts: 695

Joined: Tue Jun 28, 2011 4:02 am

Post Fri May 02, 2014 8:27 pm

Re: Permissions for Serviio without root

My current setup:
serviio is run as user: serviio
serviio is a member of group: dlna
media folders and serviio install folder are owned by: user=[my username], group=dlna
media folders have permissions: drwxr-x--- i.e. chmod -R 750
serviio install folder has permissions: drwxrwx--- i.e. chmod -R 770


This allows me to freely access the media files, and serviio has read access to them. Serviio being a member of group dlna has write access to it's own install folder.

The only problem I have is that files created by serviio (e.g. log files) are owned by serviio:serviio, so I need to chmod or chown them to view them.
Using Serviio on Debian "Wheezy" with Xbox 360, Sony BDP-S370 & Panasonic E6.
<<

gkozto

Serviio newbie

Posts: 4

Joined: Thu Mar 13, 2014 11:56 am

Post Sun May 04, 2014 7:47 pm

Re: Permissions for Serviio without root

Thank you for your help, I'm running serviio with it's own user now, permissions are much better this way.

Here's what I did step-by-step, if anybody needs it:
  • created new user serviio and new group dlna
  • added the normal user and serviio user to dlna
  • changed serviio install folder owner group to dlna, and permissions to drwxrwx---
  • changed media folder owner group to dlna, and permissions to drwxr-x---
    My media files were on an NTFS partition, so I had to change the permissions in the fstab file. Also, Kubuntu normally mounts the drive under /media/[username]/[drive-label], user serviio can't reach this.
  • created a home directory for user serviio, because I was getting error messages without it.
  • used visudo, so my old user can use sudo to start the service as user serviio
  • started the service as user serviio from a bash script with this command (setting the language too):
      Code:
    sudo --user serviio --set-home /bin/bash -c "
          LANG=\"hu_HU.utf8\";
          SERVIIO_HOME=/path/to/serviio;
          source /path/to/serviio/bin/serviio.sh"

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 80 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.