vzmigrate: make sure @SBINDIR@ is in $PATH

vzmigrate scripts calls vzctl binary (locally and remotely using ssh root@host).

For local calls, we rely on PATH containing the directory vzctl was installed
into, which is, naturally, @SBINDIR@. Usually this is /usr/sbin or /usr/local/sbin
which are in root's PATH. But in case we run sudo vzmigrate it can not be the case
and lead to the following error:

	/usr/sbin/vzmigrate: line 312: vzctl: command not found

So, let's check that @SBINDIR@ is there in $PATH, and add it if it is not.

For remote calls, we use ssh root@host and rely on the remote side to
set proper PATH for root user.

Alternatively, we can say something like VZCTL=@SBINDIR/vzctl, but
it won't work in a case when vzctl is installed locally into /usr/sbin
and remotely into say /usr/local/sbin (or vise versa).

Reported-by: Pavel Odintsov <pavel.odintsov@googlemail.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed