install: Set explicit value for PATH.

In Debian, becoming root as `su` does not alter the `$PATH`; this can
lead to the root user not having `/usr/sbin` in its path, and thus
the `useradd zulip` step of the installer fails.

Fixes #17441.
This commit is contained in:
Alex Vandiver 2021-04-30 13:54:05 -07:00 committed by Tim Abbott
parent a74b52db22
commit 49144247dd
1 changed files with 4 additions and 0 deletions

View File

@ -173,6 +173,10 @@ export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
# Force a known path; this fixes problems on Debian where `su` from
# non-root may not adjust `$PATH` to root's.
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Check for a supported OS release.
if [ -f /etc/os-release ]; then
os_info="$(