Mailinglist Archive: opensuse-factory (564 mails)

< Previous Next >
Re: [opensuse-factory] [RFC DRAFT] Phasing out sysvinit

Am Freitag, 16. Dezember 2011 schrieb Cristian Rodríguez:
On 17/12/11 17:41, Bernhard M. Wiedemann wrote:
As I understood it, native unit files are not needed for the goal
of fully switching to systemd and dropping sysvinit - so this
step (and all other steps about /etc/init.d/ replacement) should
be optional.
no, there should not be optional, as does solve the problem of
supporting two different ways to do things.

So I have to add this line to %build:
mv $BUILDROOT/etc/init.d/boot.apparmor $BUILDROOT/lib/apparmor/
and to add an apparmor.service file that calls
/lib/apparmor/boot.apparmor start

Mission accomplished, according to your proposal, and rpmlint will also
be happy *eg*

Don't get me wrong: I fully understand that maintaining systemd _and_
sysvinit will become a pain, but I don't see a point in forcing
everybody to migrate to *.service files instantly. (And I'm saying this
as someone who really prefers the short *.service files over the quite
long and verbose initscripts because the initscripts contain lots of
duplicated code.)

The migration might make sense (and is easy) for starting programs where
you can "write" an initscript with
sed 's/FOO/mydaemon' < /etc/init.d/skeleton > /etc/init.d/mydaemon

OTOH, there are init scripts like boot.apparmor which don't start a
daemon, but instead do lots of other things (like loading all AppArmor
profiles in /etc/apparmor.d/). AFAIK I _have to_ use a script for doing
that, and it would probably double the maintenance effort if you force
me not to use the existing init script.

Now tell me how to do this in a *.service file without using a script
(extremely simplified version of loading the AppArmor profiles):

ls -1 /etc/apparmor.d/ | grep -v 'rpmnew$\|rpmold$' | \
while read profile ; do
apparmor_parser "/etc/apparmor.d/$profile"

To avoid over-simplifying it, let me just mention that you have to use
apparmor_parser -r "$profile"
on reload, except if a profile was not loaded previously (which you can
find out by reading somewhere in /proc).
And you have to unload all profiles listed somewhere in /proc on "stop".

Is there a better solution than calling the good old initscript? ;-)

I already mentioned the easiest "fix" I could use at the beginning of
the mail, but IMHO it's pointless because systemd supports sysvinit-
style initscripts, and we won't get rid of all of them in the next
years - even if there are "only" some external packages that still come
with initscripts, we can't drop the backwards compatibility.

There is more documentation, than the old system ever had, including
full grown how-tos to convert both units and daemons, example c code,
libraries, tools, whatever..

Yes, but OTOH the old initscripts are plain shell code and therefore
grep-able and somehow self-documenting.

Additionally there's the usual (non)argument that everybody knows
initscripts quite well, so nobody needs documentation.
(I know that learning new things is part of the game, that's why I wrote
"(non)argument" ;-)

Sorry if this mail sounds like a flame, I'm probably influenced by the
4 flames on my advent wreath ;-))


Christian Boltz
Eine "Sprache", in der man
<xsl:call-template name="foo">
<xsl:with-param name="arg">blubber</xsl:with-param>
schreiben muß, wo jeder andere
schreibt, *muß* irgendwie ein Erfolg werden. Jedenfalls für
Festplatten- und Speicherverkäufer. [Stefan Reuther]

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

< Previous Next >
This Thread
Follow Ups