背景:
阅读新闻
小发现:Ubuntu使用kexec重启系统
[日期:2009-12-23] 来源:Linuxeden 作者:blackspace [字体:]
2.查看/etc/default/kexec文件
apple@Ubuntu:~$ cat /etc/init.d/kexec
#! /bin/sh
### BEGIN INIT INFO
# Provides: kexec
# Required-Start:
# Required-Stop: reboot
# X-Stop-After: umountroot
# Default-Start:
# Default-Stop: 6
# Short-Description: Execute the kexec -e command to reboot system
# Description:
### END INIT INFO
PATH=/usr/sbin:/usr/bin:/sbin:/bin
. /lib/lsb/init-functions
test -r /etc/default/kexec && . /etc/default/kexec
do_stop () {
test "x`cat /sys/kernel/kexec_loaded`y" = "x1y" || exit 0
test -x /sbin/kexec || exit 0
log_action_msg "Will now restart with kexec"
kexec -e
log_failure_msg "kexec failed"
}
case "$1" in
start)
# No-op
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
exit 0
apple@ubuntu:~$
/etc/init.d/kexec脚本使用了/etc/default/kexec中的配置,查看/etc/default/kexec
apple@ubuntu:/$ cat /etc/default/kexec
# Defaults for kexec initscript
# sourced by /etc/init.d/kexec and /etc/init.d/kexec-load
# Load a kexec kernel (true/false)
LOAD_KEXEC=true
# Kernel and initrd image
KERNEL_IMAGE="/vmlinuz"
INITRD="/initrd.img"
# If empty, use current /proc/cmdline
APPEND=""
apple@ubuntu:/$ cat /etc/default/kexec
# Defaults for kexec initscript
# sourced by /etc/init.d/kexec and /etc/init.d/kexec-load
# Load a kexec kernel (true/false)
LOAD_KEXEC=true
# Kernel and initrd image
KERNEL_IMAGE="/vmlinuz"
INITRD="/initrd.img"
# If empty, use current /proc/cmdline
APPEND=""
原来这个/etc/default/kexec是配置重启过程中kexec的参数的
相关资讯 Ubuntu知识
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯