Invalid 'runuser' usage - Mailing list pgsql-pkg-yum

From Alexander Lakhin
Subject Invalid 'runuser' usage
Date
Msg-id 948ee124-ed8d-8f5f-4022-bceafdb6d6a5@gmail.com
Whole thread Raw
Responses Re: Invalid 'runuser' usage  (Devrim Gündüz <devrim@gunduz.org>)
List pgsql-pkg-yum
Hello,
When trying to perform `setup initdb` on Centos 8 with an user-defined
PATH I get the following error:

[test@localhost ~]$ echo $PATH
/home/test/.local/bin:/home/test/bin:/usr/local/bin:/usr/bin

[test@localhost ~]$ sudo --preserve-env=PATH
/usr/pgsql-12/bin/postgresql-12-setup initdb
Initializing database ... failed, see /var/lib/pgsql/12/initdb.log

[test@localhost ~]$ sudo cat /var/lib/pgsql/12/initdb.log
/usr/pgsql-12/bin/postgresql-12-setup: line 143: runuser: command not found

Shouldn't the runuser be specified with the full path here?:
if [ -x /sbin/runuser ]
then
    SU=runuser

Best regards,
Alexander



pgsql-pkg-yum by date:

Previous
From: Markus Bräunig
Date:
Subject: pg_partman 4.3
Next
From: Rébeli-Szabó Tamás
Date:
Subject: Re: PgAdmin4 installation fails for RHEL 7.7