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

From Devrim Gündüz
Subject Re: Invalid 'runuser' usage
Date
Msg-id e211ce7dc3d168cee6946f5c21f0d892adece19b.camel@gunduz.org
Whole thread Raw
In response to Invalid 'runuser' usage  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-pkg-yum
Hi,

On Mon, 2020-03-02 at 10:30 +0300, Alexander Lakhin wrote:
> 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

I never aimed (and tested) this script to work with non-root user. Good point.
Will fix in next minor release.

Regards,

--
Devrim Gündüz
Open Source Solution Architect, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR

Attachment

pgsql-pkg-yum by date:

Previous
From: Devrim Gündüz
Date:
Subject: Re: pg_partman 4.3
Next
From: Devrim Gündüz
Date:
Subject: Re: PgAdmin4 installation fails for RHEL 7.7