rpms/nss-ldapd/F-11 nslcd.init,1.1,1.2 nss-ldapd.spec,1.3,1.4

Nalin Dahyabhai nalin at fedoraproject.org
Wed Sep 16 17:31:17 UTC 2009


Author: nalin

Update of /cvs/extras/rpms/nss-ldapd/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2580/F-11

Modified Files:
	nslcd.init nss-ldapd.spec 
Log Message:
- apply Mitchell Berger's patch to clean up the init script, use %%{_initddir},
  and correct the %%post so that it only thinks about turning on nslcd when
  we're first being installed (#522947)
- tell status() where the pidfile is when the init script is called for that



Index: nslcd.init
===================================================================
RCS file: /cvs/extras/rpms/nss-ldapd/F-11/nslcd.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- nslcd.init	23 Jun 2009 18:17:30 -0000	1.1
+++ nslcd.init	16 Sep 2009 17:31:17 -0000	1.2
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # chkconfig: - 12 88 
-# description:  Provides naming services using a directory server.
+# description: Provides naming services using a directory server.
 # processname: /usr/sbin/nslcd
 # config: /etc/nss-ldapd.conf
 # pidfile: /var/run/nslcd/nslcd.pid
@@ -10,17 +10,16 @@
 ### BEGIN INIT INFO
 # Provides: nslcd
 # Required-Start: $network
-# Default-Stop: 0 1 2 3 4 5 6
 # Short-Description: naming services LDAP client daemon
-# Description: The nslcd service provides naming services by using a directory server.
+# Description: Provides naming services using a directory server.
 ### END INIT INFO
 
 program=/usr/sbin/nslcd
 prog=${program##*/}
 pidfile=/var/run/nslcd/nslcd.pid
 
-if [ -f /etc/init.d/functions ]; then
-	. /etc/init.d/functions
+if [ -f /etc/rc.d/init.d/functions ]; then
+	. /etc/rc.d/init.d/functions
 fi
 
 RETVAL=0
@@ -51,22 +50,33 @@ restart() {
 
 # See how we were called.
 case "$1" in
-    start|stop|restart)
+    start)
+        [ -f /var/lock/subsys/$prog ] && exit 0
+        $1
+        ;;
+    stop)
+        [ -f /var/lock/subsys/$prog ] || exit 0
+        $1
+        ;;
+    restart)
         $1
         ;;
     status)
-        status $program
+        status -p $pidfile $program
         RETVAL=$?
         ;;
-    condrestart)
+    condrestart|try-restart)
         [ -f /var/lock/subsys/$prog ] && restart || :
         ;;
     reload)
         echo "can't reload configuration, you have to restart it"
-        RETVAL=$?
+        RETVAL=3
+        ;;
+    force-reload)
+        restart
         ;;
     *)
-        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
         exit 1
         ;;
 esac


Index: nss-ldapd.spec
===================================================================
RCS file: /cvs/extras/rpms/nss-ldapd/F-11/nss-ldapd.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- nss-ldapd.spec	2 Sep 2009 15:33:28 -0000	1.3
+++ nss-ldapd.spec	16 Sep 2009 17:31:17 -0000	1.4
@@ -17,7 +17,7 @@ BuildRoot:	%{_tmppath}/%{name}-%{version
 BuildRequires:	openldap-devel, krb5-devel
 
 # Pull in the pam_ldap module, which is currently bundled with nss_ldap, to
-# keep keep upgrades from removing the module.  When nss-ldapd grows its own
+# keep upgrades from removing the module.  When nss-ldapd grows its own
 # pam_ldap.so, we'll have to revisit this.
 Requires:	/%{_lib}/security/pam_ldap.so
 Requires(post):		/sbin/ldconfig, chkconfig, grep, sed
@@ -39,8 +39,8 @@ make %{?_smp_mflags}
 %install
 rm -rf $RPM_BUILD_ROOT
 make install DESTDIR=$RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT/{%{_initrddir},%{_libdir}}
-install -p -m755 %{SOURCE2} $RPM_BUILD_ROOT/%{_initrddir}/nslcd
+mkdir -p $RPM_BUILD_ROOT/{%{_initddir},%{_libdir}}
+install -p -m755 %{SOURCE2} $RPM_BUILD_ROOT/%{_initddir}/nslcd
 %if %{provide_so_link}
 if test %{_libdir} != /%{_lib} ; then
 	touch $RPM_BUILD_ROOT/topdir
@@ -75,14 +75,14 @@ rm -rf $RPM_BUILD_ROOT
 /%{_lib}/*.so.*
 %{_mandir}/*/*
 %attr(0600,root,root) %config(noreplace) /etc/nss-ldapd.conf
-%attr(0755,root,root) %{_initrddir}/nslcd
+%attr(0755,root,root) %{_initddir}/nslcd
 %attr(0755,nslcd,root) /var/run/nslcd
 
 %pre
 getent group  ldap  > /dev/null || \
 /usr/sbin/groupadd -r -g 55 ldap
 getent passwd nslcd > /dev/null || \
-/usr/sbin/useradd -r -g ldap -c 'LDAP client user' \
+/usr/sbin/useradd -r -g ldap -c 'LDAP Client User' \
     -u 65 -d / -s /sbin/nologin nslcd 2> /dev/null || :
 
 %post
@@ -124,11 +124,14 @@ if ! grep -q -F "# $comment" $target 2> 
 	egrep '^(tls_)' /etc/ldap.conf >> $target
 	egrep '^(timelimit|bind_timelimit|idle_timelimit|reconnect_sleeptime|reconnect_maxsleeptime)[[:blank:]]' /etc/ldap.conf >> $target
 fi
-# If the system is already configured to use LDAP as a naming service, enable
-# the daemon, but don't start it since we can never know if that's a safe thing
-# to do.
-if egrep -q '^USELDAP=yes$' /etc/sysconfig/authconfig 2> /dev/null ; then
-	/sbin/chkconfig nslcd on
+# If this is the first time we're being installed, and the system is already
+# configured to use LDAP as a naming service, enable the daemon, but don't
+# start it since we can never know if that's a safe thing to do.  If this
+# is an upgrade/reinstall, leave the user's runlevel selections alone.
+if [ "$1" -eq "1" ]; then
+	if egrep -q '^USELDAP=yes$' /etc/sysconfig/authconfig 2> /dev/null ; then
+		/sbin/chkconfig nslcd on
+	fi
 fi
 exit 0
 
@@ -147,6 +150,16 @@ fi
 exit 0
 
 %changelog
+* Wed Sep 16 2009 Nalin Dahyabhai <nalin at redhat.com> 
+- apply Mitchell Berger's patch to clean up the init script, use %%{_initddir},
+  and correct the %%post so that it only thinks about turning on nslcd when
+  we're first being installed (#522947)
+- tell status() where the pidfile is when the init script is called for that
+
+* Tue Sep  8 2009 Nalin Dahyabhai <nalin at redhat.com>
+- fix typo in a comment, capitalize the full name for "LDAP Client User" (more
+  from #516049)
+
 * Wed Sep  2 2009 Nalin Dahyabhai <nalin at redhat.com> 0.6.11-1
 - update to 0.6.11
 




More information about the scm-commits mailing list