Hi!

Emmanuel CHANTREAU [2005-03-04 22:32 +0100]:
> postgresql-dump get pids using ps but it could fail if the ps output is
> modified by environment variable PS_FORMAT. To correct the problem you
> should replace 
> ps ax 
> by 
> ps ax --format "pid,comm"
> or insert a "unset PS_FORMAT" at the begining of the script.

Thanks for this hint.

> see patch below:
> 
> diff /usr/lib/postgresql/bin/postgresql-dump 
> /usr/lib/postgresql/bin/postgresql-dump~
> 326c326
> <               pm_pid=`ps ax --format "pid,comm"| grep -s postmaster | grep 
> -v grep | awk '{print $1}'`
> ---
> >               pm_pid=`ps ax | grep -s postmaster | grep -v grep | awk 
> > '{print $5}'`
> 390c390
> <               new_pm_pid=`ps ax --format "pid,comm"| grep -s postmaster | 
> grep -v grep | awk '{print $1}'`
> ---
> >               new_pm_pid=`ps ax | grep -s postmaster | grep -v grep | awk 
> > '{print $5}'`
> r

Hmm, this is already clumsy enough. I think I will rather replace all
of these calls by proper "pidof" commands, which is much cleaner and
more efficient.

Martin

-- 
Martin Pitt                       http://www.piware.de
Ubuntu Developer            http://www.ubuntulinux.org
Debian GNU/Linux Developer       http://www.debian.org

Attachment: signature.asc
Description: Digital signature

Reply via email to