Comment 16 for bug 806761

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi Caleb, sorry for not responding sooner I've been quite busy.

You really just need to serialize your attempts to start nslcd. This is actually doable pretty easily. Do this in your if-up.d script:

flock /etc/init/nslcd.conf start wait-for-state WAIT_FOR=nslcd WAITER=$INTERFACE WAIT_STATE=started

This will ensure that only one of them is ever running at a time, so if there's one about to fail, this will wait for that. Then it uses the 'wait-for-state' upstart job (only available in Ubuntu 11.10 and later) that will just exit gracefully if it is already started, and if it has not started yet, will try to start it.