watcher: Acquire lock early and give more friendly message
authorMichael Hanselmann <hansmi@google.com>
Fri, 26 Feb 2010 15:42:13 +0000 (16:42 +0100)
committerMichael Hanselmann <hansmi@google.com>
Fri, 26 Feb 2010 17:42:25 +0000 (18:42 +0100)
commit001b3825794f9306d7c973711768dd3abfd4e8d6
tree951f222f4cfa5ecfc00cc977eb71668daf7dd2cd
parent553bd93f0905a4b93d899377b792a354049ea595
watcher: Acquire lock early and give more friendly message

By opening the lock file early, other programs can lock the
state file to prevent ganeti-watcher from restarting daemons.
Using the pause feature is inherently prone to race conditions.

Before a traceback was logged when the lock file couldn't
be acquired. Now it'll be a more friendly message.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
daemons/ganeti-watcher