[ale] RedHat chkconfig & init scripts

Jeff Lightner jlightner at water.com
Thu Mar 29 15:53:39 EDT 2007


Thanks, but I had already done just what you said but found it didn't
create any kill links.   

As noted below I then followed up by doing the chkconfig with "off"
explicit for the other levels (0 & 6) to make it create the kill links.

The shutdown did NOT stop the application (using the script) when I did
what you said or when I did the explicit "off" later.

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Jim
To: ale at ale.org
Popovitch
Sent: Thursday, March 29, 2007 3:30 PM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] RedHat chkconfig & init scripts

On Thu, 2007-03-29 at 15:21 -0400, Jeff Lightner wrote:
> Recently I wrote a start/stop init script for some RHEL AS 3 boxes
> (modeled on an existing one).   I used chkconfig to turn it ON in my
> multiuser run levels.   It worked like a charm on startup to start the
> application (Oracle Middle Tier).   It also worked fine from command
> line to stop the application.
> 
> However on shutdown (shutdown -r 0) it did not even attempt to run the
> script.   That is to say it didn't get an error running it - it simply
> ignored the fact it was there.   After looking at it further I decided
> it was because it wasn't in run level 0 as a kill script so I ran
> chkconfig -level 0 pc1_mid_tier off and it created the kill script
> link there.   This didn't do it.   So I decided it wanted it in run
> level 6 (reboot) so did same for that level and again it successfully
> created the kill script link there.   No go.
> 
> Is there something else I have to do to make it actually TRY to
> execute the script at shutdown.   It's not critical since it isn't a
> DB so will die anyway and the start is the important thing.   I'm just
> curious as to what it is I'm missing.   I was going to do some
> research but figured I'd ask since everyone is talking about run level
> stuff anyway.

On Redhat you need to run something similar to:
	chkconfig --level 345 <script_name> on


On Debian/Ubuntu it would be:
	update-rc.d <script_name> defaults

hth,

-Jim P.

_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list