Răsfoiți Sursa

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 <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Jan Friesse 15 ani în urmă
părinte
comite
fbbb3f01cb
1 a modificat fișierele cu 13 adăugiri și 0 ștergeri
  1. 13 0
      init/generic.in

+ 13 - 0
init/generic.in

@@ -70,10 +70,23 @@ __pids_pidof() {
                 pidof -c -o $$ -o $PPID -o %PPID "${1##*/}"
                 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()
 start()
 {
 {
 	echo -n "Starting $desc ($prog): "
 	echo -n "Starting $desc ($prog): "
 
 
+	! cluster_disabled_at_boot && return
+
 	# most recent distributions use tmpfs for @LOCALSTATEDIR@/run
 	# most recent distributions use tmpfs for @LOCALSTATEDIR@/run
 	# to avoid to clean it up on every boot.
 	# to avoid to clean it up on every boot.
 	# they also assume that init scripts will create
 	# they also assume that init scripts will create