[systemd-devel] /usr vs /etc for default distro units enablement

Michael Biebl mbiebl at gmail.com
Tue Nov 18 08:11:21 PST 2014


2014-11-18 14:52 GMT+01:00 Martin Pitt <martin.pitt at ubuntu.com>:
> Colin Guthrie [2014-11-18 13:01 +0000]:
>> >  * I suppose even wich such a policy the post-installation script
>> >    still needs to call some systemd-update-policy-mumble-mumble magic
>> >    to actually apply the new policy?
>>
>> Well, the *.policy files are simply read when calling "systemctl preset"
>
> Right. I meant, even with using presets, a newly installed package
> still needs to call "systemd preset foo.service" for all the units
> that it ships, so that the /etc symlinks are generated. I. e. we
> merely replace "enable" (what the current Debian packages do) with
> "preset" in the postinst.
>
> We need to do that as systemd doesn't automagically spot newly
> installed units (via inotify or what not) and enable them.
>
> Or did I misunderstand this?
>
>> The idea is that there are very few policy files shipped in a distro
>
> Indeed. A generic distro should have exactly one, with "disable *"
> (Fedora policy) or "enable *" (Debian policy). Anything more special
> would be customization for specialized images/spins/etc.
>
>> >  * With that, how would a package then say that it does *not* want a
>> >    particular unit to get enabled?
>>
>> The idea is that you don't really decide that at a package level, but at
>> a distro level.
>
> We do (and that policy drives the auto-generated postinst), but there
> are always special cases where a package might want to ship a unit
> which doesn't get enabled by default. I was wondering how that could
> be accomodated. So for that, the package itself could ship its own
> preset file, containing a "disable myself.service"? That would make
> sense (if I understood it right). Either way, this is certainly the
> rare exception.

I'm not sure if this preset feature with a single, centrally managed
and distro-provided file
is going to work with 1000+ packages shipping sysv init scripts (or in
the future, systemd .service files).

We really need the flexibility to decide that on a per package basis.




-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the systemd-devel mailing list