Skip to content

Commit

Permalink
s9s_error_reporter: sync changes(&bugfixes) from clustercontrol
Browse files Browse the repository at this point in the history
  • Loading branch information
kedazo committed Aug 22, 2019
1 parent a5b2c84 commit bf0bd5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ccadmin/s9s_error_reporter
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ function create_local_s9s_user
cmon_user="s9s-error-reporter-$SUDO_USER"
fi

# remove the non-working config
rm -f $S9S_USER_CONFIG 2>/dev/null

# new s9s CLI requires the username defined alone without --cmon-user
# only the new one has BUILD info in --version:
if s9s --version | grep BUILD >/dev/null; then
s9s user --create --generate-key --group=admins --controller="https://localhost:9501" $cmon_user
s9s user --create --generate-key --group=admins --controller="https://localhost:9501" "$cmon_user"
else
s9s user --create --generate-key --group=admins --controller="https://localhost:9501" --cmon-user="$cmon_user"
fi
Expand All @@ -72,10 +75,12 @@ CONFIG_END
if [ -z "$SUDO_USER" ]; then
chown -R root ~/.s9s
else
chown -R $SUDO_USER ~/.s9s
chown -R "$SUDO_USER" ~/.s9s
fi
fi

s9s user --whoami

unset S9S_SYSTEM_CONFIG
unset S9S_USER_CONFIG
}
Expand Down Expand Up @@ -126,6 +131,9 @@ if (( EUID != 0 )); then
exit 1
fi

/etc/init.d/cmon start || true
/etc/init.d/cmon status

ensure_tools_installed
create_report

0 comments on commit bf0bd5a

Please sign in to comment.