init.d/vz-redhat: stop vz earlier

As it nicely laid out by the bug reporter:

> I noticed after rebooting one of our hardware nodes the other day that
> all of the 'sshd' processes in the VPSes had disappeared. It turns out
> this is related to the new "suspend/restore" feature added in vzctl 4.1,
> and also to the /etc/init.d/sshd script shipped in CentOS.
>
> The sshd init script in CentOS contains the following in its "stop"
> function:
>
>	# if we are in halt or reboot runlevel kill all running sessions
>	# so the TCP connections are closed cleanly
>	if [ "x$runlevel" = x0 -o "x$runlevel" = x6 ] ; then
>		trap '' TERM
>		killall $prog 2>/dev/null
>		trap TERM
>	fi
>
> ($prog is "sshd")
>
> This means that when the hardware node is rebooted, the "sshd" processes
> inside the VPSes are included in the processes that are killed.
>
> The /etc/init.d/vz script which suspends the VPSes runs at priority 88,
> the sshd script runs at priority 25.
>
> The easiest fix (which I've implemented on our systems) is to run
> /etc/init.d/vz before /etc/init.d/sshd - I've changed it to priority 10
> on our systems.
>
> A quick scan of the priorities in /etc/rc6.d suggests this may be a
> better priority for the vz script anyway (it would make sense to have it
> as one of the first things that stops, considering it's one of the last
> things which starts). For example, the "netfs" script runs at priority
> 75, and should probably be run after "vz" in case there are VPSes using
> networked file systems.

Changing stop priority to 20 (same as in PCS), so it will stop before
sshd, netfs etc.

http://bugzilla.openvz.org/2478

Reported-by: Chris Butler <chrisb@zedcore.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed