Skip to content

Commit dcefa6e

Browse files
committed
Issue #76: change connectivity test /bin/true to a forced logrotate
1 parent ba66cbf commit dcefa6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clusters/common/bin/savelogsdb.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ declare -x SSH_OPTARGS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/n
4343
declare -x PROVISIONED_D=common/._state/provisioned
4444
declare -x SAVELOGS_D=${IAM}.${TSTAMP}.d
4545
declare -x TMPDIR
46+
declare -x LOGROTATE_CONF=/etc/logrotate.conf
4647

4748
if [ -n "${TMPDIR}" ] ; then
4849
if [ -d ${TMPDIR} ] ; then
@@ -70,7 +71,7 @@ SaveLogs() {
7071
export DB_HOST=${any_up:0:2}db
7172

7273
Rc ErrExit ${EX_CONFIG} "ping -c 1 -i 1 -n -q -w 1 ${_h}"
73-
Rc ErrExit ${EX_CONFIG} "ssh ${SSH_OPTARGS} ${_h} /bin/true"
74+
Rc ErrExit ${EX_OSFILE} "ssh ${SSH_OPTARGS} ${_h} sudo -n sh -c \"/usr/sbin/logrotate --force ${LOGROTATE_CONF}; exit 0\""
7475
Rc ErrExit ${EX_CONFIG} "mkdir -p ${TMPDIR}/${_h}"
7576

7677
LOGDIRS=( ${LOGDIRS} )
@@ -100,7 +101,7 @@ SaveDB() {
100101
Rc ErrExit ${EX_CONFIG} "ssh ${SSH_OPTARGS} ${_h} /bin/true"
101102
Rc ErrExit ${EX_CONFIG} "mkdir -p ${TMPDIR}/${_h}"
102103
# Assumes: invoking user has password-less sudo enabled in-cluster
103-
MYSQLPASS=$(echo $(ssh -q ${SSH_OPTARGS} ${_h} sudo grep StoragePass= ${SLURMDBDCONF}) | sed 's/StoragePass=//')
104+
MYSQLPASS=$(echo $(ssh -q ${SSH_OPTARGS} ${_h} sudo -n grep StoragePass= ${SLURMDBDCONF}) | sed 's/StoragePass=//')
104105
if [ -z "${MYSQLPASS}" ] ; then
105106
ErrExit ${EX_SOFTWARE} "Warning: slurmdb password empty, expect a broken, incomplete or empty db dump."
106107
fi

0 commit comments

Comments
 (0)