]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
teuthology/task/install: add daemon-rebooter
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 10 Apr 2024 17:58:53 +0000 (13:58 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 10 Apr 2024 18:01:49 +0000 (14:01 -0400)
A simple utility to restart a daemon/task if it returns success.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
teuthology/task/install/bin/daemon-rebooter [new file with mode: 0755]
teuthology/task/install/util.py

diff --git a/teuthology/task/install/bin/daemon-rebooter b/teuthology/task/install/bin/daemon-rebooter
new file mode 100755 (executable)
index 0000000..635ccfb
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+while "$@"; do
+  sleep 2
+done
index 46fbde9c9ce2cd6d96d5b6b573f7f0579c668e5b..c6711974bd14e2cc81c43ef60c81dfc14ef8fd9f 100644 (file)
@@ -9,6 +9,14 @@ from teuthology.orchestra import run
 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)