From d1b97aff42614fee269e03fcb85f4f9aac86619f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Thu, 8 Jul 2021 21:31:04 +0200 Subject: [PATCH] jenkins/systemd-run-wrap.sh: randomize unit name suffix The timestamp alone was not enough to prevent unit name clashes. Add a random suffix to greater reduce the chance of hitting a clash. --- jenkins/systemd-run-wrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/systemd-run-wrap.sh b/jenkins/systemd-run-wrap.sh index bd8c16532e..392dde7fec 100755 --- a/jenkins/systemd-run-wrap.sh +++ b/jenkins/systemd-run-wrap.sh @@ -15,7 +15,7 @@ for VARNAME in $(sh -c 'compgen -v'); do ARGS+=("--setenv" "${VARNAME}=${VAL}") done -UNITNAME="run-$(date '+%s')" +UNITNAME="run-$(date '+%s')-${RANDOM}" # The --pipe option does not stop the unit when the systemd-run process is killed, we have to do this through a trap # (and --pty as alternative doesn't behave well because it leads to processes expecting stdin when there is none)