r178 - in /debtorrent/trunk/debian: control debtorrent-client.init debtorrent.postinst

camrdale-guest at users.alioth.debian.org camrdale-guest at users.alioth.debian.org
Mon Jul 16 19:58:12 UTC 2007


Author: camrdale-guest
Date: Mon Jul 16 19:58:12 2007
New Revision: 178

URL: http://svn.debian.org/wsvn/debtorrent/?sc=1&rev=178
Log:
Postinst adds a new user.

Modified:
    debtorrent/trunk/debian/control
    debtorrent/trunk/debian/debtorrent-client.init
    debtorrent/trunk/debian/debtorrent.postinst

Modified: debtorrent/trunk/debian/control
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/debian/control?rev=178&op=diff
==============================================================================
--- debtorrent/trunk/debian/control (original)
+++ debtorrent/trunk/debian/control Mon Jul 16 19:58:12 2007
@@ -10,7 +10,7 @@
 
 Package: debtorrent
 Architecture: all
-Depends: ${python:Depends}
+Depends: ${python:Depends}, adduser
 Suggests: python-psyco
 Recommends: python-crypto
 Provides: python-debtorrent

Modified: debtorrent/trunk/debian/debtorrent-client.init
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/debian/debtorrent-client.init?rev=178&op=diff
==============================================================================
--- debtorrent/trunk/debian/debtorrent-client.init (original)
+++ debtorrent/trunk/debian/debtorrent-client.init Mon Jul 16 19:58:12 2007
@@ -15,14 +15,12 @@
 #                    This provides the debtorrent daemon client.
 ### END INIT INFO
 
-set -e
-
 # /etc/init.d/debtorrent: start and stop the debtorrent client daemon
 
 DAEMON=/usr/bin/debtorrent-client
 NAME="debtorrent-client"
 DEFAULTSFILE=/etc/default/debtorrent-client
-PIDFILE=/var/run/debtorrent/debtorent-client.pid
+PIDFILE=/var/run/debtorent-client.pid
 
 DEBTORRENT_ENABLE=false
 DEBTORRENT_USER=debtorrent
@@ -85,7 +83,8 @@
     ;;
   stop)
     log_daemon_msg "Stopping $NAME daemon" "$NAME"
-	start-stop-daemon --stop --quiet --pidfile $PIDFILE --retry INT/15/TERM/5/KILL/5
+	start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
+		--retry INT/15/TERM/5/KILL/5
     log_end_msg $?
     rm -f $PIDFILE
     ;;
@@ -100,7 +99,8 @@
     if $DEBTORRENT_ENABLE; then
         log_daemon_msg "Restarting $NAME daemon" "$NAME"
 	    if [ -s $PIDFILE ] && kill -0 $(cat $PIDFILE) >/dev/null 2>&1; then
-		    start-stop-daemon --stop --quiet --pidfile $PIDFILE --retry INT/15/TERM/5/KILL/5 || true
+		    start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE \
+		    	--retry INT/15/TERM/5/KILL/5 || true
 		    sleep 1
 	    else
     	    rm -f $PIDFILE

Modified: debtorrent/trunk/debian/debtorrent.postinst
URL: http://svn.debian.org/wsvn/debtorrent/debtorrent/trunk/debian/debtorrent.postinst?rev=178&op=diff
==============================================================================
--- debtorrent/trunk/debian/debtorrent.postinst (original)
+++ debtorrent/trunk/debian/debtorrent.postinst Mon Jul 16 19:58:12 2007
@@ -23,6 +23,24 @@
 #     installation fails and the `postinst' is called with `abort-upgrade',
 #     `abort-remove' or `abort-deconfigure'.
 
+case "$1" in
+    configure)
+		if ! getent passwd debtorrent >/dev/null; then
+			adduser --quiet --system --no-create-home \
+					--home /var/cache/debtorrent --disabled-password \
+					--disabled-login --shell /bin/false --group debtorrent
+		fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+	    echo "postinst called with unknown argument \`$1'" >&2
+	    exit 1
+    ;;
+esac
+
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.
 




More information about the Debtorrent-commits mailing list