Commit edfeab38 authored by Claes Sjofors's avatar Claes Sjofors

pwr start/stop script fix (refs #5)

parent 6e68bad6
#!/bin/bash #!/bin/bash
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Proview Runtime Environment.
# Description: Start Proview Runtime Environment.
### END INIT INFO
# #
# Startscript fr PWR # Start script for Proview runtime
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
...@@ -133,7 +143,7 @@ case "$1" ...@@ -133,7 +143,7 @@ case "$1"
echo "Done." echo "Done."
;; ;;
*) *)
echo " pwrsev Start and stop Proview Storage Environment" >&2 echo " pwr Start and stop Proview Storage Environment" >&2
echo "" >&2 echo "" >&2
echo " Usage:" >&2 echo " Usage:" >&2
echo " pwr start|stop|restart|reload|reset" >&2 echo " pwr start|stop|restart|reload|reset" >&2
......
#!/bin/bash #!/bin/bash
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Proview Runtime Environment.
# Description: Start Proview Runtime Environment.
### END INIT INFO
# #
# Startscript fr PWR # Start script for Proview runtime
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
...@@ -133,7 +143,7 @@ case "$1" ...@@ -133,7 +143,7 @@ case "$1"
echo "Done." echo "Done."
;; ;;
*) *)
echo " pwrsev Start and stop Proview Storage Environment" >&2 echo " pwr Start and stop Proview Storage Environment" >&2
echo "" >&2 echo "" >&2
echo " Usage:" >&2 echo " Usage:" >&2
echo " pwr start|stop|restart|reload|reset" >&2 echo " pwr start|stop|restart|reload|reset" >&2
......
#!/bin/bash #!/bin/bash
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Proview Runtime Environment.
# Description: Start Proview Runtime Environment.
### END INIT INFO
# #
# Startscript fr PWR # Start script for Proview runtime
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
...@@ -133,7 +143,7 @@ case "$1" ...@@ -133,7 +143,7 @@ case "$1"
echo "Done." echo "Done."
;; ;;
*) *)
echo " pwrsev Start and stop Proview Storage Environment" >&2 echo " pwr Start and stop Proview Storage Environment" >&2
echo "" >&2 echo "" >&2
echo " Usage:" >&2 echo " Usage:" >&2
echo " pwr start|stop|restart|reload|reset" >&2 echo " pwr start|stop|restart|reload|reset" >&2
......
#!/bin/bash #!/bin/bash
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Proview Runtime Environment.
# Description: Start Proview Runtime Environment.
### END INIT INFO
# #
# Startscript fr PWR # Start script for Proview runtime
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
...@@ -133,7 +143,7 @@ case "$1" ...@@ -133,7 +143,7 @@ case "$1"
echo "Done." echo "Done."
;; ;;
*) *)
echo " pwrsev Start and stop Proview Storage Environment" >&2 echo " pwr Start and stop Proview Storage Environment" >&2
echo "" >&2 echo "" >&2
echo " Usage:" >&2 echo " Usage:" >&2
echo " pwr start|stop|restart|reload|reset" >&2 echo " pwr start|stop|restart|reload|reset" >&2
......
#!/bin/bash #!/bin/bash
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Proview Runtime Environment.
# Description: Start Proview Runtime Environment.
### END INIT INFO
# #
# Startscript fr PWR # Start script for Proview runtime
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
...@@ -27,14 +37,15 @@ create_wrapper() ...@@ -27,14 +37,15 @@ create_wrapper()
create_killer() create_killer()
{ {
if [ ! -e $killer ] ; then
echo "#!/bin/bash" > $killer echo "#!/bin/bash" > $killer
echo "source /etc/pwrp_profile" >> $killer echo "source /etc/pwrp_profile" >> $killer
echo "umask 002" >> $killer echo "umask 002" >> $killer
echo "kill -9 `ps ax | grep "rt_" | awk '{ print $1}'`" >> $killer echo "`ps ax | grep "rt_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "kill -9 `ps ax | grep "rs_" | awk '{ print $1}'`" >> $killer echo "`ps ax | grep "rs_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "kill -9 `ps ax | grep "ra_" | awk '{ print $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
echo "eval `ipcs -s|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm sem %s;", $2}'`" >> $killer echo "eval `ipcs -s|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm sem %s;", $2}'`" >> $killer
echo "eval `ipcs -q|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm msg %s;", $2}'`" >> $killer echo "eval `ipcs -q|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm msg %s;", $2}'`" >> $killer
...@@ -46,7 +57,6 @@ create_killer() ...@@ -46,7 +57,6 @@ create_killer()
echo "$killer not writable, check permissions" echo "$killer not writable, check permissions"
exit exit
fi fi
fi
} }
...@@ -99,36 +109,52 @@ pwr_kill() ...@@ -99,36 +109,52 @@ pwr_kill()
case "$1" case "$1"
in in
start) start)
echo "Startar PWR." echo "Start Proview Runtime Environment."
pwr_start pwr_start
echo "Klar." echo "Done."
;; ;;
stop) stop)
echo "Stoppar PWR..." echo "Stop Proveiw Runtime Environment."
pwr_stop pwr_stop
echo "Klar" echo "Done."
;; ;;
restart) restart)
echo "Startar om PWR." echo "Restart Proview Runtime Environment."
echo "Stoppar det frst." echo "Closing down..."
pwr_stop pwr_stop
sleep 1 sleep 1
echo "Startar igen." echo "Starting..."
pwr_start pwr_start
echo "Klar." echo "Done."
;; ;;
reload) reload)
echo "PWR varmomstart " echo "Reload Proview Runtime Environment"
pwr_reload pwr_reload
echo "Klar." echo "Done."
;; ;;
kill) kill)
echo "Tar bort delat minne och kvarblivna applikationer frn PWR" echo "Remove all processes and resources for Proview Storage Environment"
pwr_kill pwr_kill
echo "Klar." echo "Done."
;;
reset)
echo "Remove all processes and resources for Proview Storage Environment"
pwr_kill
echo "Done."
;; ;;
*) *)
echo "Usage:{start|stop|restart|reload|kill}" >&2 echo " pwr Start and stop Proview Storage Environment" >&2
echo "" >&2
echo " Usage:" >&2
echo " pwr start|stop|restart|reload|reset" >&2
echo "" >&2
echo " start Start Runtime environment" >&2
echo " stop Stop Runtime environment" >&2
echo " restart First stop and then start Runtime environment" >&2
echo " reload Soft restart of Runtime environment" >&2
echo " reset Remove all processes and resources" >&2
echo "" >&2
exit 1 exit 1
;; ;;
esac esac
......
#!/bin/bash #!/bin/bash
### BEGIN INIT INFO
# Provides: pwr
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Proview Runtime Environment.
# Description: Start Proview Runtime Environment.
### END INIT INFO
# #
# Startscript fr PWR # Start script for Proview runtime
# #
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
...@@ -27,14 +37,15 @@ create_wrapper() ...@@ -27,14 +37,15 @@ create_wrapper()
create_killer() create_killer()
{ {
if [ ! -e $killer ] ; then
echo "#!/bin/bash" > $killer echo "#!/bin/bash" > $killer
echo "source /etc/pwrp_profile" >> $killer echo "source /etc/pwrp_profile" >> $killer
echo "umask 002" >> $killer echo "umask 002" >> $killer
echo "kill -9 `ps ax | grep "rt_" | awk '{ print $1}'`" >> $killer echo "`ps ax | grep "rt_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "kill -9 `ps ax | grep "rs_" | awk '{ print $1}'`" >> $killer echo "`ps ax | grep "rs_" | awk '{ print "kill -9 "$1}'`" >> $killer
echo "kill -9 `ps ax | grep "ra_" | awk '{ print $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
echo "eval `ipcs -s|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm sem %s;", $2}'`" >> $killer echo "eval `ipcs -s|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm sem %s;", $2}'`" >> $killer
echo "eval `ipcs -q|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm msg %s;", $2}'`" >> $killer echo "eval `ipcs -q|grep ^0x|grep "[ \t]pwrp[ \t]"|awk '{printf "ipcrm msg %s;", $2}'`" >> $killer
...@@ -46,7 +57,6 @@ create_killer() ...@@ -46,7 +57,6 @@ create_killer()
echo "$killer not writable, check permissions" echo "$killer not writable, check permissions"
exit exit
fi fi
fi
} }
...@@ -99,36 +109,52 @@ pwr_kill() ...@@ -99,36 +109,52 @@ pwr_kill()
case "$1" case "$1"
in in
start) start)
echo "Startar PWR." echo "Start Proview Runtime Environment."
pwr_start pwr_start
echo "Klar." echo "Done."
;; ;;
stop) stop)
echo "Stoppar PWR..." echo "Stop Proveiw Runtime Environment."
pwr_stop pwr_stop
echo "Klar" echo "Done."
;; ;;
restart) restart)
echo "Startar om PWR." echo "Restart Proview Runtime Environment."
echo "Stoppar det frst." echo "Closing down..."
pwr_stop pwr_stop
sleep 1 sleep 1
echo "Startar igen." echo "Starting..."
pwr_start pwr_start
echo "Klar." echo "Done."
;; ;;
reload) reload)
echo "PWR varmomstart " echo "Reload Proview Runtime Environment"
pwr_reload pwr_reload
echo "Klar." echo "Done."
;; ;;
kill) kill)
echo "Tar bort delat minne och kvarblivna applikationer frn PWR" echo "Remove all processes and resources for Proview Storage Environment"
pwr_kill pwr_kill
echo "Klar." echo "Done."
;;
reset)
echo "Remove all processes and resources for Proview Storage Environment"
pwr_kill
echo "Done."
;; ;;
*) *)
echo "Usage:{start|stop|restart|reload|kill}" >&2 echo " pwr Start and stop Proview Storage Environment" >&2
echo "" >&2
echo " Usage:" >&2
echo " pwr start|stop|restart|reload|reset" >&2
echo "" >&2
echo " start Start Runtime environment" >&2
echo " stop Stop Runtime environment" >&2
echo " restart First stop and then start Runtime environment" >&2
echo " reload Soft restart of Runtime environment" >&2
echo " reset Remove all processes and resources" >&2
echo "" >&2
exit 1 exit 1
;; ;;
esac esac
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment