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

Change History

comment:1 Changed 20 months ago by roy

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.

comment:2 Changed 20 months ago by roy

  • Status changed from new to accepted

r1484 now sets the RC_REBOOT env var to yes so that init scripts can work out if we're rebooting or not.

Now we just need to use this in an existing init script or add a new one.

comment:3 Changed 19 months ago by anonymous

  • Status changed from accepted to closed
  • Resolution set to fixed

Fixed in r1491

Note: See TracTickets for help on using tickets.