[CRIU] [PATCH 2/2] scripts: remove bogus command substitution in systemd-autofs-restart.sh

Eugene Kolomeetz klm at virtuozzo.com
Tue Jun 7 08:06:05 PDT 2016


When we want to just execute command (without capturing output), we must
not do it via $(cmd). With such form, shell first gets output of 'cmd',
and then evaluates it. If this is empty string, it is successfully
executed. If not empty, all breaks down.
https://jira.sw.ru/browse/PSBM-44207

Signed-off-by: Eugene Kolomeetz <klm at virtuozzo.com>
---
 scripts/systemd-autofs-restart.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/systemd-autofs-restart.sh b/scripts/systemd-autofs-restart.sh
index 57d21a5..d069638 100755
--- a/scripts/systemd-autofs-restart.sh
+++ b/scripts/systemd-autofs-restart.sh
@@ -82,7 +82,7 @@ function bind_mount {
 	local from=$1
 	local to=$2
 
-	$($JOIN_CT mount --bind $from $to) && return 0
+	$JOIN_CT mount --bind $from $to && return 0
 
 	echo "Failed to bind mount $from to $to"
 	return 1
@@ -112,7 +112,7 @@ function restore_mountpoint {
 
 	# Umount file system, remounted by systemd, if any
 	if ! check_fs_type $mountpoint "autofs"; then
-		$($JOIN_CT umount $mountpoint) || echo "Failed to umount $mountpoint"
+		$JOIN_CT umount $mountpoint || echo "Failed to umount $mountpoint"
 	fi
 
 	# Restore origin file system even if we failed to unmount the new one
-- 
1.7.6



More information about the CRIU mailing list