[Pkg-samba-maint] [SCM] Debian packaging for Samba branch, init-script-split-and-upstart-jobs, updated. debian/2%3.6.15-1-7-gb89f4bd
Steve Langasek
vorlon at debian.org
Tue May 14 06:00:28 UTC 2013
The following commit has been merged in the init-script-split-and-upstart-jobs branch:
commit 48ce4b079867b510b478140ec79d27933ed42e7b
Author: Steve Langasek <vorlon at debian.org>
Date: Mon May 13 21:44:38 2013 -0700
Add upstart jobs from Ubuntu for smbd, nmbd, and winbind.
diff --git a/debian/changelog b/debian/changelog
index a189dba..6276ed9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ samba (2:3.6.15-2) UNRELEASED; urgency=low
alignment with how init systems other than sysvinit work. This also
drops the override of the arguments to update-rc.d in debian/rules,
no longer needed in the post-insserv world.
+ * Add upstart jobs from Ubuntu for smbd, nmbd, and winbind.
-- Steve Langasek <vorlon at debian.org> Mon, 13 May 2013 11:57:53 -0700
diff --git a/debian/control b/debian/control
index 1978d20..4a20306 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,7 @@ Vcs-git: git://git.debian.org/git/pkg-samba/samba.git
Package: samba
Architecture: any
Pre-Depends: ${misc:Pre-Depends}, dpkg (>= 1.15.6~)
-Depends: samba-common (= ${source:Version}), libwbclient0 (= ${binary:Version}),${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 1.0.1-11), libpam-modules, lsb-base (>= 3.2-13), procps, update-inetd, adduser
+Depends: samba-common (= ${source:Version}), libwbclient0 (= ${binary:Version}),${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 1.0.1-11), libpam-modules, lsb-base (>= 4.1+Debian3), procps, update-inetd, adduser
Recommends: logrotate, tdb-tools
Suggests: openbsd-inetd | inet-superserver, smbldap-tools, ldb-tools, ctdb, winbind
Replaces: samba-common (<= 2.0.5a-2)
@@ -193,7 +193,7 @@ Section: net
Priority: optional
Architecture: any
Multi-Arch: foreign
-Depends: ${shlibs:Depends}, ${misc:Depends}, libwbclient0 (= ${binary:Version}), samba-common (= ${source:Version}), lsb-base (>= 3.0-6), adduser
+Depends: ${shlibs:Depends}, ${misc:Depends}, libwbclient0 (= ${binary:Version}), samba-common (= ${source:Version}), lsb-base (>= 4.1+Debian3), adduser
Pre-Depends: dpkg (>= 1.15.6~)
Suggests: libpam-winbind, libnss-winbind
Replaces: samba (<= 2.2.3-2)
diff --git a/debian/samba.nmbd.init b/debian/samba.nmbd.init
index bd0c031..fe7206e 100644
--- a/debian/samba.nmbd.init
+++ b/debian/samba.nmbd.init
@@ -24,6 +24,10 @@ test -x /usr/sbin/nmbd || exit 0
case $1 in
start)
+ if init_is_upstart; then
+ exit 1
+ fi
+
if [ -n `which testparm` ]
then
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
@@ -43,6 +47,10 @@ case $1 in
;;
stop)
+ if init_is_upstart; then
+ exit 0
+ fi
+
log_daemon_msg "Stopping NetBIOS name server" nmbd
start-stop-daemon --stop --quiet --pidfile $NMBDPID
@@ -59,6 +67,9 @@ case $1 in
;;
restart|force-reload)
+ if init_is_upstart; then
+ exit 1
+ fi
$0 stop
sleep 1
$0 start
diff --git a/debian/samba.nmbd.upstart b/debian/samba.nmbd.upstart
new file mode 100644
index 0000000..908c284
--- /dev/null
+++ b/debian/samba.nmbd.upstart
@@ -0,0 +1,21 @@
+description "NetBIOS name server"
+author "Steve Langasek <steve.langasek at ubuntu.com>"
+
+start on (local-filesystems and net-device-up IFACE!=lo)
+stop on runlevel [!2345]
+
+expect fork
+respawn
+
+pre-start script
+ [ -f /etc/samba/smb.conf ] || { stop; exit 0; }
+
+ install -o root -g root -m 755 -d /var/run/samba
+ NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null || true`
+
+ [ "x$NMBD_DISABLED" = xYes ] && { stop; exit 0; }
+
+ exit 0
+end script
+
+exec nmbd -D
diff --git a/debian/samba.reload-smbd.upstart b/debian/samba.reload-smbd.upstart
new file mode 100644
index 0000000..b7e61f1
--- /dev/null
+++ b/debian/samba.reload-smbd.upstart
@@ -0,0 +1,12 @@
+description "Samba Auto-reload Integration"
+author "James Page <james.page at ubuntu.com>"
+
+start on started cups
+
+task
+
+script
+ if status smbd | grep -q "running"; then
+ reload smbd
+ fi
+end script
diff --git a/debian/samba.smbd.init b/debian/samba.smbd.init
index 2977eb2..4145adb 100644
--- a/debian/samba.smbd.init
+++ b/debian/samba.smbd.init
@@ -25,6 +25,10 @@ test -x /usr/sbin/smbd || exit 0
case $1 in
start)
+ if init_is_upstart; then
+ exit 1
+ fi
+
log_daemon_msg "Starting SMB/CIFS daemon" smbd
# Make sure we have our PIDDIR, even if it's on a tmpfs
install -o root -g root -m 755 -d $PIDDIR
@@ -37,6 +41,10 @@ case $1 in
log_end_msg 0
;;
stop)
+ if init_is_upstart; then
+ exit 0
+ fi
+
log_daemon_msg "Stopping SMB/CIFS daemon" smbd
start-stop-daemon --stop --quiet --pidfile $SMBDPID
@@ -60,6 +68,9 @@ case $1 in
log_end_msg 0
;;
restart|force-reload)
+ if init_is_upstart; then
+ exit 1
+ fi
$0 stop
sleep 1
$0 start
diff --git a/debian/samba.smbd.upstart b/debian/samba.smbd.upstart
new file mode 100644
index 0000000..3e85ea4
--- /dev/null
+++ b/debian/samba.smbd.upstart
@@ -0,0 +1,19 @@
+description "SMB/CIFS File Server"
+author "Steve Langasek <steve.langasek at ubuntu.com>"
+
+start on (local-filesystems and net-device-up)
+stop on runlevel [!2345]
+
+respawn
+
+pre-start script
+ RUN_MODE="daemons"
+
+ [ -r /etc/default/samba ] && . /etc/default/samba
+
+ [ "$RUN_MODE" = inetd ] && { stop; exit 0; }
+
+ install -o root -g root -m 755 -d /var/run/samba
+end script
+
+exec smbd -F
diff --git a/debian/winbind.init b/debian/winbind.init
index 49062c0..6047383 100644
--- a/debian/winbind.init
+++ b/debian/winbind.init
@@ -29,6 +29,9 @@ test -x $DAEMON || exit 0
case "$1" in
start)
+ if init_is_upstart; then
+ exit 1
+ fi
log_daemon_msg "Starting the Winbind daemon" "winbind"
mkdir -p /var/run/samba/winbindd_privileged || return 1
@@ -40,12 +43,18 @@ case "$1" in
;;
stop)
+ if init_is_upstart; then
+ exit 0
+ fi
log_daemon_msg "Stopping the Winbind daemon" "winbind"
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
log_end_msg $?
;;
restart|force-reload)
+ if init_is_upstart; then
+ exit 1
+ fi
$0 stop && sleep 2 && $0 start
;;
diff --git a/debian/winbind.upstart b/debian/winbind.upstart
new file mode 100644
index 0000000..5ea6697
--- /dev/null
+++ b/debian/winbind.upstart
@@ -0,0 +1,19 @@
+description "Samba Winbind"
+author "David Weber"
+
+start on (local-filesystems and net-device-up IFACE!=lo)
+stop on runlevel [!2345]
+
+respawn
+
+pre-start script
+ test -x /usr/sbin/winbindd || exit 0
+ mkdir -p /var/run/samba/winbindd_privileged
+ chgrp winbindd_priv /var/run/samba/winbindd_privileged
+ chmod 0750 /var/run/samba/winbindd_privileged
+end script
+
+script
+ [ -r /etc/default/winbind ] && . /etc/default/winbind
+ exec /usr/sbin/winbindd -F $WINBINDD_OPTS
+end script
--
Debian packaging for Samba
More information about the Pkg-samba-maint
mailing list