On Sat, Apr 30, 2011 at 10:08:40PM +0200, Patrick Ben Koetter wrote:

> > So to find which master is which instance you need to look in the master.pid
> > files or in /proc, ... If you do look in /proc, each child process has
> > MAIL_CONFIG in its environment...
> 
> I see, and I don't want to sound ungrateful, but I was looking for something
> simpler.

Is this useful?

  postmulti -ax /bin/sh -c '
    $daemon_directory/master -t || {
      echo ${multi_instance_name:--} $(cat $queue_directory/pid/master.pid)
    }' |
  while read iname pid
  do
    ps -p $(pgrep -P $pid) | sed -e "s/^/$iname /"
  done

For cut/paste the one-line version:

    postmulti -ax /bin/sh -c '$daemon_directory/master -t || { echo 
${multi_instance_name:--} $(cat $queue_directory/pid/master.pid); }' | while 
read iname pid; do ps -p $(pgrep -P $pid) | sed -e "s/^/$iname /"; done

-- 
        Viktor.

Reply via email to