Kill init and other remaining processes from vshelper once the stop sync signal has arrived.
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2508
94cd875c-1c1d-0410-91d2-
eb244daf1a30
test ! -p "$VSHELPER_STOP_SYNC" || echo stopped > "$VSHELPER_STOP_SYNC"
}
+function vshelper.isStopSync
+{
+ test -p "$VSHELPER_STOP_SYNC" || return 1
+ return 0
+}
+
function _rpmFake.getCapFlags
{
local ctx=$1
initWait "$VSERVER_DIR" "$S_CONTEXT" vwait_statdir
if test -n "$_IS_FAKEINIT" && \
$_VSERVER_INFO - FEATURE vkill; then
- $_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
- ## HACK: remove the 'initpid' stuff above when PID virtualization
- ## is implemented
+ if ! vshelper.isStopSync; then
+ $_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
+ fi
elif $_VSERVER_INFO - FEATURE migrate; then
"${NICE_CMD[@]}" \
$_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- \
disown %%
vshelper.waitForStopSync "$sync_dir"
+ spawn killContext "$XID"
;;
(swsusp)
## TODO: any senseful action here? Perhaps shutdown scheduler for it?