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

Re: Debian systemd survey



On Thu, 30 May 2013 12:32:59 +0100, Simon McVittie <smcv@debian.org>
wrote:
>On 30/05/13 11:19, Marc Haber wrote:
>> On Wed, 29 May 2013 13:10:57 -0700, Russ Allbery <rra@debian.org>
>> wrote:
>>> Using an imperative language for a descriptive purpose is a bad mismatch
>>> of tools and has been ever since the practical effect of init scripts has
>>> become fairly standardized.
>> 
>> Some init scripts in Debian build dynamic configuration before the
>> daemon is started. It has grown to be an important part of conffile
>> and configuration management for software that cannot by itself read
>> its configuration in snippets from a foo.conf.d directory.
>> 
>> I am not sure how we would handle that in a "descriptive" approach.
>
>My preferred answer is "give the daemon better configuration handling,
>so you can get maximum benefit from having a declarative init", but if
>that isn't an option:

That is often not an option. In my case, for example, it's skills. I
would not dare to write configuration handling code in C code that is
destined to run as root, while I don't have much issues in writing
such code in perl or even in shell. otoh, I maintain quite some daemon
packages that have their code written in C.

Additionally, this "this traditionally written daemon does not work
nicely with systemd, so change the daemon instead of making systemd
behave as if it was destined for Unixoid OSses" attitude is a big
topic for systemd opponents.

>systemd:
>    ExecStartPre=/usr/share/myservice/hack-up-the-config.sh
>    ExecStart=/usr/sbin/myservice

Can the hack-up-the-config.sh give an error message that is shown to
the user? Can it abort the daemon start? How would systemd handle this
case if it is configured to make sure the daemon is always running?

>Upstart:
>    pre-start script
>      # entirely untested, but [1] suggests that this might be right?
>      /usr/share/myservice/hack-up-the-config.sh || { stop; exit 0; }
>    end script
>    script
>      /usr/sbin/myservice
>    end script

Ugly. Same questions apply.

Greetings
Marc
-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber         |   " Questions are the         | Mailadresse im Header
Mannheim, Germany  |     Beginning of Wisdom "     | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834


Reply to: