ganeti-rapi: Watch directory, not file for user file changes
authorMichael Hanselmann <hansmi@google.com>
Wed, 13 Oct 2010 10:55:45 +0000 (12:55 +0200)
committerMichael Hanselmann <hansmi@google.com>
Wed, 13 Oct 2010 12:18:46 +0000 (14:18 +0200)
commit073c31a584d983739237546a03b25e433f063464
treea593edc25ff686e8df73272ec601922b08e1f1c9
parente543a42f56dcc20a7232eb5667200749475032f3
ganeti-rapi: Watch directory, not file for user file changes

We noticed several issues when just watching the file, among them race
conditions upon replacing the file using rename(2) (the new watcher
would be created too soon). By just watching the directory for events on
the rapi_users file, this can be avoided.

A nice side-effect is that now the users file is also reloaded if it
didn't exist upon ganeti-rapi's start (see the documentation update).

Since ganeti-rapi now becomes active for virtually every change in the
configuration directory (…/lib/ganeti), moving the rapi_users file to a
separate directory will be considered. It doesn't have to happen in or
before this patch, though.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
daemons/ganeti-rapi
doc/rapi.rst