[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible node health: more sophisticated cleanup of failed services and units
Holger Levsen
gitlab at salsa.debian.org
Sun Jul 26 00:34:24 BST 2020
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
99c771e6 by Holger Levsen at 2020-07-26T01:34:11+02:00
reproducible node health: more sophisticated cleanup of failed services and units
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/reproducible_node_health_check.sh
Changes:
=====================================
bin/reproducible_node_health_check.sh
=====================================
@@ -146,12 +146,22 @@ fi
#
echo "$(date -u) - checking whether all services are running fine..."
if ! systemctl is-system-running > /dev/null; then
- for UNIT in pbuilder_build acpid rc-local session- ; do
- if [ -n "$(systemctl list-units --state=error,failed | grep '$UNIT')" ] ; then
+ SERVICES=$(mktemp --tmpdir=$TEMPDIR node-health-XXXXXXX)
+ systemctl list-units --state=error,failed > $SERVICES
+ for UNIT in acpid rc-local ; do
+ if [ -n "$(grep '$UNIT' $SERVICES)" ] ; then
echo "$(date -u) - resetting failed unit $UNIT..."
- sudo systemctl reset-failed $UNIT | ( echo "Warning: failed to systemctl reset-failed $UNIT" ; DIRTY=true )
+ sudo systemctl reset-failed $UNIT
fi
done
+ for UNIT in pbuilder_build session- ; do
+ if [ -n "$(grep '$UNIT' $SERVICES)" ] ; then
+ SCOPE=$(grep '$UNIT' $SERVICES | cut -d ' ' -f2)
+ echo "$(date -u) - resetting failed scope $SCOPE for $UNIT..."
+ sudo systemctl reset-failed $SCOPE
+ fi
+ done
+ rm $SERVICES
if ! systemctl is-system-running > /dev/null; then
systemctl status|head -5
echo "Warning: systemd is reporting errors:"
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/99c771e6a113924a0bc7eaaed04797618d478107
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/99c771e6a113924a0bc7eaaed04797618d478107
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20200725/b2e09aec/attachment-0001.html>
More information about the Qa-jenkins-scm
mailing list