summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-04-14 21:27:20 +1000
committerAmitay Isaacs <amitay@samba.org>2018-10-08 02:46:23 +0200
commit6ac5124b0117b7b5f3c5402934c93633ce186896 (patch)
tree551b361df271db3452d79ef5e331441c92d4933e /ctdb
parent0dfb3c87b50745012c6c8bab5e0af262ce3f5f87 (diff)
downloadsamba-6ac5124b0117b7b5f3c5402934c93633ce186896.tar.gz
ctdb-tests: Support closing of stdin in local daemons ssh stub
Not sure this is needed but this makes it behave the same as ssh. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/simple/scripts/ssh_local_daemons.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/ctdb/tests/simple/scripts/ssh_local_daemons.sh b/ctdb/tests/simple/scripts/ssh_local_daemons.sh
index 346011b376f..60e517cddb9 100755
--- a/ctdb/tests/simple/scripts/ssh_local_daemons.sh
+++ b/ctdb/tests/simple/scripts/ssh_local_daemons.sh
@@ -2,9 +2,11 @@
nodes="${CTDB_BASE}/nodes"
-# ssh options can't be used so discard them
+# Only try to respect ssh -n option, others can't be used so discard them
+close_stdin=false
while : ; do
case "$1" in
+ -n) close_stdin=true ; shift ;;
-*) shift ;;
*) break ;;
esac
@@ -42,5 +44,8 @@ fi
export CTDB_SOCKET="${CTDB_BASE}/ctdbd.socket"
export CTDB_PIDFILE="${CTDB_BASE}/ctdbd.pid"
-# Now
-exec sh -c "$command"
+if $close_stdin ; then
+ exec sh -c "$command" <&-
+else
+ exec sh -c "$command"
+fi