Add a random seep before restarting the postgresql and pgpool services after a certificate renewal. See https://support.d4science.org/issues/10229

This commit is contained in:
Andrea Dell'Amico 2017-11-06 18:01:48 +01:00
parent 38554c6692
commit fd700fe28c
2 changed files with 5 additions and 1 deletions

View File

@ -26,8 +26,10 @@ chgrp postgres ${PGPOOL2_KEYFILE}
echo "Reload the pgpool2 service" >> $LE_LOG_DIR/pgpool2.log
if [ -x /bin/systemctl ] ; then
sleep $RANDOM
systemctl reload pgpool2 >> $LE_LOG_DIR/pgpool2.log 2>&1
else
sleep $RANDOM
service pgpool2 reload >> $LE_LOG_DIR/pgpool2.log 2>&1
fi

View File

@ -24,10 +24,12 @@ chmod 440 ${POSTGRESQL_KEYFILE}
chown root ${POSTGRESQL_KEYFILE}
chgrp postgres ${POSTGRESQL_KEYFILE}
echo "Reload the postgresql service" >> $LE_LOG_DIR/postgresql.log
echo "Restart the postgresql service" >> $LE_LOG_DIR/postgresql.log
if [ -x /bin/systemctl ] ; then
sleep $RANDOM
systemctl restart postgresql >> $LE_LOG_DIR/postgresql.log 2>&1
else
sleep $RANDOM
service postgresql restart >> $LE_LOG_DIR/postgresql.log 2>&1
fi