From 3d7b56f2e20e28aa22b1c09e4318ae0420485071 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 10 Feb 2009 15:06:48 +0000 Subject: [PATCH] Create /reboot if running inside OpenVZ, #138. This should be fine as vpsreboot should only restart a stopped container. --- init.d/bootmisc.in | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index c3e714a9..acdce994 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -29,7 +29,7 @@ cleanup_tmp_dir() if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then ebegin "Wiping ${dir} directory" local startopts="-x . -depth" - [ "${RC_UNAME}" = "Linux" ] && startopts=". -xdev -depth" + [ "${RC_UNAME}" = Linux ] && startopts=". -xdev -depth" # Faster than find rm -rf -- [b-ikm-pr-zA-Z0-9\.]* @@ -131,7 +131,7 @@ start() if ${logw} || dir_writeable /var/log; then # Create an 'after-boot' dmesg log - if [ "${RC_SYS}" != "VSERVER" -a "${RC_SYS}" != "OPENVZ" ]; then + if [ "${RC_SYS}" != VSERVER -a "${RC_SYS}" != OPENVZ ]; then dmesg > /var/log/dmesg chmod 640 /var/log/dmesg fi @@ -144,9 +144,10 @@ start() stop() { # Write a halt record if we're shutting down - case "${RC_RUNLEVEL}" in - reboot|shutdown) [ "${RC_UNAME}" = "Linux" ] && halt -w;; - esac + if [ "${RC_RUNLEVEL}" = shutdown ]; then + [ "${RC_UNAME}" = Linux ] && halt -w + [ "${RC_SYS}" = OPENVZ ] && printf "" >/reboot + fi return 0 }