[Pkg-openldap-devel] Bug#390337: slapd: make sure the pidfile directory exists with correct permissions

Peter Marschall peter at adpm.de
Sat Sep 30 16:00:16 UTC 2006


Package: slapd
Version: 2.3.27-1
Severity: wishlist
Tags: patch

Hi,

with /etc/init.d/slapd using the location of the PID file
from slapd.conf, it should make sure that this directory
exists and has the correct permissions.

The atached patch does this by generating the directory
if it does not exist and changing the permissions.

It also helps with /var/run being a tmpfs (see discussions on -devel).

Peter


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-2-k7
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages slapd depends on:
ii  adduser                 3.97             Add and remove users and groups
ii  coreutils               5.97-5           The GNU core utilities
ii  debconf [debconf-2.0]   1.5.4            Debian configuration management sy
ii  libc6                   2.3.6.ds1-4      GNU C Library: Shared libraries
ii  libdb4.2                4.2.52+dfsg-1    Berkeley v4.2 Database Libraries [
ii  libiodbc2               3.52.4-3         iODBC Driver Manager
ii  libldap-2.3-0           2.3.27-1pm1      OpenLDAP libraries
ii  libltdl3                1.5.22-4         A system independent dlopen wrappe
ii  libperl5.8              5.8.8-6.1        Shared Perl library
ii  libsasl2                2.1.19.dfsg1-0.5 Authentication abstraction library
ii  libslp1                 1.2.1-6          OpenSLP libraries
ii  libssl0.9.8             0.9.8c-1         SSL shared libraries
ii  libwrap0                7.6.dbs-11       Wietse Venema's TCP wrappers libra
ii  perl [libmime-base64-pe 5.8.8-6.1        Larry Wall's Practical Extraction 
ii  psmisc                  22.3-1           Utilities that use the proc filesy

Versions of packages slapd recommends:
ii  db4.2-util              4.2.52+dfsg-1    Berkeley v4.2 Database Utilities
ii  libsasl2-modules        2.1.19.dfsg1-0.5 Pluggable Authentication Modules f

-- debconf information excluded
-------------- next part --------------
--- /etc/init.d/slapd
+++ /etc/init.d/slapd	2006-09-30 13:41:14.000000000 +0200
@@ -61,6 +61,12 @@
 	exit 1
 fi
 
+# Make sure the pidfile directory exists with correct permissions
+piddir=`dirname "$SLAPD_PIDFILE"`
+[ -d "$piddir" ] || mkdir -p "$piddir"
+[ -z "$SLAPD_USER" ] || chown -R "$SLAPD_USER" "$piddir"
+[ -z "$SLAPD_GROUP" ] || chgrp -R "$SLAPD_GROUP" "$piddir"
+
 # Pass the user and group to run under to slapd
 if [  "$SLAPD_USER" ]; then
 	SLAPD_OPTIONS="-u $SLAPD_USER $SLAPD_OPTIONS"


More information about the Pkg-openldap-devel mailing list