Fix ps detection
This commit is contained in:
parent
9d251c1bbc
commit
ddd118e3bb
2 changed files with 13 additions and 3 deletions
12
tests.sh
12
tests.sh
|
|
@ -90,9 +90,19 @@ require_supported_ci_os() {
|
|||
}
|
||||
|
||||
|
||||
pid1_comm() {
|
||||
if [[ -r /proc/1/comm ]]; then
|
||||
tr -d '[:space:]' </proc/1/comm || true
|
||||
return
|
||||
fi
|
||||
if command -v ps >/dev/null 2>&1; then
|
||||
ps -p 1 -o comm= 2>/dev/null | tr -d '[:space:]' || true
|
||||
fi
|
||||
}
|
||||
|
||||
configure_ansible_playbook_extra_args() {
|
||||
local pid1
|
||||
pid1="$(ps -p 1 -o comm= 2>/dev/null | tr -d '[:space:]' || true)"
|
||||
pid1="$(pid1_comm)"
|
||||
|
||||
ANSIBLE_PLAYBOOK_EXTRA_ARGS=()
|
||||
if [[ "${pid1}" != "systemd" ]]; then
|
||||
|
|
|
|||
Reference in a new issue