[Debian-l10n-commits] r2797 - in /pootle/trunk/debian: control pootle.init

themill-guest at users.alioth.debian.org themill-guest at users.alioth.debian.org
Wed Nov 16 16:09:41 UTC 2011


Author: themill-guest
Date: Wed Nov 16 16:09:41 2011
New Revision: 2797

URL: http://svn.debian.org/wsvn/?sc=1&rev=2797
Log:
Simplify init scripts with lsb functions

Modified:
    pootle/trunk/debian/control
    pootle/trunk/debian/pootle.init

Modified: pootle/trunk/debian/control
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/control?rev=2797&op=diff
==============================================================================
--- pootle/trunk/debian/control (original)
+++ pootle/trunk/debian/control Wed Nov 16 16:09:41 2011
@@ -13,7 +13,7 @@
 Package: pootle
 Architecture: all
 Pre-Depends: python-django
-Depends: ${misc:Depends}, ${python:Depends}, translate-toolkit (>= 1.9.0), adduser, python-lxml, libjs-jquery, libjs-jquery-cookie, libjs-json, python-django-registration, python-django-south, dbconfig-common, libapache2-mod-wsgi | httpd | python-cherrypy
+Depends: ${misc:Depends}, ${python:Depends}, translate-toolkit (>= 1.9.0), adduser, python-lxml, libjs-jquery, libjs-jquery-cookie, libjs-json, python-django-registration, python-django-south, dbconfig-common, libapache2-mod-wsgi | httpd | python-cherrypy, lsb-base
 Recommends: python-xapian, zip, python-levenshtein, iso-codes, mysql-client | postgresql-client | sqlite3, python-mysqldb | python-psycopg2 | sqlite3, mysql-server | postgresql | sqlite3
 Suggests: python-aeidon
 Conflicts: python-django-djblets

Modified: pootle/trunk/debian/pootle.init
URL: http://svn.debian.org/wsvn/pootle/trunk/debian/pootle.init?rev=2797&op=diff
==============================================================================
--- pootle/trunk/debian/pootle.init (original)
+++ pootle/trunk/debian/pootle.init Wed Nov 16 16:09:41 2011
@@ -21,7 +21,13 @@
 PIDFILE=/var/run/pootle/pootle.pid
 POOTLE_USER=pootle
 POOTLE_GROUP=pootle
-DESC="Pootle daemon: PootleServer"
+DESC="Pootle daemon"
+NAME="PootleServer"
+
+# silently exit if package is removed but not purged
+[ -f $DAEMON ] || exit 5
+
+. /lib/lsb/init-functions
 
 [ -r /etc/default/pootle ] && . /etc/default/pootle
 
@@ -38,13 +44,13 @@
 
 case "$1" in
 	start)
+		log_daemon_msg "Starting $DESC" "$NAME"
 		if [ ! -d /var/run/pootle ]; then
 			mkdir /var/run/pootle
 			chown $POOTLE_USER:root /var/run/pootle
 			chmod 755 /var/run/pootle
 		fi
-		echo -n "Starting $DESC..."
-		if LC_ALL=C start-stop-daemon --start --quiet \
+		LC_ALL=C start-stop-daemon --start --quiet \
 		    --oknodo \
 		    --background \
 		    --make-pidfile \
@@ -54,50 +60,24 @@
 		    --chuid $POOTLE_USER:$POOTLE_GROUP \
 		    --umask 002 \
 		    --startas $DAEMON -- $OPTIONS >> /var/log/pootle 2>&1
-		then
-			echo "."
-		else
-			echo " (failed)."
-			exit 1
-		fi
+		log_end_msg $?
 		;;
 	stop)
-		echo -n "Stopping $DESC..."
-		if start-stop-daemon --stop --quiet \
+		log_daemon_msg "Stopping $DESC" "$NAME"
+		start-stop-daemon --stop --quiet \
 		    --oknodo \
 		    --pidfile $PIDFILE \
-		    --user $POOTLE_USER
-		then
-			rm -f $PIDFILE
-			echo "."
-		else
-			echo " (failed)."
-			exit 1
-		fi
+		    --user $POOTLE_USER &&
+		    rm -f $PIDFILE
+		log_end_msg $?
 		;;
 	restart|force-reload)
-		sh $0 stop
+		stop
 		sleep 1
-		sh $0 start
+		start
 		;;
 	status)
-		echo -n "$DESC "
-		if start-stop-daemon --stop --signal 0 --quiet \
-		                     --pidfile $PIDFILE \
-		                     --user $POOTLE_USER
-		then
-			echo "running"
-			exit 0
-		else
-			if [ -e "$PIDFILE" ]
-			then
-				echo "failed"
-				exit 1
-			else
-				echo "not running"
-				exit 0
-			fi
-		fi
+		status_of_proc $DAEMON "$DESC"
 		;;
 	*)
 		echo "Usage: $0 {start|stop|restart|force-reload|status}"




More information about the Debian-l10n-commits mailing list