Hi all,
I have the following script to run a service
under linux redhat 9.0 and it worked when I was editing it initially. However,
i've left the box on for a few weeks now and I can't restart the services any
more.
I tried killing the process manually using
"kill procid" at the terminal interface and that didn't kill it either. The
process is definately running.
What can I do to make sure that this process
is killed?
One thing that maybe causing it could be the
fact that the pidfile doesn't actually exist. I assumed Linux might have created
this, but it doesn't - would that have any affect on this?
Thanks,
Stuart Stephen
#!/bin/bash
#
# start the service
#
# chkconfig: 345 25 75
# description: Chat server.
# processname: Chatserver
# pidfile: /var/run/talk2Utime-chatserver.pid
#
# start the service
#
# chkconfig: 345 25 75
# description: Chat server.
# processname: Chatserver
# pidfile: /var/run/talk2Utime-chatserver.pid
RETVAL=0
start() {
/usr/local/bin/service-start-chatserver.sh
}
/usr/local/bin/service-start-chatserver.sh
}
stop() {
ps ax --width=1000 | \
grep "[j]ava -server com.stevie.ChatServer.Start" | \
awk '{ system("kill " $1) }'
}
ps ax --width=1000 | \
grep "[j]ava -server com.stevie.ChatServer.Start" | \
awk '{ system("kill " $1) }'
}
restart() {
stop
sleep 3
start
}
stop
sleep 3
start
}
case "$1" in
start)
start
;;
restart)
restart
;;
stop)
stop
;;
status)
ps ax --width=1000 | \
grep "[j]ava -server com.stevie.ChatServer.Start" | \
awk '{printf "Chatserver running.\nProcess ID: " $1 "\n"}'
;;
*)
echo $"USAGE: [start|stop|restart|status]"
start)
start
;;
restart)
restart
;;
stop)
stop
;;
status)
ps ax --width=1000 | \
grep "[j]ava -server com.stevie.ChatServer.Start" | \
awk '{printf "Chatserver running.\nProcess ID: " $1 "\n"}'
;;
*)
echo $"USAGE: [start|stop|restart|status]"
esac
exit $RETVAL
exit $RETVAL