X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fvshelper;h=b9dfdf9c129693a38071931c3bc76717d286ee11;hb=3b34449070c0846fdc49436d1edd5916512f1644;hp=9738ba8405b94a5e70c2bf88475dc33a6d88c03b;hpb=7370d748ee384dd549f2947c60ebc9a647907d06;p=util-vserver.git diff --git a/scripts/vshelper b/scripts/vshelper index 9738ba8..b9dfdf9 100755 --- a/scripts/vshelper +++ b/scripts/vshelper @@ -54,13 +54,25 @@ function doInternalMethod case "$ACTION" in (restart) logging $"Restarting vserver '$VSERVER'" - spawn killContext "$XID" - execute $_VSERVER --defaulttty "$VSERVER" restart + + local sync_dir + vshelper.initStopSync sync_dir + + spawn $_VSERVER --defaulttty "$VSERVER" restart & + + disown %% + vshelper.waitForStopSync "$sync_dir" ;; (halt|poweroff) logging $"Stopping vserver '$VSERVER'" - spawn killContext "$XID" - execute $_VSERVER --defaulttty "$VSERVER" stop + + local sync_dir + vshelper.initStopSync sync_dir + + spawn $_VSERVER --defaulttty "$VSERVER" stop & + + disown %% + vshelper.waitForStopSync "$sync_dir" ;; (swsusp) ## TODO: any senseful action here? Perhaps shutdown scheduler for it?