Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: pwr Start/Stop script in Ubuntu

pwr Start/Stop script in Ubuntu 12 years 3 months ago #3058

  • abella
  • abella's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 42
  • Karma: 0
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.
Last Edit: 12 years 3 months ago by abella.
The administrator has disabled public write access.

Re: pwr Start/Stop script in Ubuntu 12 years 3 months ago #3063

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3176
  • Thank you received: 502
  • Karma: 133
Thanks abella,

We'll add this to the next release.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 7.695 seconds