Skip to content

Commit 4e16c3d

Browse files
pasudersdatkoPiotr Bielak
committed
Fix common systemd pitfalls die msg
That change introduces correct way of generating msg for die in common systemd pitfalls. Co-Authored-By: Szymon Datko <szymon.datko@corp.ovh.com> Co-Authored-By: Piotr Bielak <piotr.bielak@corp.ovh.com> Change-Id: I28aebffce6c5561360a9e44c1abc44b709054c30
1 parent 02ca8da commit 4e16c3d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

functions-common

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ function _common_systemd_pitfalls {
14391439
# do some sanity checks on $cmd to see things we don't expect to work
14401440

14411441
if [[ "$cmd" =~ "sudo" ]]; then
1442-
local msg=<<EOF
1442+
read -r -d '' msg << EOF || true # read returns 1 for EOF, but it is ok here
14431443
You are trying to use run_process with sudo, this is not going to work under systemd.
14441444
14451445
If you need to run a service as a user other than $STACK_USER call it with:
@@ -1450,7 +1450,7 @@ EOF
14501450
fi
14511451

14521452
if [[ ! "$cmd" =~ ^/ ]]; then
1453-
local msg=<<EOF
1453+
read -r -d '' msg << EOF || true # read returns 1 for EOF, but it is ok here
14541454
The cmd="$cmd" does not start with an absolute path. It will fail to
14551455
start under systemd.
14561456

0 commit comments

Comments
 (0)