Mailinglist Archive: opensuse-packaging (267 mails)

< Previous Next >
Re: [opensuse-packaging] package looking for maintainer: the AT daemon
Hello,

Am Dienstag, 27. November 2012 schrieb Ludwig Nussel:
Christian Boltz wrote:
Am Montag, 5. November 2012 schrieb Ralf Lang:
Am 04.11.2012 16:40, schrieb Christian Boltz:
I just fixed this - atd.service now contains:
ExecStart=/bin/bash -c '[ -e /etc/sysconfig/atd ] && .
/etc/sysconfig/atd; exec /usr/sbin/atd $${ATD_BATCH_INTERVAL:+-b
$$ATD_BATCH_INTERVAL} $${ATD_LOADAVG:+-l $$ATD_LOADAVG}'

(should I have added a comment "# looks ugly, but works"? ;-)

I don't think the above is in the spirit of systemd.

That's very visible when you look at the ExecStart line ;-) and is also
the reason why I asked if I should have added the "looks ugly, but
works" comment ;-)

The motivation behind this change was simple - fix the bug "settings in
/etc/sysconfig/atd are ignored" (which was a regression by switching to
a service file). I never said I like this solution, but it works ;-)

For future versions, feel free to fix atd so that it reads a config file
at startup.

Ideally atd would
parse /etc/sysconfig/atd itself¹ and set it's defaults accordingly.

Or /etc/atd.conf ;-)

Anyway - yes, _every daemon_ should have a config file where you can
configure everything that you can specify as commandline option. Having
only commandline options for a daemon is pointless.

Besides that: yes, I love to keep things simple, and therefore like the
systemd approach. But as you can see, things aren't always that easy ;-)

Using shell for this kind of things is one of the reasons why init
scrips became such beasts.

Allow me to disagree ;-)

IMHO the main problem of initscripts is that they contain a big
copy&paste skeleton. If you have two initscripts that are based on the
same (version of the) skeleton, you'll have 80 identical lines and maybe
10 lines that actually differ. In other words: you have to maintain
those 80 lines 50 times because they were copied to 50 initscripts.
You can't call that "code duplication" - it's "code multiplication" ;-)

I'm quite sure we could have "maintainable" init scripts by rewriting
them to a common "base script" that includes daemon-specific config or
code sniplets. Maybe those sniplets could even look similar to the
systemd service files (in a bash-readable syntax of course) - and I'm
sure those sniplets could be as short as a service file for most
daemons. [1]

OTOH, there are cases where service files are "too simple" (especially
various boot.* initscripts come to mind), so we _will_ need to call a
(wrapper) script to do the actual work in some cases.


Regards,

Christian Boltz

[1] No, I'm not proposing to go back to sysvinit and rewrite all
initscripts - but I'm quite sure it would be possible.
--
Ich rede davon, daß eine defekte Schrift an freetype übergeben wird (Daß
sie defekt ist, kann ich ja nicht prüfen), woraufhin freetype irgendeine
(defekte) Anweisung im Fontcode ohne Prüfung ausführt und erstmal
getreulich versucht, sagenwirmal 5 Okobyte RAM von der Adresse $IRSINN
nach $WAHNSINN zu verschieben. [Ratti in suse-programming]

--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups