On Tue, 01 May 2012 17:52:03 +0100
Ken Moffat <[email protected]> wrote:

>  I'm now attempting to debug the problems with my new LFS system.
> One of the minor ones was that the postfix shutdown failed and I got
> a line of 5 red stars to draw it to my attention.  Turns out to be
> because the script kills ${PIDFILE} ${BINFILE} and $BINFILE was
> pointing to the now non-existent /usr/lib/postfix/master.
> 
>  I could just raise a ticket or change the bootscript directly, but
> I'd prefer discussion on whether we should allow old installations
> to continue to work with the current bootscripts.  For the moment
> I've got
> 
> if [ -f /usr/lib/postfix/master ]; then
>     BINFILE=/usr/lib/postfix/master
> else
>     BINFILE=/usr/libexec/postfix/master
> fi
> 
>  which should allow for either version.  But do we want to go for a
> degree of backward compatability, or only let it shut down cleanly
> with the current installation ?

To me, we install the bootscript at the same time as we install the
package so the bootscript should be in sync with the current install
instructions and doesn't need to support whatever used to be on the
page.

I must confess that I use my own custom bootscripts (based loosely on
the old LFS bootscripts).

>   If we do want compatability, is my
> test valid for lesser shells, or have I introduced a bash-ism ?  I
> *think* it's good /bin/sh, but I never use other shells.

I think it's a bashism (I may be wrong). I think the portable way to do
it is to use test:

if test -f /usr/lib/postfix/master
then
    BINFILE=/usr/lib/postfix/master
else
    BINFILE=/usr/libexec/postfix/master
fi

However, if the script has #!/bin/bash at the top it's a bash script so
use bashisms.

Andy
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to