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

Proposal: A config file for runlevels (DRAFT)



[My apologies to everyone who recieves this twice.]


You may have read the discussion about possible enhancements in Debians
configuration policy. This mail is a request for comments on one
aspect of the discussion: a config file for runlevels.

The traditional "SysV" scheme of implementing runlevels is through links
in "/etc/rc?.d/*". The main problem with this links is that you can't
get easily a survey of your setup. 
I rewrote the "rc"-program so it handles _one_ config file instead of
many links in "/etc/rc?.d/*". Here's an extract from this config file:

        # This is the configuration file for /etc/debian/runlevel.conf
        #
        #Format:
        #<sort> <stop-> <start-levels>  <script>
        05      -       0               /etc/init.d/halt
        05      -       1               /etc/init.d/single
        05      -       6               /etc/init.d/reboot
        10      0,1,6   2,3,4,5         /etc/init.d/sysklogd
        12      0,1,6   2,3,4,5         /etc/init.d/kerneld
[..]
        89      0,1,6   2,3,4,5         /etc/init.d/cron
        99      -       2,3,4,5         /etc/init.d/rmnologin
        99      0,1,6   2,3,4,5         /etc/init.d/xdm


The syntax should be fairly obvious:

      * The first column is the sort criteria for starting and
        stopping (reverse order) the scripts.

      * The second column consists of a comma-seperated list of
        runlevels in which the script should be stopped 
        - or -
        a single "-" if the script should not be stopped (with
        that sort-number).

      * The second column consists of a comma-seperated list of
        runlevels in which the script should be started 
        - or -
        a single "-" if the script should not be started (with
        that sort-number).

      * The last column specifies the full name of the script.


The alternate "rc"-programm uses built-in bash functions only and does
not rely on any external program installed. Performance is quite good
and delays execution of a script 0.075 seconds (average value on an old
ISA-486).

A script to convert your current link-setup into a configuration file
is available as well as an almost compatible "update-rc.d"-program. To
edit the configuration file you can use your favourite editor. :-)
I've attached an uuencoded tar-file which contains the files.
Everybody is invited to play around with it: just cd in the directory
which is created by unpacking the archive and try 

        ./link2file.sh > runlevel.conf
        export PRELEVEL=N    # previous runlevel
        ./rc 2               # "switch" to runlevel "2"

To be on the save side, the alternate "rc" only prints the commands
it would execute for now.
The disadvantages as far as I can see them:

      * If the machine crashes while writing the config-file it gets
        destroyed. There is rudimentary support for a fallback
        configuration file (not sufficient yet).

      * The "sort numbers" are not evaluated by "rc" (this could be
        seen as a feature, though).

      * There is almost no experience with this new technique.


Advantages beside the easeness:

      * comments are possible

      * Symbolic runlevels like "reboot" can be easily supported
        (although the numbers are more comprehensive).

      * The sort-numbers could be replaced by symbolic names, too.

      * "Update-rc.d" is quite fast (2-3s on an old ISA-486 = up to
        10 times faster than the old one).


Please keep traffic off "debian-devel" and direct all technical
comments to "debian-admintool" until the final proposal is
published. Thanks.
I will ask in "debian-users" for opinions on this in the next days,
too.

-Winfried


PS.: Of course even more complicated setups can be expressed in the
     configuration file:

        #Format:
        #<sort> <stop-> <start-levels>  <script>
        15      0       -               /etc/init.d/foo
        17      1       -               /etc/init.d/foo
        19      6       -               /etc/init.d/foo
        14      -       5               /etc/init.d/foo
        80      -       2               /etc/init.d/foo
        84      -       3,4             /etc/init.d/foo


begin 644 new-rc-0.1.tgz
M'XL(`!CDQC(``^T:VW+;MK*OY%=L*#6I<RQ9DF/[U+&<N(G2>N+8'LMIYTS2
M\:$HR&)-D2I(6G'C?DS^\SR<W05`@I)RZ2U]J#`>BP06B]W%8F]@+&8-&31:
MS?;&%W]5@P>MG:TM^`)VMG=:._B[A>\=_"U:"V"[L]W>VFXC"$"[T]IZ@&!_
M&456R]/,EP!?S,(X#C\`EV;Y4,19^CEH^HPM+O<_"N.KSBB,1#,=_ZEKM%L?
MW/_-5MO:_\X6[O^#S:W-+Z#UIU+QGO8/W__:'=@8A/'&P$_';@W.QV$*^)>-
M!9`JP(;(@HVA&(1^O"$#6T4@2R"0PL\$^!`D\2B\S*6?A4F,>'CN*)&,R(\R
M(6,"]&3@-=)`AM,,<$4QA"1F$$*,"\=J/1DT'S6'&_?=&J(ZR+-Q(G?AAS`>
MR1"GG,O_3:9"PAYOV>,WTS!*LF8B+_<9OK/3;'>:7V_#-2HU?!4D4HITFL3#
ME"CFSF0$GE)\;\UUW<#/8&^O=_+,"("IG_DI^'F63)"GP(^B&[@4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