Skip to content

Commit

Permalink
fix(node_exporter): improve systemd unit
Browse files Browse the repository at this point in the history
Changes:
- wait a bit more on restart: prevent failure if the port 9100 is
  already occupied by an old instance of node_exporting that is taking
  too much time stop
- exit with 0 on normal shutdown
  • Loading branch information
gsanchietti committed Feb 28, 2025
1 parent fb2445e commit 91eda66
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/imageroot/etc/systemd/system/node_exporter.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=-/etc/nethserver/core.env
WorkingDirectory=/var/lib/nethserver/node/state
Restart=always
RestartSec=3
TimeoutStartSec=120
# node_exporter exits with 143 on SIGTERM:
SuccessExitStatus=143
ExecStartPre=/bin/rm -f %t/%N.pid %t/%N.cid
ExecStartPre=/usr/bin/mkdir -p /run/node_exporter
ExecStart=/usr/bin/podman run \
Expand Down

0 comments on commit 91eda66

Please sign in to comment.