Skip to content

Commit

Permalink
Low: ClusterMon: Add OCF_CHECK_LEVEL handling in the validate-all action
Browse files Browse the repository at this point in the history
  • Loading branch information
waltdisgrace committed Aug 17, 2022
1 parent 47d9654 commit faee3f3
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions extra/resources/ClusterMon.in
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,21 @@ fi
}

ClusterMon_validate() {
# Existence of the user
if [ -n "$OCF_RESKEY_user" ]; then
getent passwd "$OCF_RESKEY_user" >/dev/null
if [ $? -eq 0 ]; then
: Yes, user exists. We can further check his permission on crm_mon if necessary
else
ocf_log err "The user $OCF_RESKEY_user does not exist!"
exit $OCF_ERR_ARGS
# Host-specific checks
if [ "$OCF_CHECK_LEVEL" = "10" ]; then

# Existence of the user
if [ -n "$OCF_RESKEY_user" ]; then
getent passwd "$OCF_RESKEY_user" >/dev/null
if [ $? -eq 0 ]; then
: Yes, user exists. We can further check his permission on crm_mon if necessary
else
ocf_log err "The user $OCF_RESKEY_user does not exist!"
exit $OCF_ERR_ARGS
fi
fi
fi

fi

# Pidfile better be an absolute path
case "$OCF_RESKEY_pidfile" in
Expand Down

0 comments on commit faee3f3

Please sign in to comment.