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
... | ... |
@@ -1439,7 +1439,7 @@ function _common_systemd_pitfalls { |
1439 | 1439 |
# do some sanity checks on $cmd to see things we don't expect to work |
1440 | 1440 |
|
1441 | 1441 |
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 |
|
1443 | 1443 |
You are trying to use run_process with sudo, this is not going to work under systemd. |
1444 | 1444 |
|
1445 | 1445 |
If you need to run a service as a user other than $STACK_USER call it with: |
... | ... |
@@ -1450,7 +1450,7 @@ EOF |
1450 | 1450 |
fi |
1451 | 1451 |
|
1452 | 1452 |
if [[ ! "$cmd" =~ ^/ ]]; then |
1453 |
- local msg=<<EOF |
|
1453 |
+ read -r -d '' msg << EOF || true # read returns 1 for EOF, but it is ok here |
|
1454 | 1454 |
The cmd="$cmd" does not start with an absolute path. It will fail to |
1455 | 1455 |
start under systemd. |
1456 | 1456 |
|