aboutsummaryrefslogtreecommitdiff
path: root/init.d/bootmisc.in
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-02-10 15:06:48 +0000
committerRoy Marples <roy@marples.name>2009-02-10 15:06:48 +0000
commit3d7b56f2e20e28aa22b1c09e4318ae0420485071 (patch)
tree241a69b69f8fc75be49bb43020eee24d5dbb71ac /init.d/bootmisc.in
parent6bb44be2a3af33512a6ce066246dfa71edc53fd9 (diff)
Create /reboot if running inside OpenVZ, #138.
This should be fine as vpsreboot should only restart a stopped container.
Diffstat (limited to 'init.d/bootmisc.in')
-rw-r--r--init.d/bootmisc.in11
1 files 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
}