masterd: move the IP activation from Exec to Check
masterd: move the IP activation from Exec to Check

Currently, the master IP activation is done in the Exec function. Since
the original masterd process returns after forking, and Exec is run in
the (grand)child process, this means that after 'ganeti-masterd' has
returned there are still initialization tasks running.

Normally this is not a problem, but in cases where one does quick master
failovers, this creates a race condition which hits the QA scripts
especially hard.

To solve this, and make the startup process cleaner (the system is in
steady state after the command has returned, even though masterd startup
could still fail), we move the IP activation to Check(). This also
allows error messages about the IP activation to be seen on the console.

With this patch enabled, I can no longer reproduce the double-failover
errors, which were occuring before in 4/5 cases.

Signed-off-by: Iustin Pop <acf83a5274f31a43af6b914614365999469c1a31@google.com>
Reviewed-by: René Nussbaumer <bc755ac45a0e799d1d490cba76febc56d80cc5fc@google.com>

leshchevds/ganeti,mbakke/ganeti,apyrgio/snf-ganeti,yiannist/ganeti,mbakke/ganeti,bitemyapp/ganeti,grnet/snf-ganeti,ganeti-github-testing/ganeti-test-1,mbakke/ganeti,onponomarev/ganeti,dimara/ganeti,yiannist/ganeti,ganeti/ganeti,andir/ganeti,apyrgio/ganeti,apyrgio/ganeti,ganeti/ganeti,leshchevds/ganeti,yiannist/ganeti,ganeti/ganeti,grnet/snf-ganeti,bitemyapp/ganeti,andir/ganeti,andir/ganeti,leshchevds/ganeti,apyrgio/snf-ganeti,ganeti-github-testing/ganeti-test-1,onponomarev/ganeti,dimara/ganeti