diff -up ./etc/init/openwsmand.sh.in.new ./etc/init/openwsmand.sh.in
--- ./etc/init/openwsmand.sh.in.new 2009-12-16 18:16:06.000000000 -0600
+++ ./etc/init/openwsmand.sh.in 2009-12-16 18:16:18.000000000 -0600
@@ -4,21 +4,21 @@
# Provides: openwsmand
# Required-Start: $remote_fs
# Required-Stop: $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
+# Default-Start:
+# Default-Stop:
# Short-Description: Openwsman Daemon
# Description: openwsmand
# Start/Stop the Openwsman Daemon
### END INIT INFO
#
#
-# chkconfig: 2345 36 64
+# chkconfig: - 36 64
# description: Openwsman Daemon
# processname: openwsmand
NAME=openwsmand
DAEMON=/usr/sbin/$NAME
-OPTIONS=
+OPTIONS=-S
PIDFILE=/var/run/$NAME.pid
if [ $EUID != 0 ]; then
@@ -37,12 +37,14 @@ lockfile=${SVIlock:-/var/lock/subsys/$NA
if [ -f "/etc/sysconfig/openwsman" ]; then
. /etc/sysconfig/openwsman
fi
-# See how we were called.
-. /etc/rc.status
-# Reset status of this service
-rc_reset
+if [ -f "/etc/SuSe-release" ]; then
+ # See how we were called.
+ . /etc/rc.status
+ # Reset status of this service
+ rc_reset
+fi
case "$1" in
start)
@@ -71,16 +73,28 @@ EOF
# Start daemons.
echo -n "Starting the $DESCRIPTIVE"
- startproc -p $PIDFILE $DAEMON > /dev/null 2>&1
- rc_status -v
+ if [ -f "/etc/SuSe-release" ]; then
+ startproc -p $PIDFILE $DAEMON > /dev/null 2>&1
+ rc_status -v
+ elif [ -f "/etc/redhat-release" ]; then
+ $DAEMON -S && echo " done." || echo " failed."
+ fi
+
touch $lockfile
;;
stop)
# Stop daemons.
echo -n "Shutting down $DESCRIPTIVE"
- killproc -p $PIDFILE -TERM $DAEMON
- rc_status -v
+ if [ -f "/etc/SuSe-release" ]; then
+ killproc -p $PIDFILE -TERM $DAEMON
+ rc_status -v
+ elif [ -f "/etc/redhat-release" ]; then
+ kill -9 `pidof openwsmand` > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo " done"
+ fi
+ fi
rm -f $lockfile
;;
@@ -91,19 +105,40 @@ EOF
;;
reload)
- echo -n "Reload service $DESCRIPTIVE"
- killproc -p $PIDFILE -HUP $DAEMON
- rc_status -v
+ echo -n "Reloading service $DESCRIPTIVE"
+ if [ -f "/etc-SuSe-release" ]; then
+ killproc -p $PIDFILE -HUP $DAEMON
+ rc_status -v
+ elif [ -f "/etc/redhat-release" ]; then
+ killall -HUP openwsmad && echo " done."|| echo " failed."
+ fi
;;
status)
echo -n "Checking for service $DESCRIPTIVE"
- checkproc -p $PIDFILE $DAEMON
- rc_status -v
+ if [ -f "/etc/SuSe-release" ]; then
+ checkproc -p $PIDFILE $DAEMON
+ rc_status -v
+ elif [ -f "/etc/redhat-release" ]; then
+ pidof opewsmand > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ echo " running"
+ else
+ echo " stopped"
+ fi
+ fi
+
+ ;;
+ condrestart)
+ [ -f $lockfile ] && restart || :
;;
*)
- echo "Usage: $0 {restart|start|stop|reload|force-reload|status}"
+ echo "Usage: $0 {restart|start|stop|reload|force-reload|status|condrestart}"
esac
+if [ -f "/etc/SuSe-release" ]; then
rc_exit
+elif [ -f "/etc/redhat-release" ]; then
+exit 0
+fi