Skip to content

Commit

Permalink
Add restart support for postgresql
Browse files Browse the repository at this point in the history
When doing a restart, look for and log errors
  • Loading branch information
dlangille committed Aug 8, 2019
1 parent f9c7d80 commit 9552a3a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions cert-puller
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sudo_examples(){
echo "anvil ALL=(ALL) NOPASSWD:${SERVICE} ${service} graceful"
;;

"dovecot" | "mosquitto" | "nginx" | "postfix")
"dovecot" | "mosquitto" | "nginx" | "postfix" | "postgresql")
echo "anvil ALL=(ALL) NOPASSWD:${SERVICE} ${service} restart"
;;
esac
Expand Down Expand Up @@ -174,14 +174,28 @@ restart_services(){
case ${service} in
"apache22" | "apache24")
${LOGGER} doing a graceful on ${service}
${SUDO} ${SERVICE} ${service} graceful
ERRORS=`${SUDO} ${SERVICE} ${service} graceful 2>&1`
if [ $? != 0 ]; then
${LOGGER} ERROR on restart
${LOGGER} "${ERRORS}"
echo "${ERRORS}"
else
${LOGGER} no errors on restart
fi
;;

# it might be better if we do a reload.
# will that be sufficient?
"dovecot" | "mosquitto" | "nginx" | "postfix")
"dovecot" | "mosquitto" | "nginx" | "postfix" | "postgresql" )
${LOGGER} restarting ${service}
${SUDO} ${SERVICE} ${service} restart
ERRORS=`${SUDO} ${SERVICE} ${service} restart 2>&1`
if [ $? != 0 ]; then
${LOGGER} ERROR on restart
${LOGGER} "${ERRORS}"
echo "${ERRORS}"
else
${LOGGER} no errors on restart
fi
;;

*)
Expand Down

0 comments on commit 9552a3a

Please sign in to comment.