Ticket #138 (closed defect: fixed)
Opened 20 months ago
Last modified 19 months ago
openrc-0.4.X: creating /reboot file for openvz vps container on reboot
Reported by: | asowden@12ngstreet.com | Owned by: | roy |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | rc | Version: | 0.4 |
Keywords: | Cc: |
Description
A line in the old halt.sh file used to create a /reboot file for openvz systems, that would trigger an openvz host to restart the vps. I can't find equivalent code in the new 0.4.X versions of openrc.
I've not yet actually installed the latest 0.4.X openrc -- I have only access to a container vps and not the openvz host, and without a /reboot file I have to get support to restart my client.
I have made a thorough search of openrc, looking for openvz and reboot. I've also searched the latest sysvinit, thinking that the code may have moved to /sbin/halt. In the new openrc rc.c, there doesn't appear to be a lot of code that executes before newlevel "reboot" is replaced by "shutdown".
Are you thinking that the new shutdown runlevel could be used? Can a script in this runlevel distinguish shutdowns from reboots?
Apologies if I'm missing something obvious. The startup side looks good from an openvz point of view.
Many thanks
Anthony
One of the issues is that OpenRC no longer knows if we're rebooting or not. We removed all the sysvinit code and the reboot runlevel, which removed our reliance on sysvinit (or emulating it on BSD). This fixed a lot of bugs and makes us a lot more portable.
However, we now need to add a small bit of code we optionally use to work out if we're rebooting so we can pass this onto our init scripts. This is very reliant on the init system, but we no longer depend on knowing the init system or forcing it to emulate sysvinit.