[CRIU] [PATCH v2] scripts: spfs-release-replace.sh introduced

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu May 26 02:58:13 PDT 2016


This script should be used to trigger actual file systems replace by SPFS
manager.
By default mount point replace processes are on hold waiting for message to
proceed with replace. The reason for this hold is that otherwise they can race
with criu on attempt to attach to processes (actual file system can be
remounted before criu released processes).

v2:
Updated initially missed changes

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 scripts/spfs-release-replace.sh |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 scripts/spfs-release-replace.sh

diff --git a/scripts/spfs-release-replace.sh b/scripts/spfs-release-replace.sh
new file mode 100755
index 0000000..d4f62d2
--- /dev/null
+++ b/scripts/spfs-release-replace.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+[[ "post-resume" == "$CRTOOLS_SCRIPT_ACTION" ]] || exit 0
+
+set -o pipefail
+
+if [ -z "$SPFS_MANAGER_SOCK" ]; then
+	echo "SPFS_MANAGER_SOCK environment variable is not set"
+	exit 1
+fi
+
+[ -e $SPFS_MANAGER_SOCK ] || exit 0
+
+if [ ! -S "$SPFS_MANAGER_SOCK" ]; then
+	echo "$SPFS_MANAGER_SOCK is not a socket"
+	exit 1
+fi
+
+SPFS_CLIENT="/usr/sbin/spfs-client"
+
+if [ ! -x "$SPFS_CLIENT" ]; then
+	echo "Filed to find executable /usr/sbin/spfs-client"
+	exit 1
+fi
+
+$SPFS_CLIENT manage "replace;all;mode=release" --socket-path $SPFS_MANAGER_SOCK > /dev/null
+exit $?



More information about the CRIU mailing list