[blfs-dev] libexec's first victim ? (postfix bootscript)

2012-05-01 Thread Ken Moffat
 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 ?  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.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Re: [blfs-dev] libexec's first victim ? (postfix bootscript)

2012-05-01 Thread Armin K.
On 05/01/2012 06:52 PM, Ken Moffat 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 ?  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.
>
> ĸen

Use daemon_directory=/usr/lib/postfix in install command line if 
necesary. I am avoiding libexec as much as possible for now, and that 
one worked for me.
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Re: [blfs-dev] libexec's first victim ? (postfix bootscript)

2012-05-01 Thread Andrew Benton
On Tue, 01 May 2012 17:52:03 +0100
Ken Moffat  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


Re: [blfs-dev] libexec's first victim ? (postfix bootscript)

2012-05-01 Thread Bruce Dubbs
Andrew Benton wrote:
> On Tue, 01 May 2012 17:52:03 +0100
> Ken Moffat  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 agree with this.

> 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:

No, 'if [ some-logical-test ]; then stmt; fi' is valid bourne shell syntax.
What is different is that the test can't be x == y, it must be a single = sign.

For the standard [ should be /bin/[, but we have it as /usr/bin/[

> 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.

True. But we use /bin/sh.  We should try to maintain that.

   -- Bruce

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