Here's a new patch.  adduser doesn't like the underscore in the user 
name "windbindd_priv", but I think it should be OK to use.
Index: debian/control
===================================================================
--- debian/control	(Revision 1084)
+++ debian/control	(Arbeitskopie)
@@ -170,7 +170,7 @@
 Section: net
 Priority: optional
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, samba-common (= ${Source-Version}), lsb-base (>= 3.0-6)
+Depends: ${shlibs:Depends}, ${misc:Depends}, samba-common (= ${Source-Version}), lsb-base (>= 3.0-6), adduser
 Replaces: samba (<= 2.2.3-2)
 Description: service to resolve user and group information from Windows NT servers
  This package provides the winbindd daemon, which provides a
Index: debian/control.in
===================================================================
--- debian/control.in	(Revision 1084)
+++ debian/control.in	(Arbeitskopie)
@@ -170,7 +170,7 @@
 Section: net
 Priority: optional
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, samba-common (= ${Source-Version}), lsb-base (>= 3.0-6)
+Depends: ${shlibs:Depends}, ${misc:Depends}, samba-common (= ${Source-Version}), lsb-base (>= 3.0-6), adduser
 Replaces: samba (<= 2.2.3-2)
 Description: service to resolve user and group information from Windows NT servers
  This package provides the winbindd daemon, which provides a
Index: debian/winbind.init
===================================================================
--- debian/winbind.init	(Revision 1084)
+++ debian/winbind.init	(Arbeitskopie)
@@ -16,37 +16,41 @@
 
 . /lib/lsb/init-functions
 
+
+d_start() {
+	mkdir -p /var/run/samba/winbindd_privileged || return 1
+	chgrp winbindd_priv /var/run/samba/winbindd_privileged/ || return 1
+	chmod 0750 /var/run/samba/winbindd_privileged/ || return 1
+	start-stop-daemon --start --quiet --oknodo --exec $DAEMON
+}
+
+
+d_stop() {
+	start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
+}
+
+
 case "$1" in
 	start)
 		log_daemon_msg "Starting the Winbind daemon" "winbind"
-
-		start-stop-daemon --start --quiet --exec $DAEMON
-
+		d_start
 		log_end_msg $?
 		;;
 
 	stop)
 		log_daemon_msg "Stopping the Winbind daemon" "winbind"
-
-		start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
-
+		d_stop
 		log_end_msg $?
 		;;
 
 	restart|force-reload)
 		log_daemon_msg "Restarting the Winbind daemon" "winbind"
-
-		start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
-		sleep 2
-		start-stop-daemon --start --quiet --exec $DAEMON
-
+		d_start && sleep 2 && d_stop
 		log_end_msg $?
 		;;
+
 	*)
 		echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload}"
 		exit 1
 		;;
 esac
-
-exit 0
-
Index: debian/winbind.postinst
===================================================================
--- debian/winbind.postinst	(Revision 0)
+++ debian/winbind.postinst	(Revision 0)
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -e
+
+getent group winbindd_priv >/dev/null 2>&1 ||
+	addgroup --system --force-badname --quiet winbindd_priv
+
+#DEBHELPER#

Reply via email to