|
From: Donatas C. <don...@ma...> - 2005-12-12 11:09:32
|
Hi again,
Well I got it running (I meen stopping :) ). It seems it is Fedora specific
(or might be not only Fedora) - I had to modify little bit your start-up
script. As I figured out, Fedora does not run shutdown script with stop
argument until you have lock file in directory /var/lock/subsys/. So I
modified script as follows (the name of my script is
/etc/init.d/frtdcypher):
---------------------------------
start() {
echo "Starting $APP_LONG_NAME..."
getpid
if [ "X$pid" = "X" ]
then
touch /var/lock/subsys/frtdcypher <------- create
lock file
if [ "X$IGNORE_SIGNALS" = "X" ]
...
stopit() {
echo "Stopping $APP_LONG_NAME..."
getpid
if [ "X$pid" = "X" ]
then
echo "$APP_LONG_NAME was not running."
else
rm -f /var/lock/subsys/frtdcypher <-------- remove
lock file
if [ "X$IGNORE_SIGNALS" = "X" ]
...
----------------------------------
This is excerpt from /etc/rc.d/rc (this script executes all the shutdown
scripts):
# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do
check_runlevel "$i" || continue
# Check if the subsystem is already up.
subsys=${i#/etc/rc$runlevel.d/K??}
[ -f /var/lock/subsys/$subsys -o -f /var/lock/subsys/$subsys.init ]
\
|| continue
# Bring the subsystem down.
if LC_ALL=C egrep -q "(killproc |action )" $i ; then
$i stop
else
action $"Stopping $subsys: " $i stop
fi
done
----------------------------------
Well, seems each different linux distribution has its own rules.
Thank you for hint to check whether shutdown script is being called on
system exit.
Cheers,
Donatas
|