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
This commit is contained in:
Paweł Suder 2018-09-26 15:52:13 +02:00
parent 02ca8da102
commit 4e16c3dd5f

View File

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