Created
October 28, 2012 21:27
-
-
Save terrywang/3969985 to your computer and use it in GitHub Desktop.
kexec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# runkexec | |
# | |
### BEGIN INIT INFO | |
# Provides: runkexec | |
# Required-Start: | |
# Required-Stop: | |
# Default-Stop: | |
# Description: Enable or disable fast system rebooting | |
# Short-Description: enable or disable fast system rebooting | |
### END INIT INFO | |
KV=`uname -r` | |
case "$1" in | |
start|restart|load|reload) | |
kexec -l --append="`cat /proc/cmdline`" --initrd=/boot/initramfs-${KV}.img \ | |
/boot/vmlinuz-${KV} | |
;; | |
stop|unload) | |
kexec -u && echo "Target kexec kernel unloaded." | |
;; | |
status) | |
echo "Status not available for kexec." | |
;; | |
*) | |
echo "Usage: runkexec {start|restart|load|reload|stop|unload|status}" | |
exit 2 | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment