r9574 - in trunk/BOOK: . bootscripts bootscripts/lfs/init.d bootscripts/lfs/sysconfig/network-devices bootscripts/lfs/sysconfig/network-devices/services chapter01 chapter06 chapter07 prologue

Matthew Burgess matthew at linuxfromscratch.org
Tue Aug 2 13:09:07 PDT 2011


On 02/08/2011 03:15, bdubbs at linuxfromscratch.org wrote:
> Author: bdubbs
> Date: 2011-08-01 20:15:42 -0600 (Mon, 01 Aug 2011)
> New Revision: 9574

<snip>

> Modified: trunk/BOOK/bootscripts/lfs/init.d/sysklogd

This hunk...

>   case "${1}" in
> -	start)
> -		boot_mesg "Starting system log daemon..."
> -		loadproc syslogd -m 0
> +   start)
> +      boot_mesg "Starting system log daemon..."
> +      PARMS=${SYSKLOGD_PARMS=-'-m 0'}
> +      loadproc syslogd $PARMS

...appears to cause a failure for me:

syslogd: invalid option -- '-'

I think what you're trying to do here (but have possibly made a typo of 
'=' instead of ':') is:

1) Set PARMS = $SYSKLOGD_PARMS, if that variable exists, regardless of 
whether it is null.
2) Set PARMS to '-m 0' if $SYSKLOGD_PARMS is not set at all

Looking at bash(1) under 'Parameter Expansion' I can't see an operator 
that does that.  At the moment, I can't see a way of doing that 
assignment without using an 'if...else' construct.  Something like the 
following:

if [ -n "${SYSKLOGD_PARMS+x}" ]; then
   PARMS="-m 0";
else
   PARMS="${SYSKLOGD_PARMS}"
fi

Regards,

Matt.



More information about the lfs-book mailing list