Rich Shepard wrote:
> On Tue, 24 Mar 2009, Roderick A. Anderson wrote:
> 
>> 1. Does 1pflogsumm do the same as your command line below? (copy and
>> paste from the file to be sure).
> 
> Rod,
> 
>    I just tried to run /etc/cron.daily/1pflogsumm by copying each line to
> another virtual console logged in as root. Each line was excepted until the
> long perl statement. The full statement, followed by the result, follows:
> 
> perl -e 'use Date::Calc;' 2>/dev/null || {
>      sed -e '/# ---Begin:/,/# ---End:/d' < ${EXECUTABLE} >
> ${TMPDIR}/${TMPEXE}
>      chmod u=rx,go= ${TMPDIR}/${TMPEXE} || echo "$0: warning - unable to set
> permissions on ${TMPDIR}/${TMPEXE}"
>      EXECUTABLE=${TMPDIR}/${TMPEXE}
> }
> 
>>> sed -e '/# ---Begin:/,/# ---End:/d' < ${EXECUTABLE} >
> ${TMPDIR}/${TMPEXE}
>>> chmod u=rx,go= ${TMPDIR}/${TMPEXE} || echo "$0: warning - unable to set
> permissions on ${TMPDIR}/${TMPEXE}"
>> EXECUTABLE=${TMPDIR}/${TMPEXE}
>> }
> -bash: ${EXECUTABLE}: ambiguous redirect
> -bash: /: is a directory
> -bash: warning - unable to set permissions on /

Where is TMPDIR and TMPEXE set?  Earlier in the 1pflogsumm script?  If 
they are not set _correctly_, ie. empty then you end up with a '/' 
instead of a /path/to/tmpdir/tmpexe.

Is any part of this setup chroot?


\\||/
Rod
---
> 
>    This suggests to me that the forward slash used to indicate the
> directory/executable file path is seen as the root directory. The line
> assigning values to $EXECUTABLE and $TMPDIR string were accepted by bash:
> 
> EXECUTABLE=/usr/local/bin/pflogsumm
> TMPDIR=/etc/postfix
> 
> and was accepted a few lines further in the script:
> 
> trap "test -r ${TMPDIR}/${TMPEXE} && rm -f ${TMPDIR}/${TMPEXE}" 0 1 2 3 15
> 
>    Does this help to identify what I should do to fix the script so it once
> again runs?
> 
> Thanks,
> 
> Rich
> 
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to