Hello,
I have detected some problems in the Start/Stop Ubuntu script. Maybe most of the people knows how to solve it, but I left it here just in case it could help somebody.
The debian script seems to work properly.
I have included an LSB header in the script:
The LSB header:
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PWR start/stop script
# Description: PWR start/stop script
### END INIT INFO
The Ubuntu kill doesn't work properly because of 2 problems (AFAIK):
1.- Only works once, due to this piece of code:
if [ ! -e $killer ] ; then
<...>
fi
2.- This lines produces only one valid kill and some lines only with the process PID. It doesn't include a kill line for sev_ and opc_ :
echo "kill -9 `ps ax | grep "rt_" | awk '{ print $1}'`" >> $killer
echo "kill -9 `ps ax | grep "rs_" | awk '{ print $1}'`" >> $killer
echo "kill -9 `ps ax | grep "ra_" | awk '{ print $1}'`" >> $killer
The kill in debian package change the position of kill -9 and include it in the awk script. Now each linea has a "kill -9 " befor the PID number. It doesn't include the -e test and it includes the sev_ and opc_ lines:
echo "`ps ax | grep "rt_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "`ps ax | grep "rs_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "`ps ax | grep "ra_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "`ps ax | grep "sev_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "`ps ax | grep "opc_" | awk '{ print "kill -9 "$1}'`" >> $killer
Could the start/stop script for Ubuntu include this changes in future releases?
That is working well for me in Ubuntu.