[Devel,libvzctl,1/2] scripts: vz-rst-action -- Use env variable instead of pidfile value

Submitted by Cyrill Gorcunov on Aug. 2, 2016, 6:11 p.m.

Details

Message ID 1470161468-11537-2-git-send-email-gorcunov@openvz.org
State New
Series "Update scripts to fit CRIU-2.4"
Headers show

Commit Message

Cyrill Gorcunov Aug. 2, 2016, 6:11 p.m.
Since CRIU-2.4 the pidfile is written into file on lazy fasion.
So we have to use @CRTOOLS_INIT_PID variable instead.

https://jira.sw.ru/browse/PSBM-50551

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
 scripts/vz-rst-action.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/vz-rst-action.in b/scripts/vz-rst-action.in
index d302d8b..41eefb9 100755
--- a/scripts/vz-rst-action.in
+++ b/scripts/vz-rst-action.in
@@ -28,7 +28,7 @@  exec 1>&2
 restore_devices()
 {
 	local s d t major minor old dir device
-	local pid=$(cat $VE_PIDFILE)
+	local pid=$CRTOOLS_INIT_PID
 
 	root=/proc/$pid/root
 
@@ -70,7 +70,7 @@  fi
 set -e
 case "$CRTOOLS_SCRIPT_ACTION" in
 "setup-namespaces")
-	pid=$(cat $VE_PIDFILE)
+	pid=$CRTOOLS_INIT_PID
 	ln -s /proc/$pid/ns/net $VE_NETNS_FILE
 
 	if [ -n "$VEID" ]; then