Executing commands on startup and shutdown
From: Adam Bowns (adam-bowns_at_ntlworld.com)
Date: 09/02/03
- Previous message: Bret Hughes: "Re: dependency problems w/mailscanner"
- Next in thread: Hugh E Cruickshank: "RE: Executing commands on startup and shutdown"
- Reply: Hugh E Cruickshank: "RE: Executing commands on startup and shutdown"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: redhat-list@redhat.com Date: 02 Sep 2003 00:09:55 +0100
Hello everyone,
I have been trying to execute a command on startup, then a different
command on shutdown. So far I have had success with executing the
command on startup, but for some reason, via the exact same method I
cannot execute the command on shutdown. Here's what im doing: -
I have the a file names dns-client in my /etc/rc.d/init.d/ directory
containing the following.
---------------------
#!/bin/sh
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting dns-client: "
/usr/bin/dns-client-up
echo
;;
stop)
echo -n "Shutting down ddclient: "
/usr/bin/dns-client-down
echo
;;
*)
echo "Usage: dns-client {start|stop}"
exit 1
esac
exit 0
---------------------
then i have symlinks to this file in my rcX.d dirs, with S's where i
want the start part of the case statement to execute, and K's where i
want the stop part of the case statement to execute, here is an example
of my rc5.d symlink
S96dns-client -> ../init.d/dns-client
The starting of the client is working fine so there is no need to bother
with that, but this is what i have in my rc6.d directory
K02dns-client -> ../init.d/dns-client
and my rc0.d directory
K02dns-client -> ../init.d/dns-client
As far as I can tell this should execute the stop part of the case
statement when the system enters runlevel 6 or 0... but its not, its as
if nothing happens, no errors, nothing... the system just shuts down as
normal. btw, all file permissions are the the same as the other files in
those dirs.
Have I got it all wrong or should this setup work ?
Thanks in advance,
Adam Bowns
http://www.bowns.co.uk
-- redhat-list mailing list unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe https://www.redhat.com/mailman/listinfo/redhat-list
- Previous message: Bret Hughes: "Re: dependency problems w/mailscanner"
- Next in thread: Hugh E Cruickshank: "RE: Executing commands on startup and shutdown"
- Reply: Hugh E Cruickshank: "RE: Executing commands on startup and shutdown"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|