[Pkg-sysvinit-devel] /etc/init.d/rc script... inconsistent behavior....

Antonio Macchi antonio_macchi at alice.it
Tue Sep 16 17:48:14 UTC 2008


hi, i'm italian... so sorry for my english...


rc script has a little bug. .. because it does not stop the script 
'/etc/rc0.d/S32portmap@'



you can see this easily editing the rc script....


startup_progress() {


   ################
   echo
   echo -------------
   echo $@
   echo -------------
   echo
   read
   ###############ì


   $@
   if [ "$SPLASH" = true ] ; then
       step=$(($step + $step_change))
       progress=$(($step * $progress_size / $num_steps + $first_step))
       $debug usplash_write "PROGRESS $progress" || true
   fi
}

in this way, you can see every script launched...
and you can see that, in shutdown or reboot,  portmap is never launched...


/etc/rc2.d/S18portmap@

/etc/rc0.d/S32portmap@
/etc/rc6.d/S32portmap@


rc does not stop the second and third one, never, because it think to 
'relaunch' it...


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



in the previous runlevel (2) S18portmap exist!
and in the new runlevel (0) K??portmap does not exist!

so it 'continue' (i mean... it does not continue.. )
...and portmap stop is never launched


---- imho ---
the question is:
why permit stop-scripts starting with S in runlevel 0|6?
can't be enough K01 thru K99?
--------------


anyhow... sometimes it can create a little bug, and not stop properly 
every script
the  'no-restart'  test must not be done for runlevel 0-6


thanks for your job, folks
bye





More information about the Pkg-sysvinit-devel mailing list