Обсуждение: [ADMIN] change pid/gid

Поиск
Список
Период
Сортировка

[ADMIN] change pid/gid

От
Ray Stell
Дата:

Due to some external, sysadmin issues, I'm forced to change the pid/gid of the postresql user on CentOS6.  I'm wondering if this plan of action has any flaws.  It seemed to work in a test environment to shutdown and change the pid/gid via:


    find / -uid 1500 -exec chown -h 2500:2500 {} \;        (as root, of course)


Startup went ok, but I've not done this in production and find myself a little nervous.  I'll test in a hotstandby config here in a moment.  Any gotchas hiding in there? 

BTW, -h will change symlinks, which I found handy.
    -h, --no-dereference
              affect each symbolic link instead of any referenced file (useful only on systems that can change the ownership of a symlink)

Re: [ADMIN] change pid/gid

От
Tom Lane
Дата:
Ray Stell <stellr@vt.edu> writes:
> Due to some external, sysadmin issues, I'm forced to change the pid/gid
> of the postresql user on CentOS6.  I'm wondering if this plan of action
> has any flaws.

Changing file ownership should be sufficient as far as PG itself is
concerned, but if you have SELinux enabled (which you should) I'm
not certain how this will affect its rules.  I think that the answer
is "it doesn't", or at worst that you'd need to reboot after changing
the /etc/passwd mapping, but it's something to keep a side eye on.

            regards, tom lane


Re: [ADMIN] change pid/gid

От
hubert depesz lubaczewski
Дата:
On Fri, Dec 09, 2016 at 10:21:43AM -0500, Ray Stell wrote:
> Due to some external, sysadmin issues, I'm forced to change the pid/gid of
> the postresql user on CentOS6.  I'm wondering if this plan of action has any
> flaws.  It seemed to work in a test environment to shutdown and change the
> pid/gid via:
>
>
>     find / -uid 1500 -exec chown -h 2500:2500 {} \; (as root, of course)
> Startup went ok, but I've not done this in production and find myself a
> little nervous.  I'll test in a hotstandby config here in a moment.  Any
> gotchas hiding in there?

no real gotchas, but change \; to + so that it will be MUCH faster.

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/