rpms/thttpd/devel thttpd.init,1.4,1.5 thttpd.spec,1.22,1.23

Matthias Saou thias at fedoraproject.org
Sun Apr 12 14:50:18 UTC 2009


Author: thias

Update of /cvs/extras/rpms/thttpd/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5760

Modified Files:
	thttpd.init thttpd.spec 
Log Message:
Update init script all the way.



Index: thttpd.init
===================================================================
RCS file: /cvs/extras/rpms/thttpd/devel/thttpd.init,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- thttpd.init	10 Apr 2009 12:57:50 -0000	1.4
+++ thttpd.init	12 Apr 2009 14:49:47 -0000	1.5
@@ -1,98 +1,107 @@
-#!/bin/bash
+#!/bin/sh
 #
-# thttpd	This shell script takes care of starting and stopping \
-#		thttpd (tiny/turbo/throttling HTTP server)
+# thttpd       tiny/turbo/throttling HTTP server
 #
-# chkconfig: - 85 15
-# description:	This tiny/turbo/throttling HTTP server is used to \
-#		serve HTML files and CGI.
-#
-# processname: thttpd
-# pidfile: /var/run/thttpd.pid
-# config: /etc/thttpd.conf
+# chkconfig:   - 85 15
+# description: This tiny/turbo/throttling HTTP server is used to serve web \
+#              content.
 
 ### BEGIN INIT INFO
 # Provides: httpd
-# Required-Start: $local_fs $remote_fs $network $named
-# Required-Stop: $local_fs $remote_fs $network $named
-# Short-Description: start and stop thttpd HTTP Server
-# Description: This tiny/turbo/throttling HTTP server is used to serve
-#              web content.
+# Required-Start: $local_fs $network
+# Required-Stop: $local_fs $network
+# Should-Start: $named $remote_fs
+# Should-Stop: $named $remote_fs
+# Default-Start: 
+# Default-Stop: 0 1 2 3 4 5 6
+# Short-Description: tiny/turbo/throttling HTTP server
+# Description:       This tiny/turbo/throttling HTTP server is used to serve
+#                    web content.
 ### END INIT INFO
 
 # Source function library.
 . /etc/rc.d/init.d/functions
 
-# Source networking configuration.
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ "${NETWORKING}" = "no" ] && exit 0
+exec="/usr/sbin/thttpd"
+prog="thttpd"
+config="/etc/thttpd.conf"
 
-[ -f /etc/thttpd.conf ] || exit 0
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
 
-RETVAL=0
-prog="thttpd"
+lockfile=/var/lock/subsys/$prog
 
 start() {
-	# Start daemons.
-	echo -n $"Starting $prog: "
-	daemon thttpd -C /etc/thttpd.conf
-	RETVAL=$?
-	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/thttpd
-	echo
-	return $RETVAL
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon $exec -C $config
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
 }
 
 stop() {
-	# Stop daemons.
-	echo -n $"Stopping $prog: "
-	killproc thttpd
-	RETVAL=$?
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/thttpd
-	echo
-	return $RETVAL
+    echo -n $"Stopping $prog: "
+    killproc $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
 }
 
 restart() {
-	stop
-	start
+    stop
+    start
+}
+
+reload() {
+    restart
 }
 
-nicestop() {
-	# Stop gracefully (once active connections are ended)
-	echo -n $"Stopping $prog gracefully: "
-	killproc thttpd -USR1
-	RETVAL=$?
-	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/thttpd
-	echo
-	return $RETVAL
+force_reload() {
+    restart
 }
 
-# See how we were called.
+rh_status() {
+    # run checks to determine if the service is running or use generic status
+    status $prog
+}
+
+rh_status_q() {
+    rh_status &>/dev/null
+}
+
+
 case "$1" in
-	start)
-		start
-		;;
-	stop)
-		stop
-		;;
-	status)
-		status thttpd
-		;;
-	restart)
-		restart
-		;;
-	condrestart)
-		[ -f /var/lock/subsys/thttpd ] && restart
-		;;
-	nicestop)
-		nicestop
-		;;
-	*)
-		echo $"Usage: thttpd {start|stop|status|restart|condrestart|nicestop}"
-		exit 1
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
 esac
-
 exit $?
 


Index: thttpd.spec
===================================================================
RCS file: /cvs/extras/rpms/thttpd/devel/thttpd.spec,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- thttpd.spec	11 Apr 2009 10:07:23 -0000	1.22
+++ thttpd.spec	12 Apr 2009 14:49:47 -0000	1.23
@@ -4,7 +4,7 @@
 Summary: Tiny, turbo, throttleable lightweight http server
 Name: thttpd
 Version: 2.25b
-Release: 21%{?dist}
+Release: 22%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://www.acme.com/software/thttpd/
@@ -166,6 +166,9 @@
 
 
 %changelog
+* Sun Apr 12 2009 Matthias Saou <http://freshrpms.net/> 2.25b-22
+- Update init script all the way.
+
 * Sat Apr 11 2009 Matthias Saou <http://freshrpms.net/> 2.25b-21
 - Include patch to rename conflicting "getline" function (stdio.h).
 - Fix so that makeweb gets compiled in "build" section with the right WEBDIR.




More information about the fedora-extras-commits mailing list