diff options
| author | Ramakrishnan G <rameshg87@gmail.com> | 2015-06-08 02:55:17 -0700 |
|---|---|---|
| committer | Jim Rollenhagen <jim@jimrollenhagen.com> | 2015-06-09 23:44:08 +0000 |
| commit | be36ed69039ffb4fb9620f9433a3c481ed31581e (patch) | |
| tree | 0792916581b62885f8e6a4c9449833bff918ab9a /ironic_python_agent/shell | |
| parent | 0a416af0c8fd858c5ff1d8c2d1c0b0bdad888278 (diff) | |
| download | ironic-python-agent-be36ed69039ffb4fb9620f9433a3c481ed31581e.tar.gz | |
Add power_off command in standby extension
This commit adds a new command power_off to
standby extension which runs shutdown -h now
on the system. This commit also adds mappings
for /proc and /sys in cloud-config.yml for the
agent service spawned.
Partial-Bug: #1451310
Change-Id: I2a5f984af26bbbe03002bb8c367c8c6af8d91434
Diffstat (limited to 'ironic_python_agent/shell')
| -rw-r--r-- | ironic_python_agent/shell/shutdown.sh (renamed from ironic_python_agent/shell/reboot.sh) | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ironic_python_agent/shell/reboot.sh b/ironic_python_agent/shell/shutdown.sh index beb7fce7..3c7738c7 100644 --- a/ironic_python_agent/shell/reboot.sh +++ b/ironic_python_agent/shell/shutdown.sh @@ -22,4 +22,8 @@ set -e echo "1" > /proc/sys/kernel/sysrq echo "s" > /proc/sysrq-trigger -echo "b" > /proc/sysrq-trigger +if [[ $1 = '-h' ]]; then + echo "o" > /proc/sysrq-trigger +elif [[ $1 = '-r' ]]; then + echo "b" > /proc/sysrq-trigger +fi |
