Skip to content

Commit 901dbec

Browse files
committed
dstat: avoid creating self-referential symlink
If the SCREEN_LOGDIR and LOGDIR environment variables point to the same location, devstack creates a dstat.log which is a symlink pointing to itself. The second invokation of devstack then fails trying to reference this broken symlink Change-Id: I1de2bb7983e7535b41b28f526083a0d77312ff85
1 parent b9a7d3b commit 901dbec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/dstat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function start_dstat {
2929
DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv"
3030
if [[ -n ${LOGDIR} ]]; then
3131
screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $LOGDIR/$DSTAT_FILE"
32-
if [[ -n ${SCREEN_LOGDIR} ]]; then
32+
if [[ -n ${SCREEN_LOGDIR} && ${SCREEN_LOGDIR} != ${LOGDIR} ]]; then
3333
# Drop the backward-compat symlink
3434
ln -sf $LOGDIR/$DSTAT_FILE ${SCREEN_LOGDIR}/$DSTAT_FILE
3535
fi

0 commit comments

Comments
 (0)