Skip to content

Commit

Permalink
node_exporter_install: stop service before force installing
Browse files Browse the repository at this point in the history
Stop node-exporter.service before re-install it, to avoid 'Text file busy' error.

Fixes scylladb#6782
  • Loading branch information
syuu1228 committed Jul 7, 2020
1 parent 5ebe2c2 commit e910747
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dist/common/scripts/node_exporter_install
Expand Up @@ -42,6 +42,11 @@ if __name__ == '__main__':
if node_exporter_p.exists() or (bindir_p() / 'prometheus-node_exporter').exists():
if force:
print('node_exporter already installed, reinstalling')
try:
node_exporter = systemd_unit('node-exporter.service')
node_exporter.stop()
except:
pass
else:
print('node_exporter already installed, you can use `--force` to force reinstallation')
sys.exit(1)
Expand Down

0 comments on commit e910747

Please sign in to comment.