[nss-pam-ldapd] - add a tmpfiles configuration to ensure that /var/run/nslcd is created when /var/run is completely

Nalin Dahyabhai nalin at fedoraproject.org
Tue Mar 1 21:19:11 UTC 2011


commit c2236c0bebf59ec7d75c1b119e5349743e1b9a5e
Author: Nalin Dahyabhai <nalin at redhat.com>
Date:   Tue Mar 1 16:14:28 2011 -0500

    - add a tmpfiles configuration to ensure that /var/run/nslcd is created when /var/run is completely empty at boot (#656643)

 nslcd.tmpfiles     |    2 ++
 nss-pam-ldapd.spec |   14 +++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/nslcd.tmpfiles b/nslcd.tmpfiles
new file mode 100644
index 0000000..2230173
--- /dev/null
+++ b/nslcd.tmpfiles
@@ -0,0 +1,2 @@
+# nslcd needs a directory in /var/run to store its pid file and socket
+d /var/run/nslcd 0755 nslcd root
diff --git a/nss-pam-ldapd.spec b/nss-pam-ldapd.spec
index 9fba5bf..396133f 100644
--- a/nss-pam-ldapd.spec
+++ b/nss-pam-ldapd.spec
@@ -1,6 +1,6 @@
 Name:		nss-pam-ldapd
 Version:	0.7.13
-Release:	2%{?dist}
+Release:	3%{?dist}
 Summary:	An nsswitch module which uses directory servers
 Group:		System Environment/Base
 License:	LGPLv2+
@@ -8,6 +8,7 @@ URL:		http://arthurdejong.org/nss-pam-ldapd/
 Source0:	http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz
 Source1:	http://arthurdejong.org/nss-pam-ldapd/nss-pam-ldapd-%{version}.tar.gz.sig
 Source2:	nslcd.init
+Source3:	nslcd.tmpfiles
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	openldap-devel, krb5-devel
 Obsoletes:	nss-ldapd < 0.7
@@ -58,6 +59,8 @@ sed -i -e 's,^uid.*,uid nslcd,g' -e 's,^gid.*,gid ldap,g' \
 $RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
 touch -r nslcd.conf $RPM_BUILD_ROOT/%{_sysconfdir}/nslcd.conf
 mkdir -p -m 0755 $RPM_BUILD_ROOT/var/run/nslcd
+mkdir -p -m 0755 $RPM_BUILD_ROOT/etc/tmpfiles.d
+install -p -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/etc/tmpfiles.d/%{name}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -69,6 +72,7 @@ rm -rf $RPM_BUILD_ROOT
 /%{_lib}/*.so.*
 %{_mandir}/*/*
 %attr(0600,root,root) %config(noreplace) /etc/nslcd.conf
+%attr(0644,root,root) %config(noreplace) /etc/tmpfiles.d/%{name}.conf
 %attr(0755,root,root) %{_initddir}/nslcd
 %attr(0755,nslcd,root) /var/run/nslcd
 %if 0%{?fedora} > 13
@@ -150,6 +154,10 @@ if grep -q '^gid nslcd' $target ; then
 		sed -i -e 's,^gid nslcd$,# gid nslcd,g' $target
 	fi
 fi
+# Create the daemon's /var/run directory if it isn't there.
+if ! test -d /var/run/nslcd ; then
+	mkdir -p -m 0755 /var/run/nslcd
+fi
 exit 0
 
 %preun
@@ -167,6 +175,10 @@ fi
 exit 0
 
 %changelog
+* Tue Mar  1 2011 Nalin Dahyabhai <nalin at redhat.com> 0.7.13-3
+- add a tmpfiles configuration to ensure that /var/run/nslcd is created when
+  /var/run is completely empty at boot (#656643)
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.13-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list