Skip to content

Commit

Permalink
teuthology/task/install: add daemon-rebooter
Browse files Browse the repository at this point in the history
A simple utility to restart a daemon/task if it returns success.

Signed-off-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Apr 10, 2024
1 parent 10f2ded commit 6843a8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions teuthology/task/install/bin/daemon-rebooter
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

while "$@"; do
sleep 2
done
11 changes: 9 additions & 2 deletions teuthology/task/install/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
log = logging.getLogger(__name__)


TEUTHOLOGY_BIN_UTILITIES = [
'daemon-helper',
'adjust-ulimits',
'stdin-killer',
'daemon-rebooter',
]


def _get_builder_project(ctx, remote, config):
return packaging.get_builder_project()(
config.get('project', 'ceph'),
Expand Down Expand Up @@ -81,9 +89,8 @@ def _ship_utilities(ctx):
except IOError as e:
log.info('Cannot ship supression file for valgrind: %s...', e.strerror)

FILES = ['daemon-helper', 'adjust-ulimits', 'stdin-killer']
destdir = '/usr/bin'
for filename in FILES:
for filename in TEUTHOLOGY_BIN_UTILITIES:
log.info('Shipping %r...', filename)
src = os.path.join(os.path.dirname(__file__), 'bin', filename)
dst = os.path.join(destdir, filename)
Expand Down

0 comments on commit 6843a8e

Please sign in to comment.