Create /reboot if running inside OpenVZ, #138.

This should be fine as vpsreboot should only restart a stopped container.
This commit is contained in:
Roy Marples 2009-02-10 15:06:48 +00:00
parent 6bb44be2a3
commit 3d7b56f2e2

View File

@ -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
}