+list Thanks,
Guido ---------- Forwarded message ---------- From: Guido Trotter <[email protected]> Date: Mon, Apr 22, 2013 at 8:40 AM Subject: Re: [PATCH 2/2] Modified Ganeti init script to avoid startup when under pacemaker/corosync. To: Giuseppe Paterno' <[email protected]> On Sun, Apr 21, 2013 at 11:09 PM, Giuseppe Paterno' <[email protected]> wrote: > From: Giuseppe Paterno <[email protected]> > > --- > doc/examples/ganeti.initd.in | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/doc/examples/ganeti.initd.in b/doc/examples/ganeti.initd.in > index f16d35b..6656e60 100644 > --- a/doc/examples/ganeti.initd.in > +++ b/doc/examples/ganeti.initd.in > @@ -20,8 +20,19 @@ DAEMON_UTIL=@PKGLIBDIR@/daemon-util > > SCRIPTNAME="@SYSCONFDIR@/init.d/ganeti" > > +# Quit if the daemon utils are not there > test -f "$DAEMON_UTIL" || exit 0 > > +# Check if we are under corosync > +# otherwise we handle all the daemons > +if [ -f /etc/default/corosync ] > +then > + DAEMONS="ganeti-noded ganeti-confd" This breaks ganeti as long as that file exists (aka corosync is installed, even (especially) if unconfigured). So probably not a good idea. > +else > + DAEMONS=$($DAEMON_UTIL list-start-daemons) > +fi > + > +# Load LSB functions > if [ -r /lib/lsb/init-functions ]; then > . /lib/lsb/init-functions > elif [ -r /etc/rc.d/init.d/functions ]; then > @@ -73,13 +84,13 @@ start_all() { > exit 0 > fi > > - for i in $($DAEMON_UTIL list-start-daemons); do > + for i in $DAEMONS; do > maybe_do "$1" start_action $i > done > } > > stop_all() { > - for i in $($DAEMON_UTIL list-stop-daemons); do > + for i in $DAEMONS; do > maybe_do "$1" stop_action $i > done > } > @@ -88,7 +99,7 @@ status_all() { > local daemons="$1" status ret > > if [ -z "$daemons" ]; then > - daemons=$($DAEMON_UTIL list-start-daemons) > + daemons=$DAEMONS > fi > > status=0 > -- > 1.7.12.4 (Apple Git-37) > As mentioned in the other patch, while I'm not against pacemaker taking over, I think the old approach was not defective per se (not saying there might not have been bugs) and should be supported. At least the decision making should be improved here to avoid breakage. Thanks, Guido -- Guido Trotter Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Katherine Stephens Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370
