File openwsman-2.1.0-initscript_fix.patch of Package openwsman

diff -Naur ./openwsman-2.1.0/etc/init/openwsmand.sh.in ./openwsman-2.1.0-fix-initscript/etc/init/openwsmand.sh.in
--- ./openwsman-2.1.0/etc/init/openwsmand.sh.in	2008-08-24 05:17:32.000000000 +0530
+++ ./openwsman-2.1.0-fix-initscript/etc/init/openwsmand.sh.in	2009-01-23 19:55:29.000000000 +0530
@@ -18,7 +18,7 @@
 
 NAME=openwsmand
 DAEMON=/usr/sbin/$NAME
-OPTIONS=
+OPTIONS=-S
 PIDFILE=/var/run/$NAME.pid
 
 if [ $EUID != 0 ]; then
@@ -37,16 +37,19 @@
 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
 
-case "$1" in
-    start)
-    if [ ! -f "@SYSCONFDIR@/serverkey.pem" ]; then
+fi
+
+start()
+{
+	if [ ! -f "/etc/openwsman/serverkey.pem" ]; then
         if [ -f "/etc/ssl/servercerts/servercert.pem" \
                 -a -f "/etc/ssl/servercerts/serverkey.pem" ]; then
             echo "Using common server certificate /etc/ssl/servercerts/servercert.pem"
@@ -57,7 +60,7 @@
             if [ "x${FQDN}" = "x" ]; then
                 FQDN=localhost.localdomain
             fi
-cat << EOF | sh @SYSCONFDIR@/owsmangencert.sh > /dev/null 2>&1
+cat << EOF | sh /etc/openwsman/owsmangencert.sh > /dev/null 2>&1
 --
 SomeState
 SomeCity
@@ -71,39 +74,85 @@
 
     # Start daemons.
     echo -n "Starting the $DESCRIPTIVE"
-    startproc -p $PIDFILE $DAEMON > /dev/null 2>&1
-    rc_status -v
-    touch $lockfile
+if [ -f /etc/SuSE-release ]; then
+        startproc -p $PIDFILE $DAEMON $OPTIONS> /dev/null 2>&1
+        rc_status -v
+elif [ -f /etc/redhat-release ]; then
+        $DAEMON -S && echo "               done." || echo "  failed."
+fi
+
+}
+
+stop()
+{
+	# Stop daemons.
+echo -n "Shutting down $DESCRIPTIVE  "
+if [ -f /etc/SuSE-release ]; then
+        killproc -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
+
+
+}
+
+case "$1" in
+    start)
+	start
+    	touch $lockfile
     ;;
 
     stop)
-    # Stop daemons.
-    echo -n "Shutting down $DESCRIPTIVE"
-    killproc -p $PIDFILE -TERM $DAEMON
-    rc_status -v
-    rm -f $lockfile
+    	stop
+	rm -f $lockfile
     ;;
 
-    restart|force-reload)
-    $0 stop
-    $0 start
+    restart)
+    	stop
+    	start
+
+    ;;
+    force-reload)
+    	stop
+    	start
 
     ;;
 
     reload)
     echo -n "Reload service $DESCRIPTIVE"
-    killproc -p $PIDFILE  -HUP $DAEMON
-    rc_status -v
+if [ -f /etc/SuSE-release ]; then
+    	killproc -HUP $DAEMON
+    	rc_status -v
+elif [ -f /etc/redhat-release ]; then
+	killall -HUP openwsmand && 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 $DAEMON
+    	rc_status -v
+elif [ -f /etc/redhat-release ]; then
+	pidof openwsmand > /dev/null 2>&1
+	if [ $? -eq 0 ]; then
+		echo "             running"
+	else
+		echo "             stopped"
+	fi
+fi
     ;;
 
     *)
     echo "Usage: $0 {restart|start|stop|reload|force-reload|status}"
 esac
 
-rc_exit
+if [ -f /etc/SuSE-release ]; then
+	rc_exit
+else
+	exit 0
+fi
openSUSE Build Service is sponsored by