From fbbb3f01cbb7b5a6a105dbc4fe1541ca8bdb5e4d Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Fri, 28 Jan 2011 11:00:20 +0100 Subject: [PATCH] Handle "nocluster" kernel parameter in init script Init script checks kernel parameters and refuses to start corosync if nocluster parameter exist on boot time. The init script will continue to work as expected from console/tty after boot. Signed-off-by: Jan Friesse Reviewed-by: Steven Dake --- init/generic.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/init/generic.in b/init/generic.in index e785b3eb..1ce26f0d 100755 --- a/init/generic.in +++ b/init/generic.in @@ -70,10 +70,23 @@ __pids_pidof() { pidof -c -o $$ -o $PPID -o %PPID "${1##*/}" } +cluster_disabled_at_boot() +{ + if grep -q nocluster /proc/cmdline && \ + [ "$(tty)" = "/dev/console" ]; then + echo -e "not configured to run at boot" + failure + return 1 + fi + return 0 +} + start() { echo -n "Starting $desc ($prog): " + ! cluster_disabled_at_boot && return + # most recent distributions use tmpfs for @LOCALSTATEDIR@/run # to avoid to clean it up on every boot. # they also assume that init scripts will create