mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 04:56:58 +02:00
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.
This commit is contained in:
parent
aa27b1d11f
commit
d1b97aff42
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user