[Pkg-samba-maint] [samba] 01/03: Mask samba-ad-dc.service unless needed (Closes: #828137)
Mathieu Parent
sathieu at moszumanska.debian.org
Wed Jun 29 06:22:47 UTC 2016
This is an automated email from the git hooks/post-receive script.
sathieu pushed a commit to branch master
in repository samba.
commit d890b8dbacdb95715090f4d512fbd597c5e0409a
Author: Mathieu Parent <math.parent at gmail.com>
Date: Mon Jun 27 21:31:23 2016 +0200
Mask samba-ad-dc.service unless needed (Closes: #828137)
---
debian/samba.postinst | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/debian/samba.postinst b/debian/samba.postinst
index fa95f18..35b476f 100644
--- a/debian/samba.postinst
+++ b/debian/samba.postinst
@@ -76,6 +76,26 @@ then
install -d -m 1770 -g sambashare /var/lib/samba/usershares
fi
+# mimic source4/smbd/server.c and mask service before it fails
+SERVER_ROLE=`samba-tool testparm --parameter-name="server role" 2>/dev/null | tail -1`
+SERVER_SERVICES=`samba-tool testparm --parameter-name="server services" 2>/dev/null | tail -1`
+DCERPC_ENDPOINT_SERVERS=`samba-tool testparm --parameter-name="dcerpc endpoint servers" 2>/dev/null | tail -1`
+if [ "$SERVER_ROLE" != "active directory domain controller" ] \
+ && ( echo "$SERVER_SERVICES" | grep -qv '\(^\|, \)smb\(,\|$\)' ) \
+ && ( echo "$DCERPC_ENDPOINT_SERVERS" | grep -qv '\(^\|, \)remote\(,\|$\)' ) \
+ && ( echo "$DCERPC_ENDPOINT_SERVERS" | grep -qv '\(^\|, \)mapiproxy\(,\|$\)' ) \
+; then
+ if [ ! -e /etc/systemd/system/samba-ad-dc.service ]; then
+ mkdir -p /etc/systemd/system
+ ln -s /dev/null /etc/systemd/system/samba-ad-dc.service
+ # In case this system is running systemd, we make systemd reload the unit files
+ # to pick up changes.
+ if [ -d /run/systemd/system ] ; then
+ systemctl --system daemon-reload >/dev/null || true
+ fi
+ fi
+fi
+
#DEBHELPER#
exit 0
--
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