From 6843a8e80c1da5f4d507f2637c55c8c6456ed715 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Wed, 10 Apr 2024 13:58:53 -0400 Subject: [PATCH] teuthology/task/install: add daemon-rebooter A simple utility to restart a daemon/task if it returns success. Signed-off-by: Patrick Donnelly --- teuthology/task/install/bin/daemon-rebooter | 5 +++++ teuthology/task/install/util.py | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 teuthology/task/install/bin/daemon-rebooter diff --git a/teuthology/task/install/bin/daemon-rebooter b/teuthology/task/install/bin/daemon-rebooter new file mode 100755 index 000000000..635ccfbbd --- /dev/null +++ b/teuthology/task/install/bin/daemon-rebooter @@ -0,0 +1,5 @@ +#!/bin/sh + +while "$@"; do + sleep 2 +done diff --git a/teuthology/task/install/util.py b/teuthology/task/install/util.py index 46fbde9c9..c6711974b 100644 --- a/teuthology/task/install/util.py +++ b/teuthology/task/install/util.py @@ -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'), @@ -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)