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