rpms/tor/F-7 tor.lsb,1.1,1.2

Enrico Scholz (ensc) fedora-extras-commits at redhat.com
Wed Feb 13 11:20:28 UTC 2008


Author: ensc

Update of /cvs/extras/rpms/tor/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv18441/F-7

Modified Files:
	tor.lsb 
Log Message:
- cleaned up LSB comments
- improved 'status' method of initscript to return rc of 'pidofproc'
  instead of doing further manual tests.  Calling 'pidofproc' directly
  instead of within a subshell should workaround #432254 too.



Index: tor.lsb
===================================================================
RCS file: /cvs/extras/rpms/tor/F-7/tor.lsb,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- tor.lsb	26 Sep 2006 06:27:27 -0000	1.1
+++ tor.lsb	13 Feb 2008 11:19:49 -0000	1.2
@@ -6,10 +6,11 @@
 # description:   An Anonymizing overlay network for TCP
 #
 ### BEGIN INIT INFO
-# Default-Stop:       0 1 2 3 4 5 6
-# Short-Description:  An Anonymizing overlay network for TCP
-# Description:        An Anonymizing overlay network for TCP
-# Required-Start: $network $syslog $remote_fs $local_fs
+# Default-Stop:		0 1 2 6
+# Short-Description:	An Anonymizing overlay network for TCP
+# Description:		An Anonymizing overlay network for TCP
+# Required-Start:	$network $remote_fs $local_fs
+# Should-Start:		$syslog $time
 ### END INIT INFO
 
 . /lib/lsb/init-functions
@@ -36,7 +37,7 @@
     else
 	log_failure_msg
     fi
-    
+
     return $rc
 }
 
@@ -57,34 +58,25 @@
 }
 
 status() {
-    pids=$(pidofproc "$prog")
-    if test -n "$pids"; then
-	echo $"$prog is running"
-	return 0
-    fi
-
-    if test -s $pidfile; then
-	echo $"$prog is dead and /var/run pid file exists"
-	return 1
-    fi
-    
-    if test -f $lockfile; then
-	echo $"$prog is dead and /var/lock lock file exists"
-	return 2
-    fi
+    pidofproc -p "$TOR_PIDFILE" "$prog" >/dev/null 2>&1
+    rc=$?
+    case $rc in
+      (0) echo $"$prog is running";;
+      (1) echo $"program is dead and /var/run pid file exists";;
+      (2) echo $"program is dead and /var/lock lock file exists";;
+      (3) echo $"program is not running";;
+      (4) echo $"program or service status is unknown";;
+      (*) echo $"status $rc of $prog";;
+    esac
 
-    echo $"$prog is not running"
-    return 3
+    return $rc
 }
 
 case $1 in
-    (start)
-	start
-	;;
-    (stop)
-	stop
+    (start|stop|reload|status|restart)
+	$1
 	;;
-    (restart|force-reload)
+    (force-reload)
 	restart
 	;;
     (condrestart|try-restart)
@@ -92,12 +84,6 @@
 	    restart
 	fi
 	;;
-    (reload)
-	reload
-	;;
-    (status)
-	status
-	;;
     (*)
 	echo $"Usage: $0 {start|stop|force-reload|reload|try-restart|status}"
 	exit 3




More information about the fedora-extras-commits mailing list