The shutdown configuration in sysfs

6.10 LPAR mode z/VM guest KVM guest

The configured shutdown action for each shutdown trigger is stored in a sysfs attribute /sys/firmware/shutdown_actions/on_<trigger>.

Figure 1. sysfs branch with shutdown action settings
This graphic shows the /sys/firmware/shutdown_actions directory with the contained attributes on_halt, on_poff, on_reboot, on_restart, and on_panic.

The preferred way to read or change these settings is using the lsshut, chshut. For dump actions on Linux® in LPAR mode or Linux on z/VM®, the preferred way is the dumpconf command. Alternatively, you can read and write to the /sys/firmware/shutdown_actions/on_<trigger> attributes.

Examples

  • This command reads the shutdown configuration:
    # lsshut
    Trigger          Action
    ========================
    Halt             stop
    Power off        stop
    Reboot           reipl
    Restart          kdump,stop
    Panic            kdump,stop
    
  • This command reads the shutdown setting for the poff shutdown trigger.
    # cat /sys/firmware/shutdown_actions/on_poff
    stop
  • This command changes the setting for the reboot shutdown trigger to ipl:
    # chshut reboot ipl
    Alternatively, you can directly write the new setting to sysfs:
    # echo ipl > /sys/firmware/shutdown_actions/on_reboot
  • This command changes the setting for the restart shutdown trigger to ipl:
    # echo ipl > /sys/firmware/shutdown_actions/on_restart

Details for the ipl, reipl, dump, and vmcmd shutdown actions are contained in the corresponding subdirectories in /sys/firmware. For example, /sys/firmware/ipl contains specifications for an IPL device and other IPL parameters.