[Pkg-openldap-devel] [openldap] 02/02: Only create pidfile directory when starting slapd
Ryan Tandy
rtandy-guest at moszumanska.debian.org
Mon Mar 21 03:31:21 UTC 2016
This is an automated email from the git hooks/post-receive script.
rtandy-guest pushed a commit to branch master
in repository openldap.
commit 53381b0ae9729500b8a2170235ff545da4794ed3
Author: Ryan Tandy <ryan at nardis.ca>
Date: Sun Mar 20 19:49:51 2016 -0700
Only create pidfile directory when starting slapd
---
debian/changelog | 2 ++
debian/slapd.init | 16 ++++++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index c7afc0e..479f305 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ openldap (2.4.44+dfsg-1) UNRELEASED; urgency=medium
(Closes: #815364)
* Ensure /var/run/slapd exists when starting slapd, even if the pid file is
somewhere else. Thanks to Dave Beach for the report.
+ * Create the pidfile directory when starting slapd, but not when running the
+ init script in other modes.
-- Ryan Tandy <ryan at nardis.ca> Tue, 15 Mar 2016 03:45:08 +0000
diff --git a/debian/slapd.init b/debian/slapd.init
index a36cdc3..581f0a4 100644
--- a/debian/slapd.init
+++ b/debian/slapd.init
@@ -78,14 +78,6 @@ if [ -z "$SLAPD_PIDFILE" ]; then
exit 1
fi
-# Make sure the pidfile directory exists with correct permissions
-piddir=`dirname "$SLAPD_PIDFILE"`
-if [ ! -d "$piddir" ]; then
- mkdir -p "$piddir"
- [ -z "$SLAPD_USER" ] || chown -R "$SLAPD_USER" "$piddir"
- [ -z "$SLAPD_GROUP" ] || chgrp -R "$SLAPD_GROUP" "$piddir"
-fi
-
# Pass the user and group to run under to slapd
if [ "$SLAPD_USER" ]; then
SLAPD_OPTIONS="-u $SLAPD_USER $SLAPD_OPTIONS"
@@ -139,6 +131,14 @@ start_slapd() {
[ -z "$SLAPD_GROUP" ] || chgrp -R "$SLAPD_GROUP" /var/run/slapd
fi
+ # Make sure the pidfile directory exists with correct permissions
+ piddir=`dirname "$SLAPD_PIDFILE"`
+ if [ ! -d "$piddir" ]; then
+ mkdir -p "$piddir"
+ [ -z "$SLAPD_USER" ] || chown -R "$SLAPD_USER" "$piddir"
+ [ -z "$SLAPD_GROUP" ] || chgrp -R "$SLAPD_GROUP" "$piddir"
+ fi
+
if [ -z "$SLAPD_SERVICES" ]; then
reason="`start-stop-daemon --start --quiet --oknodo \
--pidfile "$SLAPD_PIDFILE" \
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openldap/openldap.git
More information about the Pkg-openldap-devel
mailing list