[Pkg-samba-maint] [SCM] Debian packaging for Samba branch, samba_4.0, updated. upstream/4.0.6+dfsg-834-gbcda6d6

Andrew Bartlett abartlet at samba.org
Thu Jun 13 07:08:56 UTC 2013


The following commit has been merged in the samba_4.0 branch:
commit 75744f6ecbb0a794c3b2d642433535c0fffa3438
Author: Steve Langasek <steve.langasek at canonical.com>
Date:   Mon May 13 12:08:06 2013 -0700

    Drop support for running smbd from inetd; this is not well-supported upstream, and can't correctly handle all of the long-running services that are needed as part of modern samba.  Closes: #707622.
    
    (Adapted for 4.0 by Andrew Bartlett <abartlet at samba.org>)

diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
index c2fd2a8..3aa7451 100644
--- a/debian/po/POTFILES.in
+++ b/debian/po/POTFILES.in
@@ -1,3 +1,2 @@
 [type: gettext/rfc822deb] samba-ad-dc.templates
 [type: gettext/rfc822deb] samba-common.templates
-[type: gettext/rfc822deb] samba.templates
diff --git a/debian/samba.config b/debian/samba.config
deleted file mode 100644
index 799d604..0000000
--- a/debian/samba.config
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-#
-#
-
-set -e
-# Source debconf library.
-. /usr/share/debconf/confmodule
-
-RCFILE=/etc/default/samba
-
-read_rcfile() {
-    # Default values
-    if [ -f $RCFILE ]; then
-	. $RCFILE || true
-    fi
-}
-
-set_debconf() {
-    if [ -n "$RUN_MODE" ]; then
-        db_set samba/run_mode "$RUN_MODE" || true
-    fi
-}
-
-db_settitle samba-common/title
-
-# We first read the settings file
-# in order to get admin-modified settings
-read_rcfile
-# Debconf-stored values are updated accordingly
-set_debconf
-db_input medium samba/run_mode || true
-db_go
-
diff --git a/debian/samba.init b/debian/samba.init
index 18389bc..d82c47b 100644
--- a/debian/samba.init
+++ b/debian/samba.init
@@ -49,12 +49,10 @@ case "$1" in
 			fi
 		fi
 
-		if [ "$RUN_MODE" != "inetd" ]; then
-			log_progress_msg "smbd"
-			if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
-				log_end_msg 1
-				exit 1
-			fi
+		log_progress_msg "smbd"
+		if ! start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/smbd -- -D; then
+			log_end_msg 1
+			exit 1
 		fi
 
 		log_end_msg 0
@@ -73,30 +71,26 @@ case "$1" in
 			rm -f $NMBDPID
 		fi
 
-		if [ "$RUN_MODE" != "inetd" ]; then
-			log_progress_msg "smbd"
-			start-stop-daemon --stop --quiet --pidfile $SMBDPID
-			# Wait a little and remove stale PID file
-			sleep 1
-			if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
-			then
-				# Stale PID file (nmbd was succesfully stopped),
-				# remove it (should be removed by smbd itself IMHO.)
-				rm -f $SMBDPID
-			fi
+		log_progress_msg "smbd"
+		start-stop-daemon --stop --quiet --pidfile $SMBDPID
+		# Wait a little and remove stale PID file
+		sleep 1
+		if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
+		then
+			# Stale PID file (nmbd was succesfully stopped),
+			# remove it (should be removed by smbd itself IMHO.)
+			rm -f $SMBDPID
 		fi
 
 		log_end_msg 0
 
 		;;
 	reload)
-		if [ "$RUN_MODE" != "inetd" ]; then
-			log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only"
+		log_daemon_msg "Reloading /etc/samba/smb.conf" "smbd only"
 
-			start-stop-daemon --stop --quiet --signal HUP --pidfile $SMBDPID
+		start-stop-daemon --stop --quiet --signal HUP --pidfile $SMBDPID
 
-			log_end_msg 0
-		fi
+		log_end_msg 0
 		;;
 	restart|force-reload)
 		$0 stop
@@ -109,12 +103,7 @@ case "$1" in
 		if [ "$NMBD_DISABLED" != "Yes" ]; then
 			status_of_proc -p $NMBDPID /usr/sbin/nmbd nmbd || status=$?
 		fi
-		if [ "$RUN_MODE" != "inetd" ]; then
-			status_of_proc -p $SMBDPID /usr/sbin/smbd smbd || status=$?
-		fi
-		if [ "$NMBD_DISABLED" = "Yes" -a "$RUN_MODE" = "inetd" ]; then
-			status="4"
-		fi
+		status_of_proc -p $SMBDPID /usr/sbin/smbd smbd || status=$?
 		exit $status
 		;;
 	*)
diff --git a/debian/samba.postinst b/debian/samba.postinst
index 2d720e7..c463fbc 100644
--- a/debian/samba.postinst
+++ b/debian/samba.postinst
@@ -5,53 +5,23 @@
 #
 
 set -e
-# Handle debconf
-. /usr/share/debconf/confmodule
-
-INITCONFFILE=/etc/default/samba
 
 # We generate several files during the postinst, and we don't want
 #	them to be readable only by root.
 umask 022
 
+if dpkg --compare-versions "$2" lt-nl 2:3.6.15-2; then
+	if [ -e /etc/default/samba ]; then
+		# this config file's one setting is now obsolete; remove it
+		# unconditionally
+		rm -f /etc/default/samba
+	fi
 
-# Generate configuration file if it does not exist, using default values.
-[ -r "${INITCONFFILE}" ] || {
-	echo Generating ${INITCONFFILE}... >&2
-	cat >${INITCONFFILE} <<'EOFMAGICNUMBER1234'
-# Defaults for samba initscript
-# sourced by /etc/init.d/samba
-# installed at /etc/default/samba by the maintainer scripts
-#
-
-#
-# This is a POSIX shell fragment
-#
-
-# How should Samba (smbd) run? Possible values are "daemons"
-#	or "inetd".
-RUN_MODE=""
-EOFMAGICNUMBER1234
-}
-
-# ------------------------- Debconf questions start ---------------------
-
-# Run Samba as daemons or from inetd?
-db_get samba/run_mode || true
-RUN_MODE="${RET}"
-
-TMPFILE=/etc/default/samba.dpkg-tmp
-sed -e "s/^[[:space:]]*RUN_MODE[[:space:]]*=.*/RUN_MODE=\"${RUN_MODE}\"/" \
-        < ${INITCONFFILE} >${TMPFILE}
-chmod a+r ${TMPFILE}
-mv -f ${TMPFILE} ${INITCONFFILE}
-
-# Done with debconf now.
-db_stop
-
-umask 022
-
-# ------------------------- Debconf questions end ---------------------
+	# Remove NetBIOS entries from /etc/inetd.conf
+	if [ -x /usr/sbin/update-inetd ]; then
+		update-inetd --remove netbios-ssn
+	fi
+fi
 
 # bug #454770
 if dpkg --compare-versions "$2" lt-nl 2:3.6.13-2 \
@@ -71,19 +41,6 @@ then
 	mv /etc/samba/idmap2.tdb /var/lib/samba/idmap2.tdb
 fi
 
-# We want to add these entries to inetd.conf commented out. Otherwise
-#	UDP traffic could make inetd to start nmbd or smbd right during
-#	the configuration stage.
-if [ -z "$2" ]; then
-	update-inetd --add "#<off># netbios-ssn	stream	tcp	nowait	root	/usr/sbin/tcpd	/usr/sbin/smbd"
-fi
-
-if [ "$RUN_MODE" = "daemons" ]; then
-	update-inetd --disable netbios-ssn
-else
-	update-inetd --enable netbios-ssn
-fi
-
 # add the sambashare group
 if ! getent group sambashare > /dev/null 2>&1
 then
diff --git a/debian/samba.templates b/debian/samba.templates
deleted file mode 100644
index 2774db4..0000000
--- a/debian/samba.templates
+++ /dev/null
@@ -1,12 +0,0 @@
-Template: samba-common/title
-Type: title
-_Description: Samba server
-
-Template: samba/run_mode
-Type: select
-__Choices: daemons, inetd
-Default: daemons
-_Description: How do you want to run Samba?
- The Samba daemon smbd can run as a normal daemon or from inetd. Running as
- a daemon is the recommended approach.
-

-- 
Debian packaging for Samba




More information about the Pkg-samba-maint mailing list