cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ro...@apache.org
Subject [cloudstack] 05/09: systemvmtemplate: fix acpi shutdown
Date Sun, 17 Dec 2017 07:01:06 GMT
This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch debian9-systemvmtemplate
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 2ae510faefc9828c9737cb921870b65498bf3dab
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
AuthorDate: Sat Dec 16 16:56:08 2017 +0530

    systemvmtemplate: fix acpi shutdown
    
    Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
---
 .../definitions/systemvmtemplate/configure_acpid.sh         | 13 +++----------
 .../definitions/systemvmtemplate/configure_grub.sh          |  2 +-
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh b/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh
index f246342..6e27eee 100644
--- a/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh
+++ b/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh
@@ -20,18 +20,11 @@ set -e
 set -x
 
 function configure_acpid() {
-  grep /usr/local/sbin/power.sh /etc/acpi/events/power && return
-
   mkdir -p /etc/acpi/events
-  cat >> /etc/acpi/events/power << EOF
-event=button/power.*
-action=/usr/local/sbin/power.sh "%e"
-EOF
-  cat >> /usr/local/sbin/power.sh << EOF
-#!/bin/bash
-/sbin/poweroff
+  cat > /etc/acpi/events/powerbtn <<EOF
+event=button[ /]power
+action=/sbin/poweroff
 EOF
-  chmod a+x /usr/local/sbin/power.sh
 }
 
 return 2>/dev/null || configure_acpid
diff --git a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh
index 5d80e46..88596f2 100644
--- a/tools/appliance/definitions/systemvmtemplate/configure_grub.sh
+++ b/tools/appliance/definitions/systemvmtemplate/configure_grub.sh
@@ -20,7 +20,7 @@ set -e
 set -x
 
 function configure_grub() {
-  cat <<EOF > /etc/default/grub
+  cat > /etc/default/grub <<EOF
 # If you change this file, run 'update-grub' afterwards to update
 # /boot/grub/grub.cfg.
 

-- 
To stop receiving notification emails like this one, please contact
"commits@cloudstack.apache.org" <commits@cloudstack.apache.org>.

Mime
View raw message