Change utils.GenericMain protocol
authorIustin Pop <iustin@google.com>
Tue, 5 Oct 2010 14:56:56 +0000 (16:56 +0200)
committerIustin Pop <iustin@google.com>
Thu, 7 Oct 2010 08:31:11 +0000 (10:31 +0200)
commitb42ea9ed7231b1ed42741c745ad153defe7d0f99
tree9af5156ab48d0e97b8337fc85fb657b8ff7549cf
parent5c4d37f9fe4d894ed0f8bd8fd7e5c5b87abbe104
Change utils.GenericMain protocol

Currently, GenericMain does a two-staged workflow:

- Check, before forking
- then Exec, after forking

This means we don't have any possibility to treat preparation work
(before the daemon is ready for work) different from the actual work.

The patch adds another PreExec function that is run just before Exec,
and which should ensure that the daemon is ready for serving client
before it returns. Its result is then sent as the third argument to
Exec.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
daemons/ganeti-confd
daemons/ganeti-masterd
daemons/ganeti-noded
daemons/ganeti-rapi
lib/daemon.py