Skip to content

Commit cbd90c1

Browse files
committed
Replace SYSRQ commands
This patch is modifying the shutdown.sh script to not use SYSRQ when performing power actions. SYSRQ has a similar effect to a hardware reset button/power switch, which can be problematic after copying an image to the disk (data loss) therefore, this patch is changing the script to use soft power action via the poweroff and reboot commands. SYSRQ was required before because the ironic-python-agent service was running inside a docker container, but since we've moved it to run into a chroot (when built with coreos) or on the ramdisk's OS (when built with DIB) the SYSRQ actions are not needed anymore. In many parts of Ironic we were considering the standby.{power_off, reboot} methods of IPA to be soft actions, which they are not at present. This patch is also fixing that assumption. Change-Id: Ibe3a3f61a4a0e98b2c2501ad95154839933b4d7a Closes-Bug: #1557450
1 parent dcd1c8f commit cbd90c1

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

ironic_python_agent/shell/shutdown.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# This script reboots by echoing into /proc/sysrq_trigger.
18-
1917
set -e
2018

21-
# Make sure all functions of sysrq is enabled.
22-
echo "1" > /proc/sys/kernel/sysrq
19+
# flush file system buffers
20+
sync
2321

24-
echo "s" > /proc/sysrq-trigger
2522
if [[ $1 = '-h' ]]; then
26-
echo "o" > /proc/sysrq-trigger
23+
poweroff
2724
elif [[ $1 = '-r' ]]; then
28-
echo "b" > /proc/sysrq-trigger
25+
reboot
2926
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- Stop using SYSRQ when performing the in-band reboot or power off
4+
because it has a similar effect to a hardware reset button/power
5+
switch and can be problematic on some hardware types. Instead,
6+
reboot/power off the node via the "poweroff" and "reboot" commands
7+
(soft power action).

0 commit comments

Comments
 (0)