From e66413628d95f8c9d91a2080768501946c0d5514 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 11 Dec 2012 17:20:53 +0100 Subject: sysrqshutdown plugin changed. now there is a second script which does the sysrq requests which is started with nohup, so that one can logout from ssh first --- .../plugins/sysrqshutdown/files/shutdown | 29 +++++++--------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'src/os-plugins/plugins/sysrqshutdown/files/shutdown') diff --git a/src/os-plugins/plugins/sysrqshutdown/files/shutdown b/src/os-plugins/plugins/sysrqshutdown/files/shutdown index a27481d7..1866d516 100644 --- a/src/os-plugins/plugins/sysrqshutdown/files/shutdown +++ b/src/os-plugins/plugins/sysrqshutdown/files/shutdown @@ -1,7 +1,7 @@ #!/bin/bash # ----------------------------------------------------------------------------- # Copyright (c) 2010 - RZ Uni FR -# Copyright (c) 2010 - OpenSLX GmbH +# Copyright (c) 2010 - 2012 OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -12,7 +12,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # shutdown -# - Script for SYSRQ shutdown +# - Script which prepares for SYSRQ shutdown ################################################################################ . /etc/opt/openslx/openslx.conf @@ -22,30 +22,19 @@ ################################################################################ PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins -PLUGINCONFVMGRID=${PLUGINCONFROOT}/sysrqshutdown -# include general configuration from vmgrid -if [ -f ${PLUGINCONFVMGRID}/sysrqshutdown.conf ]; then - . ${PLUGINCONFVMGRID}/sysrqshutdown.conf +PLUGINCONFSYSRQ=${PLUGINCONFROOT}/sysrqshutdown +PLUGINDIR=${OPENSLX_DEFAULT_DIR}/plugin-repo/sysrqshutdown + +# include general configuration from sysrqshutdown +if [ -f ${PLUGINCONFSYSRQ}/sysrqshutdown.conf ]; then + . ${PLUGINCONFSYSRQ}/sysrqshutdown.conf else sysrqshutdown_active=0 fi if [ ${sysrqshutdown_active} -eq 1 ]; then - # check if reboot or halt - if echo "$@" | grep -qe '-r now'; then - for i in $(echo s u b); do - echo $i > /proc/sysrq-trigger & - done - exit 0 - elif echo "$@" | grep -qe '-h now'; then - for i in $(echo s u o); do - echo $i > /proc/sysrq-trigger & - done - exit 0 - fi + nohup ${PLUGINDIR}/sysrqshutdown.sh $@ 2>/dev/null & fi -# else use orig shutdown -shutdown.slxorig $@ exit 0 -- cgit v1.2.3-55-g7522