From 5627b67ff3a6af70949ee1622b3e5a572d39a0b7 Mon Sep 17 00:00:00 2001 From: Leo Simons Date: Mon, 21 Jul 2014 11:19:03 +0200 Subject: [PATCH] CLOUDSTACK-7143: move fix_acpid to its own file --- .../systemvmtemplate/configure_acpid.sh | 15 +++++++++++++++ .../definitions/systemvmtemplate/definition.rb | 1 + .../definitions/systemvmtemplate/postinstall.sh | 15 --------------- 3 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 tools/appliance/definitions/systemvmtemplate/configure_acpid.sh diff --git a/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh b/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh new file mode 100644 index 00000000000..70abe30bfc9 --- /dev/null +++ b/tools/appliance/definitions/systemvmtemplate/configure_acpid.sh @@ -0,0 +1,15 @@ +fix_acpid() { + # Fix acpid + 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 +EOF + chmod a+x /usr/local/sbin/power.sh +} + +fix_acpid diff --git a/tools/appliance/definitions/systemvmtemplate/definition.rb b/tools/appliance/definitions/systemvmtemplate/definition.rb index be0b4036ce0..a2eb82bec6b 100644 --- a/tools/appliance/definitions/systemvmtemplate/definition.rb +++ b/tools/appliance/definitions/systemvmtemplate/definition.rb @@ -63,6 +63,7 @@ config = { 'configure_locale.sh', 'configure_login.sh', 'postinstall.sh', + 'configure_acpid.sh', 'cleanup.sh', 'configure_networking.sh', 'zerodisk.sh' diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh index 893b5214fb1..f2ce1ae6d74 100644 --- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh +++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh @@ -116,20 +116,6 @@ nameserver 8.8.4.4 EOF } -fix_acpid() { - # Fix acpid - 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 -EOF - chmod a+x /usr/local/sbin/power.sh -} - fix_hostname() { # Fix hostname in openssh-server generated keys sed -i "s/root@\(.*\)$/root@$HOSTNAME/g" /etc/ssh/ssh_host_*.pub @@ -164,7 +150,6 @@ EOF do_fixes() { fix_nameserver - fix_acpid fix_hostname fix_conntrackd fix_vhdutil