[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] RedHat chkconfig & init scripts
- Subject: [ale] RedHat chkconfig & init scripts
- From: jimpop at yahoo.com (Jim Popovitch)
- Date: Thu, 29 Mar 2007 15:29:53 -0400
- In-reply-to: <[email protected]>
- References: <[email protected]>
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.