diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-09-16 12:33:26 +1000 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2014-09-17 09:55:47 +0200 |
commit | 22257dd4b6d226ee956ede5a847ce0bcb99333be (patch) | |
tree | 505f7e51e57604c413b6c165b06075adae1fd0cf /ctdb | |
parent | 8509bffdebb7884b765904f8112ff83056511a30 (diff) | |
download | samba-22257dd4b6d226ee956ede5a847ce0bcb99333be.tar.gz |
ctdb-scripts: Do not export variables if they are not set
Variables that are not set but exported, may return an empty string
for getenv(). Tested on freebsd.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep 17 09:55:47 CEST 2014 on sn-devel-104
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/config/ctdbd_wrapper | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index ce20e7e52fc..cbde6bafbaa 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -20,7 +20,7 @@ action="$2" . "${CTDB_BASE}/functions" loadconfig "ctdb" -export CTDB_SOCKET +[ -n "$CTDB_SOCKET" ] && export CTDB_SOCKET ctdbd="${CTDBD:-/usr/sbin/ctdbd}" @@ -136,7 +136,9 @@ build_ctdb_options () export_debug_variables () { - export CTDB_DEBUG_HUNG_SCRIPT CTDB_EXTERNAL_TRACE CTDB_DEBUG_LOCKS + [ -n "$CTDB_DEBUG_HUNG_SCRIPT" ] && export CTDB_DEBUG_HUNG_SCRIPT + [ -n "$CTDB_EXTERNAL_TRACE" ] && export CTDB_EXTERNAL_TRACE + [ -n "$CTDB_DEBUG_LOCKS" ] && export CTDB_DEBUG_LOCKS } kill_ctdbd () |