problem with kill script

Started by julienabout 20 years ago3 messagesbugs
Jump to latest
#1julien
julien@nura.no-ip.com

Hello,

I'm posted a short modification of the kill command.

The INSTALL file mention the command "kill `cat
/usr/local/pgsql/data/postmaster.pid`" but the pid file contain the pid
but not only, it also contain data directory and some numbers (memory
usage ?, database characteristic ?)

So when I run the above kill command I get :

pcbu-testiris:/etc/rc6.d# /etc/init.d/postgres stop
Stopping database server: PostgreSQL/etc/init.d/postgres: line 11: kill:
/usr/local/pgsql/data: no such pid
/etc/init.d/postgres: line 11: kill: (5432001) - Aucun processus de ce type
/etc/init.d/postgres: line 11: kill: (9076763) - Aucun processus de ce type
.

So I add a "head -1" to the command :

kill `cat /usr/local/pgsql/data/postmaster.pid | head -1`

Julien

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: julien (#1)
Re: problem with kill script

julien <julien@nura.no-ip.com> writes:

The INSTALL file mention the command "kill `cat
/usr/local/pgsql/data/postmaster.pid`" but the pid file contain the pid
but not only, it also contain data directory and some numbers (memory
usage ?, database characteristic ?)

Hm, I wonder why this documentation isn't recommending "pg_ctl stop"
instead. runtime.sgml gets it right:

<screen>
$ <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput>
</screen>

but the text in installation.sgml seems much older.

regards, tom lane

#3Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#2)
Re: problem with kill script

Tom Lane wrote:

julien <julien@nura.no-ip.com> writes:

The INSTALL file mention the command "kill `cat
/usr/local/pgsql/data/postmaster.pid`" but the pid file contain the pid
but not only, it also contain data directory and some numbers (memory
usage ?, database characteristic ?)

Hm, I wonder why this documentation isn't recommending "pg_ctl stop"
instead. runtime.sgml gets it right:

<screen>
$ <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput>
</screen>

but the text in installation.sgml seems much older.

The kill mention was below an item mentioning pg_ctl. The paragraph was
in there for very old releases of PostgreSQL, pre-7.0. I have removed
it with this patch.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachments:

/bjm/difftext/plainDownload+0-13