Hi Petter

Sorry to keep harping on this issue, but I just don't see why the init
scripts provided by nslu2-utils violate the assumptions made in
/etc/init.d/rc.

On Thu, Jan 1, 2009 at 03:59, Petter Reinholdtsen <p...@hungry.com> wrote:

> Note I am one of the maintainers of sysv-rc too, and it is not ment to
> support multiple identical entries in one runlevel, and definitely not
> start and stop symlinks on the same level.

I've been looking through /etc/init.d/rc, and it appears to
specifically handle stop and start symlinks for the same service in
the same runlevel. For example, consider the following piece of code
from /etc/init.d/rc:

---
                for i in /etc/rc$runlevel.d/S$level*
                do
                        [ ! -f $i ] && continue

                        if [ "$previous" != N ]
                        then
                                #
                                # Find start script in previous runlevel and
                                # stop script in this runlevel.
                                #
                                suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
                                stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
                                
previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
                                #
                                # If there is a start script in the previous 
level
                                # and _no_ stop script in this level, we don't
                                # have to re-start the service.
                                #
                                [ -f $previous_start ] && [ ! -f $stop ] && 
continue
                        fi
                        SCRIPTS="$SCRIPTS $i"
                done
---

The second comment ("If there is a start script... re-start the
service.") seems to handle the optimization for the case in which 1) a
stop and start script of a service exist in the same runlevel and 2)
the start script exists in the previous runlevel. The code above
determines whether the service must be restarted because of the
presence of a stop script in the current runlevel. Am I
misunderstanding the purpose of the code?

>> I believe the sysv-rc script calling the boot and shutdown scripts
>> will not behave the way you expect if there are both start and stop
>> symlinks for a given runlevel.  I am not sure what it will do, but
>> it is definitely not defined how it should behave. :) In short, only
>> start or stop at a given runlevel.
>
> This is still true.

The code in /etc/init.d/rc defines what will happen, and it seems to
be written to handle the case of start and stop scripts for a service
in the same runlevel. How else would one restart a service when
changing runlevels?

> Well, it has been an underlying assumtion on the implementation of
> /etc/init.d/rc and its optimization.  The fact that zleds is executed
> at all is pure luck.  If the optimization had been implemented
> slightly differently, it would not.

Can you highlight the code which makes this assumption in /etc/init.d/rc?

Gordon

-- 
Gordon Farquharson
GnuPG Key ID: 32D6D676



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to