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

Re: init system policy



Hi,

Eric Valette:
> >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).
> 
> That's typical: instead of answering the question, you try to say the actual
> packaging is absurd.

I didn't say it's absurd. I merely doubted that doing this is a good idea
in general.

Your specific package may well have different and non-general requirements,
in which case

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

is an adequate and perfectly serviceable answer to your question.

> init script has the ability to change the user and this is really useful
> because the multimedia file are likely owned by you and in your home
> directory by daemon and not minidlna and why should you belong to minidlna
> group?...
> 
Maybe because Debian is a multiuser system AIUI, so running the daemon as a
specific "normal" user didn't even occur to me. Sorry!

> But again this does not really slpit the script to configurable option that
> will not be overwritten when upgrading...

The idea is for the package to ship a /lib/systemd/system/PACKAGE.service
file which uses a "generic" user+group. You can then add a file
/etc/systemd/system/PACKAGE.service which merely overwrites user+group
settings and does not contain any other entries, in which case they'll
be inherited from the file in /lib. No overwriting on update will happen.

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.

-- 
-- Matthias Urlichs

Attachment: signature.asc
Description: Digital signature


Reply to: