Package: postfix
Version: 2.5.5-1.1
Severity: normal

Due to an unfortunate partition layout, my desktop machine has /usr as
a subdir of /srv:

lrwxrwxrwx 1 root root 7 13. Jul 2008  /usr -> srv/usr

Ever since that apt has been nagging me about not being able to
upgrade/configure postfix since it couldn't start it in the postinst.
I finally found time to debug this:

/etc/init.d/postfix:

running() {
    queue=$(postconf -h queue_directory 2>/dev/null || echo /var/spool/postfix)
    if [ -f ${queue}/pid/master.pid ]; then
        pid=$(sed 's/ //g' ${queue}/pid/master.pid)
        # what directory does the executable live in.  stupid prelink systems.
        dir=$(ls -l /proc/$pid/exe 2>/dev/null | sed 's/.* -> //; 
s/\/[^\/]*$//')
        if [ "X$dir" = "X/usr/lib/postfix" ]; then
            echo y
        fi
    fi
}

The problem is that $dir will be /srv/usr/lib/postfix here. I've fixed
it locally by using bash pattern matching instead.

Wouldn't it be enough to check the basename of the directory, the
basename of the executable, or just if there is a process with that pid
running (kill -0) ?

Christoph
-- 
c...@df7cb.de | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to