On 18/11/2014 17:46, Ansgar Burchardt wrote:
Hi,

On 11/18/2014 05:39 PM, Matthias Urlichs wrote:
     trying to convert minidlna sysv init file to systemd, managed to have
     a working unit file but failed to split the configuration mimicing
     the ../default/minidlna content with the hability to make USER and
     GROUP configurable.

You _can_ do

     ExecStart=sudo -u $USER_MINIDLNA -g GROUP_MINIDLNA /usr/sbin/minidlnad -S

but that's not the optimal solution here.

It's better IMHO to use a fixed user in your packaging -- why should that
user be configurable in the first place? If the sysadmin _really_ needs to
use a different user+group, they can add an overriding unit file to
/etc/systemd/system/ (files get merged, so no need to copy the whole thing).

Ack.

In the file they just need to set User and Group then?


Both of these can be replaced with

   RuntimeDirectory=minidlda

which will create /run/minidlna, chown it to the user given in User= and
even remove it again once the service is stopped.

There's RuntimeDirectoryMode= if you need different permissions.

All of this is documented in systemd.exec(5) if you want more information.

Thanks. I read them for trying to fix the User= dynamic problem but did not found this.

-- eric



--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/546b8114.7050...@free.fr

Reply via email to