I've got an odd problem. My server will not shutdown normally because the AoE driver is not being shut down properly. While investigating the problem, I found that the aoe script is apparently not being called for shutdown. I have been able to duplicate this with a brand new test script. My test script is just a simple file that echos back the start or stop command: #!/bin/bash # # chkconfig: 45 01 99 # description: Test Start and stop script # echo "Called with $1" I installed it with 'chkconfig --add mytest'. The softlinks exist in the runlevel directories: /etc/rc.d/init.d/mytest /etc/rc.d/rc0.d/K99mytest /etc/rc.d/rc1.d/K99mytest /etc/rc.d/rc2.d/K99mytest /etc/rc.d/rc3.d/K99mytest /etc/rc.d/rc4.d/S01mytest /etc/rc.d/rc5.d/S01mytest /etc/rc.d/rc6.d/K99mytest When I 'telinit 4', I can see the script output in /var/log/messages: Dec 19 11:46:49 bnofdn1 mytest: Called with start Dec 19 11:46:49 bnofdn1 rc: Starting mytest: succeeded When I 'telinit 3', there is no output from this script. It is like the script is not even being called. Am I doing something stupid here? When I do 'telinit 3' from a higher runlevel, isn't it supposed to run all of the 'K*' scripts in rc3.d with a 'stop' argument? Any suggestions would be appreciated. -- Bowie
Quoting Bowie Bailey <Bowie_Bailey at BUC.com>:> I've got an odd problem. My server will not shutdown normally because > the AoE driver is not being shut down properly. While investigating the > problem, I found that the aoe script is apparently not being called for > shutdown. I have been able to duplicate this with a brand new test > script.IIRC, you need to have your init script place a lock file named the service name in /var/lock/subsys for the stop to execute. HTH, Barry
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Dec 19, 2005 at 12:29:08PM -0500, Bowie Bailey wrote:> I've got an odd problem. My server will not shutdown normally because > the AoE driver is not being shut down properly. While investigating the > problem, I found that the aoe script is apparently not being called for > shutdown. I have been able to duplicate this with a brand new test > script. > > My test script is just a simple file that echos back the start or stop > command: > > #!/bin/bash > # > # chkconfig: 45 01 99 > # description: Test Start and stop script > # > > echo "Called with $1" > > I installed it with 'chkconfig --add mytest'.Use "chkconfig mytest on", and try again. It _might_ solve your problem. []s - -- Rodrigo Barbosa <rodrigob at suespammers.org> "Quid quid Latine dictum sit, altum viditur" "Be excellent to each other ..." - Bill & Ted (Wyld Stallyns) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFDpwOdpdyWzQ5b5ckRAmovAKCsuvfc+8i/xU5nXEdUb5uGaFf6NQCfUjXu tUL9s8aZ9BY/SGNllFZvqXc=2eDd -----END PGP SIGNATURE-----
Bowie Bailey wrote:>I've got an odd problem. My server will not shutdown normally because >the AoE driver is not being shut down properly. While investigating the >problem, I found that the aoe script is apparently not being called for >shutdown. I have been able to duplicate this with a brand new test >script. > >My test script is just a simple file that echos back the start or stop >command: > > #!/bin/bash > # > # chkconfig: 45 01 99 > # description: Test Start and stop script > # > > echo "Called with $1" > >I installed it with 'chkconfig --add mytest'. > >The softlinks exist in the runlevel directories: > /etc/rc.d/init.d/mytest > /etc/rc.d/rc0.d/K99mytest > /etc/rc.d/rc1.d/K99mytest > /etc/rc.d/rc2.d/K99mytest > /etc/rc.d/rc3.d/K99mytest > /etc/rc.d/rc4.d/S01mytest > /etc/rc.d/rc5.d/S01mytest > /etc/rc.d/rc6.d/K99mytest > >When I 'telinit 4', I can see the script output in /var/log/messages: > > Dec 19 11:46:49 bnofdn1 mytest: Called with start > Dec 19 11:46:49 bnofdn1 rc: Starting mytest: succeeded > >When I 'telinit 3', there is no output from this script. It is like the >script is not even being called. > >Am I doing something stupid here? When I do 'telinit 3' from a higher >runlevel, isn't it supposed to run all of the 'K*' scripts in rc3.d with >a 'stop' argument? > >Any suggestions would be appreciated. > > >Well, as I look at your links, I see none to start your script at runlevel 3, i.e. no S01myTest under rc3.d .... maybe I'm missing something .... The init process only runs K* under runlevel 4 (rc4.d) when exiting runlevel 4, then runs all of the S* stuff under the new runlevel. $0.02, no more, no less .... -- William A. Mahaffey III --------------------------------------------------------------------- Remember, ignorance is bliss, but willful ignorance is LIBERALISM !!!!
William A. Mahaffey III <mailto:wam at HiWAAY.net> wrote:> Bowie Bailey wrote: > > > I've got an odd problem. My server will not shutdown normally > > because the AoE driver is not being shut down properly. While > > investigating the problem, I found that the aoe script is > > apparently not being called for shutdown. I have been able to > > duplicate this with a brand new test script. > > > > My test script is just a simple file that echos back the start or > > stop command: > > > > #!/bin/bash > > # > > # chkconfig: 45 01 99 > > # description: Test Start and stop script > > # > > > > echo "Called with $1" > > > > I installed it with 'chkconfig --add mytest'. > > > > The softlinks exist in the runlevel directories: > > /etc/rc.d/init.d/mytest > > /etc/rc.d/rc0.d/K99mytest > > /etc/rc.d/rc1.d/K99mytest > > /etc/rc.d/rc2.d/K99mytest > > /etc/rc.d/rc3.d/K99mytest > > /etc/rc.d/rc4.d/S01mytest > > /etc/rc.d/rc5.d/S01mytest > > /etc/rc.d/rc6.d/K99mytest > > > > When I 'telinit 4', I can see the script output in > > /var/log/messages: > > > > Dec 19 11:46:49 bnofdn1 mytest: Called with start > > Dec 19 11:46:49 bnofdn1 rc: Starting mytest: succeeded > > > > When I 'telinit 3', there is no output from this script. It is > > like the script is not even being called. > > > > Am I doing something stupid here? When I do 'telinit 3' from a > > higher runlevel, isn't it supposed to run all of the 'K*' scripts > > in rc3.d with a 'stop' argument? > > Well, as I look at your links, I see none to start your script at > runlevel 3, i.e. no S01myTest under rc3.d .... maybe I'm missing > something ....It's not supposed to start in runlevel 3. It's only supposed to run in levels 4 and 5.> The init process only runs K* under runlevel 4 (rc4.d) when exiting > runlevel 4, then runs all of the S* stuff under the new runlevel. > $0.02, no more, no less ....That's not what the rc script appears to be doing. It simply checks the current runlevel and then runs all the scripts in that directory (kill scripts first, and then start scripts). -- Bowie
Barry Brimer <mailto:barry.brimer at bigfoot.com> wrote:> Quoting Bowie Bailey <Bowie_Bailey at BUC.com>: > > > I've got an odd problem. My server will not shutdown normally > > because the AoE driver is not being shut down properly. While > > investigating the problem, I found that the aoe script is > > apparently not being called for shutdown. I have been able to > > duplicate this with a brand new test script. > > IIRC, you need to have your init script place a lock file named the > service name in /var/lock/subsys for the stop to execute.I found that by looking through the 'rc' script not long after I posted. I finally determined that the script was properly creating and deleting the lock file, it was just named wrong. The lock file must be named either 'subsys' or 'subsys.init'. This one was trying to use 'subsys-init'. Changed the dash to a period and the problem went away. Thanks for the help! -- Bowie
William A. Mahaffey III <mailto:wam at HiWAAY.net> wrote:> Bowie Bailey wrote: > > William A. Mahaffey III <mailto:wam at HiWAAY.net> wrote: > > > Bowie Bailey wrote: > > > > > > > > When I 'telinit 4', I can see the script output in > > > > /var/log/messages: > > > > > > > > Dec 19 11:46:49 bnofdn1 mytest: Called with start > > > > Dec 19 11:46:49 bnofdn1 rc: Starting mytest: succeeded > > > > > > > > When I 'telinit 3', there is no output from this script. It is > > > > like the script is not even being called. > > > > > > > > Am I doing something stupid here? When I do 'telinit 3' from a > > > > higher runlevel, isn't it supposed to run all of the 'K*' scripts > > > > in rc3.d with a 'stop' argument? > > > > > > Well, as I look at your links, I see none to start your script at > > > runlevel 3, i.e. no S01myTest under rc3.d .... maybe I'm missing > > > something .... > > > > It's not supposed to start in runlevel 3. It's only supposed to run > > in levels 4 and 5. > > > > > The init process only runs K* under runlevel 4 (rc4.d) when exiting > > > runlevel 4, then runs all of the S* stuff under the new runlevel. > > > $0.02, no more, no less .... > > > > That's not what the rc script appears to be doing. It simply checks > > the current runlevel and then runs all the scripts in that directory > > (kill scripts first, and then start scripts). > > You originally asked why you were seeing no output from your test > script when you did a 'telinit 3', I gave you a reason (links to > activate the script not present in rc3.d) :-).The links ARE there, but they are K* links, not S* links. I should see output showing the service shutting down when I go from 4 to 3. My main point was that your description of the shutdown process does not seem to be accurate. Based on reading the 'rc' script, the runlevel switch happens first and then rc runs all scripts from the new runlevel directory. If I switch from level 4 to level 3, the system will switch the runlevel to 3 and then run the kill scripts and startup scripts from the rc3.d directory. The original problem has been solved. The script was not setting it's lock file properly, so it was being skipped when rc ran the kill scripts. Now that I've fixed that problem, I see the shutdown messages from the script as expected. -- Bowie