[Pkg-samba-maint] [samba] 03/07: Add support for 'status' in samba-ad-dc init script.
Ivo De Decker
idd-guest at alioth.debian.org
Mon Oct 14 20:23:21 UTC 2013
This is an automated email from the git hooks/post-receive script.
idd-guest pushed a commit to branch samba_4.0
in repository samba.
commit 33ec616e1b0055c6ffd4dcf08fbb8113a8e95f02
Author: Ivo De Decker <ivo.dedecker at ugent.be>
Date: Mon Oct 14 20:18:48 2013 +0200
Add support for 'status' in samba-ad-dc init script.
---
debian/changelog | 1 +
debian/samba.init | 12 ++++++++----
debian/samba.samba-ad-dc.init | 8 ++++++--
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index f5bdf34..392b9d0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ samba (2:4.0.10+dfsg-3) UNRELEASED; urgency=low
* Include /etc/pam.d/samba in samba-common. It got lost somewhere in the
samba4 merge. Closes: #726183
* Remove unused alternatives links on upgrade in samba-common-bin.prerm.
+ * Add support for 'status' in samba-ad-dc init script.
-- Ivo De Decker <ivo.dedecker at ugent.be> Mon, 14 Oct 2013 19:33:04 +0200
diff --git a/debian/samba.init b/debian/samba.init
index da65552..9fdf3ba 100644
--- a/debian/samba.init
+++ b/debian/samba.init
@@ -35,11 +35,15 @@ case $1 in
status)
status=0
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
- if [ "$NMBD_DISABLED" != "Yes" ]; then
- /etc/init.d/nmbd status || status=$?
+ SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1`
+ if [ "$SERVER_ROLE" != "active directory domain controller" ]; then
+ if [ "$NMBD_DISABLED" != "Yes" ]; then
+ /etc/init.d/nmbd status || status=$?
+ fi
+ /etc/init.d/smbd status || status=$?
+ else
+ /etc/init.d/samba-ad-dc status || status=$?
fi
- /etc/init.d/smbd status || status=$?
- /etc/init.d/samba-ad-dc status || status=$?
exit $status
;;
*)
diff --git a/debian/samba.samba-ad-dc.init b/debian/samba.samba-ad-dc.init
index bff4838..03c5a5f 100644
--- a/debian/samba.samba-ad-dc.init
+++ b/debian/samba.samba-ad-dc.init
@@ -27,7 +27,7 @@ test -x /usr/sbin/samba -a -r /etc/samba/smb.conf || exit 0
case "$1" in
start)
- SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1`
+ SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1`
if [ "$SERVER_ROLE" != "active directory domain controller" ]; then
exit 0
fi
@@ -73,8 +73,12 @@ case "$1" in
sleep 1
$0 start
;;
+ status)
+ status_of_proc -p $SAMBAPID /usr/sbin/samba samba
+ exit $?
+ ;;
*)
- echo "Usage: /etc/init.d/samba {start|stop|restart|force-reload}"
+ echo "Usage: /etc/init.d/samba-ad-dc {start|stop|restart|force-reload|status}"
exit 1
;;
esac
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-samba/samba.git
More information about the Pkg-samba-maint
mailing list