Name of main process differs between servers (postmaster vs postgres)

Started by Jonathan Lemigover 7 years ago4 messages
#1Jonathan Lemig
jtlemig@gmail.com

Hi,

I noticed on two of my postgres servers, one has "postmaster" for the main
process, and the other has "postgres". My question is - why is this? For
example:

Server1:
postgres 909 1 0 May08 ? 00:03:55
/usr/pgsql-9.6/bin/postmaster -D /var/lib/pgsql/9.6/data/

Server2:
postgres 4804 1 0 May01 ? 00:05:08 /usr/pgsql-9.6/bin/postgres
-D /var/lib/pgsql/9.6/data

Both servers are running CentOS Linux release 7.4.1708 for the OS
and PostgreSQL 9.6.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5
20150623 (Red Hat 4.8.5-16), 64-bit.

The only differences I've been able to find so far are:

1) When doing a ps, server1 shows a trailing slash for the $PGDATA
directory whereas server2 doesn't have the trailing slash. I echoed $PGDATA
on both servers and they're both the same (no trailing slash).

2) Server2 has an additional package installed
-- postgresql96-contrib-9.6.8-1PGDG.rhel7.x86_64. Aside from that, both
servers have the same packages installed:

postgresql96-9.6.8-1PGDG.rhel7.x86_64
postgresql96-server-9.6.8-1PGDG.rhel7.x86_64
postgresql96-libs-9.6.8-1PGDG.rhel7.x86_64
postgresql96-pglogical-2.2.0-1.el7.x86_64

Looking at the documentation, it seems that postmaster is a deprecated
alias for the postgres process so while they differ in name, they're the
same in spirit?

From what I can tell, things are running fine on both servers, I guess I
just don't like there is a difference/inconsistency. Can anyone please
explain this?

Thanks!

Jon

#2Justin Pryzby
pryzby@telsasoft.com
In reply to: Jonathan Lemig (#1)
Re: Name of main process differs between servers (postmaster vs postgres)

On Tue, Jun 26, 2018 at 04:51:32PM -0500, Jonathan Lemig wrote:

Hi,

I noticed on two of my postgres servers, one has "postmaster" for the main
process, and the other has "postgres". My question is - why is this? For
example:

On my centos6 servers:

151814 0 lrwxrwxrwx 1 root root 8 May 10 21:32 /usr/pgsql-10/bin/postmaster -> postgres

Do you have something else ?

Is there a symlink for pg_ctl or postmaster or postgres in /s?bin, /usr/s?bin,
or /usr/local/s?bin ?

Was one started by initscript and one started by something else (manually
running pg_ctl or similar) ?

Are the initscripts the same?

Did one of them start at boot and one restarted since then ?

You might get a hint by comparing /proc/909/environ with /proc/4804/environ
(the relative pids suggests that 4804 was perhaps re/started significantly
after boot). And or proc/pid/comm, exe and stat.

Did one of them crash since it was started (or killed by OOM) ?

Justin

PS, I think the list residents would for the future to ask to keep admin/DBA
oriented questions on pgsql-general, and development/bugs on -hackers.

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Jonathan Lemig (#1)
Re: Name of main process differs between servers (postmaster vs postgres)

On Tue, Jun 26, 2018 at 2:51 PM, Jonathan Lemig <jtlemig@gmail.com> wrote:

From what I can tell, things are running fine on both servers, I guess I
just don't like there is a difference/inconsistency. Can anyone please
explain this?

​Best guess, one of the servers has upgrades from previous versions applied
to it while the other started with a newer release. The upgraded server
didn't mess with a pre-existing launch script that was using postmaster
while the new one made use of the likely newer script that calls postgres.

Dave

#4Jonathan Lemig
jtlemig@gmail.com
In reply to: David G. Johnston (#3)
Re: Name of main process differs between servers (postmaster vs postgres)

​Best guess, one of the servers has upgrades from previous versions
applied to it while the other started with a newer release. The upgraded
server didn't mess with a pre-existing launch script that was using
postmaster while the new one made use of the likely newer script that calls
postgres.

I bet it does have something to do with that. I had to migrate one of our
Postgres server from Fedora Core 24/Postgres 9.5 to CentOS 7/Postgres 9.6.
I'm new to Postgres and was playing around with different methods and
settled on using pglogical. I refined (that's being generous) the
migration process and migrated DEV and then PROD. Perhaps I should have had
our SA re-do the VMs after the refinements, but before doing the final
migrations, to make sure everything was apples-to-apples.

Thanks!

Jon

On Tue, Jun 26, 2018 at 5:04 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

Show quoted text

On Tue, Jun 26, 2018 at 2:51 PM, Jonathan Lemig <jtlemig@gmail.com> wrote:

From what I can tell, things are running fine on both servers, I guess I
just don't like there is a difference/inconsistency. Can anyone please
explain this?

​Best guess, one of the servers has upgrades from previous versions
applied to it while the other started with a newer release. The upgraded
server didn't mess with a pre-existing launch script that was using
postmaster while the new one made use of the likely newer script that calls
postgres.

Dave