[lug] init script that won't run stop() under F11

Zan Lynx zlynx at acm.org
Tue Sep 29 18:00:50 MDT 2009


Michael J. Hammel wrote:
> I've got an F11 init script that starts fine but never gets called when
> init changes run states to one of the states marked as off for the
> script.  The script's stop() works fine if run manually.  But the script
> is simply never called, for example going from init 3 to init 2.
> 
> Here is the header of the script:
> 
> #!/bin/sh
> #
> # $Id: crunchBoot,v 1.8 2009/09/29 18:10:06 mjhammel Exp $
> # Startup script for CEI Cloud Images
> #
> # chkconfig: 345 99 15
> # description: Configure a CEI Cloud Image at boot time
> #
> ### BEGIN INIT INFO
> # Provides: crunchBoot
> # Required-Start: $local_fs $network $named $remote_fs
> # Required-Stop: $local_fs $network $named $remote_fs
> # Defalt-Start: 3 4 5
> # Default-Stop: 0 1 2 6
> # Description: Configure a CEI Cloud Image at boot time
> ### END INIT INFO
> 
> 
> I boot into init 3 and the script starts just fine.  But running "init
> 2" from the command line causes the script to be ignored completely - if
> I put an echo statement at the top of the script after the header it
> does not get printed.  I run the script with the stop arg to manually
> stop it (in init 2) and then run init 3 manually and the script starts
> up again just fine.  So this is just a shutdown problem.  Also, there
> are appropriate entries under /etc/rc.d/rcX.d for the script:
> 
> [root at swlabF11 ~]# cd /etc/rc.d
> [root at swlabF11 rc.d]# find . -name "*crunchBoot"
> ./init.d/crunchBoot
> ./rc0.d/K15crunchBoot
> ./rc2.d/K15crunchBoot
> ./rc3.d/S99crunchBoot
> ./rc6.d/K15crunchBoot
> ./rc1.d/K15crunchBoot
> ./rc5.d/S99crunchBoot
> ./rc4.d/S99crunchBoot
> 
> And these are proper symlinks to the file under init.d/crunchBoot.
> 
> Anyone got any ideas why the script is never getting called or some tips
> on trying to figure out what is really going on here?

RedHat init looks into /var/lock/subsys/* to see if it needs to run 
start/kill scripts during initlevel changes.

The start should create a file in there with the right name and stop 
should remove it. Look at the rest of the scripts to see, but I think it 
is just the name of the init script.

-- 
Zan Lynx
zlynx at acm.org

"Knowledge is Power.  Power Corrupts.  Study Hard.  Be Evil."



More information about the LUG mailing list