rpms/rwho/devel rwho.spec,1.18,1.19 rwhod.init,1.2,1.3

Jiří Moskovčák (jmoskovc) fedora-extras-commits at redhat.com
Mon Jul 23 14:05:00 UTC 2007


Author: jmoskovc

Update of /cvs/extras/rpms/rwho/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17139

Modified Files:
	rwho.spec rwhod.init 
Log Message:
Rewrite init script to comply with LSB standard



Index: rwho.spec
===================================================================
RCS file: /cvs/extras/rpms/rwho/devel/rwho.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- rwho.spec	15 Aug 2006 12:23:38 -0000	1.18
+++ rwho.spec	23 Jul 2007 14:04:28 -0000	1.19
@@ -1,7 +1,7 @@
 Summary: Displays who is logged in to local network machines.
 Name: rwho
 Version: 0.17
-Release: 26
+Release: 27
 License: BSD
 Group: System Environment/Daemons
 Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-rwho-%{version}.tar.gz
@@ -100,6 +100,10 @@
 %config /etc/rc.d/init.d/rwhod
 
 %changelog
+* Mon Jul 23 2007 Jiri Moskovcak <jmoskovc at redhat.com> - 0.17-27
+- Fixed init script to comply with the LSB standard
+- Resolves: #247049
+
 * Tue Aug 15 2006 Harald Hoyer <harald at redhat.com> - 0.17-26
 - exit daemon, if child process dies (bug #202493)
 


Index: rwhod.init
===================================================================
RCS file: /cvs/extras/rpms/rwho/devel/rwhod.init,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rwhod.init	9 Sep 2004 11:57:54 -0000	1.2
+++ rwhod.init	23 Jul 2007 14:04:28 -0000	1.3
@@ -6,41 +6,61 @@
 #              (similiar to finger).
 # processname: rwhod
 
+### BEGIN INIT INFO
+# Provides: rwhod
+# Required-Start: $syslog $network
+# Required-Stop:  $syslog $network
+# Default-Start:
+# Default-Stop: 0 1 2 3 4 5 6
+# Short-Description: start and stop rwhod
+# Description: The rwho protocol lets remote users get a list of all of \
+#              the users logged into a machine running the rwho daemon \
+#              (similiar to finger).
+### END INIT INFO
+
+
 # Get config.
 . /etc/sysconfig/network
 
 # Get functions
 . /etc/init.d/functions
-
-# Check that networking is up.
-if [ ${NETWORKING} = "no" ] ; then
-	exit 0
-fi
-
+RWHOD=/usr/sbin/rwhod
 RETVAL=0
 
 start() {
- 	echo -n $"Starting rwho services: "
+    if [ $UID -ne 0 ] ; then
+        #user had insufficient privilege
+        exit 4
+    fi
+ 	# Check that networking is up.
+    if [ ${NETWORKING} = "no" ] ; then
+	   exit 6
+    fi
+    echo -n $"Starting rwho services: "
 	daemon rwhod
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rwhod
-	return $RETVAL
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rwhod && touch /var/run/rwhod.pid
+    return $RETVAL
 }	
 
 stop() {
+    if [ $UID -ne 0 ] ; then
+        #user had insufficient privilege
+        exit 4
+    fi
 	echo -n $"Stopping rwho services: "
 	killproc rwhod
 	RETVAL=$?
 	echo
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rwhod
-	return $RETVAL
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rwhod && rm -f /var/run/rwhod
+    return $RETVAL
 }	
 
 restart() {
 	stop
 	start
-}	
+}
 
 # See how we were called.
 case "$1" in
@@ -51,18 +71,25 @@
  	stop
 	;;
  status)
- 	status rwhod
+ 	status $RWHOD
+    RETVAL=$?
 	;;
  restart)
  	restart
 	;;
+ reload)
+     RETVAL=3
+     ;;
+ force-reload)
+     restart
+     ;;
  condrestart)
  	[ -f /var/lock/subsys/rwhod ] && restart || :
 	;;
  *)
-	echo $"Usage: $0 {start|stop|status|restart}"
-	exit 1
+	echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
+	RETVAL=2
 	;;
 esac
 
-exit $?
+exit $RETVAL




More information about the fedora-extras-commits mailing list