ctdb-tests: Enable job control when keeping stdin open
authorMartin Schwenke <martin@meltin.net>
Mon, 13 Jan 2020 23:58:15 +0000 (10:58 +1100)
committerMartin Schwenke <martins@samba.org>
Tue, 28 Jan 2020 11:24:35 +0000 (11:24 +0000)
POSIX says:

  If job control is disabled (see set, -m), the standard input for an
  asynchronous list, before any explicit redirections are performed,
  shall be considered to be assigned to a file that has the same
  properties as /dev/null. This shall not happen if job control is
  enabled. In all cases, explicit redirection of standard input shall
  override this activity.

ctdbd is backgrounded at startup, so the above causes stdin to be
redirected from /dev/null.  Enable job control to work around this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jan 28 11:24:35 UTC 2020 on sn-devel-184

ctdb/tests/local_daemons.sh

index 2fa439f6c13a9abbfda248fa6c4cd9faf09ca4d5..4a653224b236cd918a39a2cd7faf90ab2cad06f2 100755 (executable)
@@ -307,7 +307,7 @@ local_daemons_ssh ()
        if $_close_stdin ; then
                exec sh -c "$*" <&-
        else
-               exec sh -c "$*"
+               exec sh -m -c "$*"
        fi
 }