Re: pidof not working for postgresql-8.3 ?

From: Ennio-Sr <nasr(dot)laili(at)tin(dot)it>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: pidof not working for postgresql-8.3 ?
Date: 2008-03-01 00:43:47
Message-ID: 20080301004347.GA6970@deby.ei.hnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

* Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> [280208, 23:24]:
> Ennio-Sr <nasr(dot)laili(at)tin(dot)it> writes:
> > Besides that I just found out that 'pidof' doen't seem to work for the
> > ordinary user, as far as postgresql is concerned, whereas it works
> > regularly for other processes:
> [...]
> > Is this a normal behaviour for the new pg_8.3?
>
> I am not familiar with pidof (doesn't exist on any of my boxen)
> but maybe it is looking at real executable names rather than
> symlinks? Try looking for "postgres" instead of "postmaster".
>
> regards, tom lane

Hmm... I'm unlucky you don't use pidof. It's part of the Debian/PowerPC
GNU/Linux 'sysvinit-utils' package and I've been using it since I
learned the essentials of postgres. I call that command in a script just
to make sure postgresql is running before starting some other scripts
which use pg. And it still works nicely on my desktop PC (using PG_7.4).

Back to my iBook and PG_8.3 the results I get are quite intriguing (here
are a few examples, but full results are available on request):

user$ pidof /usr/lib/postgresql/8.3/bin/postgres
2524 2523 2522 2521 2518

user$ pidof /usr/lib/postgresql/8.3/bin/postmaster
[nihil]

but, doing the same as root, the result is positive for both (postgres
and postmaster)

On the other hand, this is what happens on my desktop PC, running pg_7.4
under Debian/Etch:

user$ pidof /usr/lib/postgresql/bin/postmaster
5652 5651

user$ pidof /usr/lib/postgresql/bin/postgres # same as root
[nihil]

user$ pidof /usr/lib/postgresql/7,4/bin/postmaster
5652 5651 =

user$ pidof /usr/lib/postgresql/7.4/bin/postmaster # same as root
5652 5651 5648

user$ pidof /usr/lib/postgresql/7.4/bin/postgres # positive if root
[nihil]

-------

Perhaps it depends on the sysvinit-utils version being used with the
desktop (2.86.ds1-38) and iBook (2.86.ds1-53), which I couldn't check as
the downgrading threathened to remove some essential packages and I
didn't feel like running any risk at the moment; but I would
be grateful if anybody familiar with pidof could confirm.

Anyway, thank you Tom, for your time and could you suggest a different
command (to be put in a script) aiming at the same goal?

Regards,
Ennio

--
[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo. \\?//
Fa' qualche cosa di cui non sei capace!" (diceva Henry Miller) ] (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that. )=(
Do something you aren't good at!" (as Henry Miller used to say) ]

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ennio-Sr 2008-03-02 18:38:36 Re: pidof not working for postgresql-8.3 ?
Previous Message Rodrigo E. De León Plicet 2008-02-29 19:57:44 Re: Check existence of combination in an M.N relation