File scsirastools-1.4.9-SuSE.diff of Package scsirastools

Index: scsirastools-1.5.8/files/sgraid
===================================================================
--- scsirastools-1.5.8.orig/files/sgraid
+++ scsirastools-1.5.8/files/sgraid
@@ -4,13 +4,15 @@
 # chkconfig: 345 94 14 
 # processname: sgraidmon
 # description: sgraid is used to start/stop the sgraidmon software raid1 daemon
 #
-### BEGIN SLES INIT INFO
+### BEGIN INIT INFO
 # Provides: sgraid
 # Required-Start: $local_fs
+# Required-Stop: $local_fs
 # Default-Start:  3 4 5
 # Default-Stop:   0 1 2 6
+# Short-Description: sgraidmon daemon
 # Description: sgraid is used to start/stop the sgraidmon software raid1 daemon
 ### END INIT INFO
 
 if [ -f /etc/SuSE-release ]; then
@@ -23,17 +25,18 @@ else
         osver=unknown
 fi
 
 # Dont need functions any more
-#if [ $osver = suse ]
-#then
-#	. /etc/rc.status
-#else
-#	. /etc/init.d/functions
-#fi
+if [ $osver = suse ]
+then
+	. /etc/rc.status
+else
+	. /etc/init.d/functions
+fi
 
 case "$1" in 
 "start")
+	echo -n "Starting sgraidmon "
 	# Is sg module loaded?
 	lsmod | grep sg >/dev/null
         if [ $? -ne 0 ]
 	then
@@ -43,9 +46,11 @@ case "$1" in 
 	rpid=`ps -ef |grep sgraidmon |grep -v grep |awk '{print $2}'`
 	if [ "${rpid}" != "" ]
 	then
 	    echo "sgraidmon is already started"
-	    exit 1
+	    rc_failed 1
+	    rc_status -v
+	    rc_exit
 	fi
 	# Could probably skip the 'mdevt Save' if it was already done once.
 	# Get the first disk device configured in /etc/raidtab via getmd
         if [ -d /dev/scsi/host0 ]
@@ -61,21 +66,34 @@ case "$1" in 
 	   # Active, so save its partition configuration
 	   mdevt Save /dev/$rdev
 	fi
 	sgraidmon -b 
+	rc_status -v
 	touch /var/lock/subsys/sgraidmon 
 	;;
 "stop")
+	echo -n "Stopping sgraidmon "
 	rpid=`ps -ef |grep sgraidmon |grep -v grep |awk '{print $2}'`
 	if [ "${rpid}" != "" ]
 	then
 	   kill $rpid
 	fi
 	rm -f /var/lock/subsys/sgraidmon 
+	rc_status -v
 	;;
+"status")
+	echo -n "Checking for sgraidmon "
+	rpid=`ps -ef |grep sgraidmon |grep -v grep |awk '{print $2}'`
+	if [ "${rpid}" != "" ]
+	  echo -n "$rpid"
+	else
+	  rc_failed 3
+        fi
+	rc_status -v
 *)
         echo "Usage: $0 start|stop"
 	exit 1
 	;;
 esac
 
-exit 0
+rc_exit
+
Index: scsirastools-1.5.8/files/sgdisk
===================================================================
--- scsirastools-1.5.8.orig/files/sgdisk
+++ scsirastools-1.5.8/files/sgdisk
@@ -4,13 +4,15 @@
 # chkconfig: 345 94 14 
 # processname: sgdiskmon
 # description: sgdisk is used to start/stop the sgdiskmon software raid1 daemon
 #
-### BEGIN SLES INIT INFO
+### BEGIN INIT INFO
 # Provides: sgdisk
 # Required-Start: $local_fs
+# Required-Stop: $local_fs
 # Default-Start:  3 4 5
 # Default-Stop:   0 1 2 6
+# Short-Description: sgdiskmon daemon
 # Description: sgdisk is used to start/stop the sgdiskmon software raid1 daemon
 ### END INIT INFO
 
 if [ -f /etc/SuSE-release ]; then
@@ -23,17 +25,18 @@ else
         osver=unknown
 fi
 
 # Dont need functions any more
-#if [ $osver = suse ]
-#then
-#	. /etc/rc.status
+if [ $osver = suse ]
+then
+	. /etc/rc.status
 #else
 #	. /etc/init.d/functions
-#fi
+fi
 
 case "$1" in 
 "start")
+	echo -n "Starting sgdiskmon "
 	# Is sg module loaded?
 	lsmod | grep sg >/dev/null
         if [ $? -ne 0 ]
 	then
@@ -43,24 +46,40 @@ case "$1" in 
 	rpid=`ps -ef |grep sgdiskmon |grep -v grep |awk '{print $2}'`
 	if [ "${rpid}" != "" ]
 	then
 	    echo "sgdiskmon is already started"
-	    exit 1
+	    rc_status -v
+	    rc_exit
 	fi
 	sgdiskmon -b 
+	rc_status -v
 	touch /var/lock/subsys/sgdiskmon 
 	;;
 "stop")
+	echo -n "Stopping sgdiskmon "
 	rpid=`ps -ef |grep sgdiskmon |grep -v grep |awk '{print $2}'`
 	if [ "${rpid}" != "" ]
 	then
+           echo -n "(pid $rpid) "
 	   kill $rpid
 	fi
 	rm -f /var/lock/subsys/sgdiskmon 
+	rc_status -v
+	;;
+"status")
+	echo -n "Stopping sgdiskmon "
+	rpid=`ps -ef |grep sgdiskmon |grep -v grep |awk '{print $2}'`
+	if [ "${rpid}" != "" ]
+	then
+	  echo "(pid $rpid)"
+  	else
+          rc_failed 3
+        fi
+	rc_status -v
 	;;
 *)
         echo "Usage: $0 start|stop"
 	exit 1
 	;;
 esac
 
-exit 0
+rc_exit
Index: scsirastools-1.5.8/doc/Makefile.am
===================================================================
--- scsirastools-1.5.8.orig/doc/Makefile.am
+++ scsirastools-1.5.8/doc/Makefile.am
@@ -12,10 +12,12 @@ exe_prefix = 
 
 datadir = ${prefix}/share
 mandir = ${prefix}/share/man
 sysconfdir = ${exe_prefix}/etc
+docdir = ${datadir}/doc/packages
 sbindir = ${exe_prefix}/sbin
 datato = ${DESTDIR}${datadir}/scsirastools
+docto = ${DESTDIR}${docdir}/scsirastools
 
 sbin_PROGRAMS = 
 	
 all:
@@ -33,10 +35,11 @@ install:
 	${INSTALL_DATA_CMD} $(fromd)/sgmode.8      ${DESTDIR}${mandir}/man8
 	${INSTALL_DATA_CMD} $(fromd)/sgraidmon.8   ${DESTDIR}${mandir}/man8
 	${INSTALL_DATA_CMD} $(fromd)/sgdiskmon.8   ${DESTDIR}${mandir}/man8
 	${INSTALL_DATA_CMD} $(fromd)/sgsafte.8     ${DESTDIR}${mandir}/man8
-	${INSTALL_DATA_CMD} $(fromd)/UserGuide     ${datato}
-	${INSTALL_DATA_CMD} $(TOPDIR)/README       ${datato}
-	${INSTALL_DATA_CMD} $(TOPDIR)/COPYING      ${datato}
-	${INSTALL_DATA_CMD} $(TOPDIR)/kern/SCSIRAS ${datato}
+	$(MKDIR) ${docto}
+	${INSTALL_DATA_CMD} $(fromd)/UserGuide     ${docto}
+	${INSTALL_DATA_CMD} $(TOPDIR)/README       ${docto}
+	${INSTALL_DATA_CMD} $(TOPDIR)/COPYING      ${docto}
+	${INSTALL_DATA_CMD} $(TOPDIR)/kern/SCSIRAS ${docto}
 	
 EXTRA_DIST = 
Index: scsirastools-1.5.8/Makefile.am
===================================================================
--- scsirastools-1.5.8.orig/Makefile.am
+++ scsirastools-1.5.8/Makefile.am
@@ -1,6 +1,6 @@
 
-SUBDIRS = mdadm.d src files doc 
+SUBDIRS = src files doc 
 PKGDIR = /usr/src/redhat
 SOURCEDIR = $(PKGDIR)/SOURCES
 BUILDDIR = $(PKGDIR)/BUILD
 RSPEC = doc/$(PACKAGE).spec
openSUSE Build Service is sponsored by