[Pacemaker] slapd RA does not start OpenLDAP server after reboot
Dejan Muhamedagic
dejanmm at fastmail.fm
Wed Jan 23 13:11:39 UTC 2013
Hi,
On Wed, Jan 23, 2013 at 04:02:40PM +0400, 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.
> In log i see:
> ldap2:~ # grep '/var/run/slapd' /var/log/messages
> Jan 22 17:12:41 ldap2 slapd(slapd_mirrormode:0)[1625]: [1669]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 22 17:12:41 ldap2 slapd(slapd_mirrormode:0)[1680]: [1701]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 22 17:12:47 ldap2 slapd(slapd_mirrormode:0)[2091]: [2110]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 22 17:17:04 ldap2 slapd(slapd_mirrormode:0)[2111]: [2164]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 22 17:17:04 ldap2 slapd(slapd_mirrormode:0)[2165]: [2186]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 23 15:14:13 ldap2 slapd(slapd_mirrormode:0)[2120]: [2173]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 23 15:14:13 ldap2 slapd(slapd_mirrormode:0)[2174]: [2195]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
> Jan 23 15:14:18 ldap2 slapd(slapd_mirrormode:0)[2214]: [2233]: INFO:
> slapd pid file '/var/run/slapd/slapd.pid' does not exist.
>
> I looked at slapd source code but did not found that it destroys its
> /var/run/slapd,
> it only unlinks pid file inside that directory.
>
> /etc/init.d/ldap script manually creates /var/run/slapd directory each time
> when start slapd:
> ldap1:~ # fgrep SLAPD_PID_DIR /etc/init.d/ldap
> SLAPD_PID_DIR="/var/run/slapd/"
> if [ ! -d $SLAPD_PID_DIR ]; then
> mkdir -p $SLAPD_PID_DIR
> chown ldap:ldap $SLAPD_PID_DIR
>
> 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
> +
> if [ -n "$services" ]; then
> $slapd -h "$services" $options 2>&1; result=$?
> else
Similar code is already executed in slapd_validate_all. I guess
that you need to configure the agent for your platform, i.e. add
pidfile, user, and group parameters. The RA tries to figure out
the pidfile location from the configuration. Either that fails or
there are permission problems (did you check the slapd logs and
why it won't start?).
Thanks,
Dejan
> I would like to ask does somebody in this list suffer from the same problem?
>
> I use following rpm packages:
> opensuse 12.1 resource-agents-3.9.2-2.4.1.x86_64
> opensuse 12.2 resource-agents-3.9.2-7.1.2.x86_64
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org
More information about the Pacemaker
mailing list