From 0f5a800cd53a3f816b218e343b93aec2b07c3a12 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 28 May 2013 16:48:40 -0700 Subject: [PATCH] vzctl restore/start: fix running mount script When doing vzctl restore, we should still run mount script. Error was introduced in commits 784b2ca and 40ea0d5. Revert those. Instead, we check for fn != NULL in vps_start_custom to distinguish between start and restore. In case of restore, we do not run start script. https://bugzilla.openvz.org/2603 Reported-by: dippo4589@gmail.com Signed-off-by: Kir Kolyshkin --- src/lib/env.c | 2 +- src/lib/hooks_ct.c | 2 +- src/lib/hooks_vz.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/env.c b/src/lib/env.c index d124564..0a11e2f 100644 --- a/src/lib/env.c +++ b/src/lib/env.c @@ -660,7 +660,7 @@ int vps_start_custom(vps_handler *h, envid_t veid, vps_param *param, { goto err; } - if (!(skip & SKIP_ACTION_SCRIPT)) { + if (!(skip & SKIP_ACTION_SCRIPT) && !fn) { /* Run dist actions PRE_START script */ if (actions.pre_start) { diff --git a/src/lib/hooks_ct.c b/src/lib/hooks_ct.c index 84b69e7..3da42eb 100644 --- a/src/lib/hooks_ct.c +++ b/src/lib/hooks_ct.c @@ -971,7 +971,7 @@ static int ct_restore(vps_handler *h, envid_t veid, vps_param *vps_p, int cmd, cpt_param *param, skipFlags skip) { return vps_start_custom(h, veid, vps_p, - SKIP_CONFIGURE | SKIP_ACTION_SCRIPT | skip, + SKIP_CONFIGURE | skip, NULL, ct_restore_fn, param); } diff --git a/src/lib/hooks_vz.c b/src/lib/hooks_vz.c index a6a1265..6e70634 100644 --- a/src/lib/hooks_vz.c +++ b/src/lib/hooks_vz.c @@ -833,7 +833,7 @@ static int vz_restore(vps_handler *h, envid_t veid, vps_param *vps_p, param->rst_fd = rst_fd; param->cmd = cmd; ret = vps_start_custom(h, veid, vps_p, - SKIP_CONFIGURE | SKIP_ACTION_SCRIPT | skip, + SKIP_CONFIGURE | skip, NULL, restore_fn, param); if (ret) goto err; -- 1.8.1.4