[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: init system policy



On 18/11/2014 19:47, Matthias Urlichs wrote:

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

is an adequate and perfectly serviceable answer to your question.

On the other hand, the documented way to do this in systemd man pages is to use User and Group. If the User and Group variables have been added to unit files I naively think it was for a reason but I may be wrong.

I just mentioned that naively combining User=$TOTO or ${TOTO} TOTO being defined in an default/package file parsed by EnvironmentFile= does not seem to work as documented in man pages (seen the very same question being asked on various distro mailing list without definitive answer).

Maybe because Debian is a multiuser system AIUI, so running the daemon as a
specific "normal" user didn't even occur to me. Sorry!

Sure but what percentage is used by a single user? And for multiple users, to index multimedia files, you should either define a single location and a import script or play with groups and permission..

systemd for servers systems may still have some way to go for converting complex init scripts for firewall,openssh,VM's IMHO.

If you already do have an /etc/default/PACKAGE file, the sudo method's
advantage is that you can just use an EnvironmentFile= stanza, and thus
don't need to keep that and /etc/systemd/system/PACKAGE.service in sync
somehow.

The syntax may not always been compatible as it may use shell tricks to define variables. I do not mind duplicating the file as only one init system will be used at a time and transition should be the job of package setup when default init system changes (I know some backward compatibility is planned).

Thanks for your time.

-- eric



Reply to: