[Pacemaker] slapd RA does not start OpenLDAP server after reboot

Igor Zinovik zinovik.igor at gmail.com
Wed Jan 23 12:06:33 EST 2013


On Wed, 23 Jan 2013 14:18:12 +0100
"Raoul Bhatia [IPAX]" <r.bhatia at ipax.at> wrote:

> On 2013-01-23 13:02, Igor Zinovik wrote:
> > Hello.
> > 
> > I have a pacemaker cluster with 2 nodes (opensuse 12.1 and 12.2).  On
> > both nodes slapd does not get started by pacemaker, but it could be 
> > started by
> > launching `systemctl start ldap.service'.
> > 
> > The problem is that something unlinks `/var/run/slapd' directory after
> > reboot or shutdown, that is why slapd cannot save its pid file and 
> > cannot start.
> > [...]
> 
> The reason might be that /var/run/ is a tmpfs mount [1].
> (please verify using "mount")

You are right:
ldap1:~ # mount |grep var
/dev/mapper/system-var on /var type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,mode=755)
tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755) 

> > I fixed slapd startup problem by changing resource agent script:
> > --- slapd.orig  2013-01-22 17:23:42.266314000 +0400
> > +++ slapd       2013-01-22 17:23:12.094422000 +0400
> > @@ -299,6 +299,7 @@ slapd_start()
> >    local reason
> >    local result
> >    local state
> > +  local pid_dir
> > 
> >    slapd_status `slapd_pid`; state=$?
> > 
> > @@ -324,6 +325,12 @@ slapd_start()
> >      options="$options $parameters"
> >    fi
> > 
> > +  pid_dir="/var/run/slapd"
> > +  if [ ! -d $pid_dir ]; then
> > +         mkdir -p $pid_dir
> > +         chown ldap:ldap $pid_dir
> > +  fi
> > +
> > [...]
> 
> Thanks for the input. Unfortunately, this will only work for *your*
> setup. The pidfile could reside in another directory, for example.
> 
> Also, other distributions (e.g. Debian Squeeze) uses the "openldap" 
> user and group.
> 
> It would be more sane to handle it with something like
> 
> >     local pid_dir
> >     pid_dir=`dirname $OCF_RESKEY_pidfile`
> >     if [ ! -d $pid_dir ] ; then
> >         ocf_log info "Creating PID dir: $pid_dir"
> >         mkdir -p $pid_dir
> >         chown $OCF_RESKEY_user:$OCF_RESKEY_group $pid_dir
> >     fi
> 
> (untested)




More information about the Pacemaker mailing list