From c0feaa89cc0f28a149db7a02cd573b3815a33625 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 12 Dec 2012 18:59:34 +0100 Subject: minor sysrq changes, nohup is needed to log out from ssh session before halt or reboot --- .../sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm index c30ec5dc..07630fcb 100644 --- a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm +++ b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm @@ -70,23 +70,20 @@ sub installationPhase { my $self = shift; my $info = shift; - my $openslxBasePath = $info->{'openslx-base-path'}; - my $pluginName = $self->{'name'}; + my $openslxBasePath = $info->{'openslx-base-path'}; + my $pluginName = $self->{'name'}; my $pluginBasePath = "$openslxBasePath/lib/plugins/$pluginName/files"; + my $pluginDirPath = "/opt/openslx/plugin-repo/$pluginName"; # copy files if (! -e "/sbin/shutdown.slxorig") { system("mv /sbin/shutdown /sbin/shutdown.slxorig"); - system("cp -p $pluginBasePath/shutdown /sbin/; - cp -p $pluginBasePath/shutdown $pluginBasePath/sysrqshutdown.sh \ - /opt/openslx/plugin-repo/$pluginName"); - chmod 0755, "/sbin/shutdown"; - } - # else assume reinstall - elsif (-e "/sbin/shutdown.slxorig") { - system("cp -p $pluginBasePath/shutdown /sbin/"); - chmod 0755, "/sbin/shutdown"; } + system("cp -p $pluginBasePath/shutdown /sbin/; + cp -p $pluginBasePath/shutdown $pluginDirPath; + cp -p $pluginBasePath/sysrqshutdown.sh $pluginDirPath"); + chmod 0755, "/sbin/shutdown", "$pluginDirPath/shutdown", + "$pluginDirPath/sysrqshutdown.sh"; return; } -- cgit v1.2.3-55-g7522