Re: shell scripting error (qmail related)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2005-09-18 at 21:32 -0600, Gezim Hoxha wrote:
> Hi all,
> 
> I was trying to install qmail ( http://cr.yp.to/qmail.html ), everything
> went fine until I had to run the following script:
> 
> #!/bin/sh
> QMAILDUID=`id −u qmaild`
> NOFILESGID=`id −g qmaild`
> MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
> LOCAL=`head −1 /var/qmail/control/me`
> if [ −z "$QMAILDUID" −o −z "$NOFILESGID" −o −z "$MAXSMTPD" −o −z
> "$LOCAL" ]; then
>     echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
>     echo /var/qmail/supervise/qmail−smtpd/run
>     exit 1
> fi
> if [ ! −f /var/qmail/control/rcpthosts ]; then
>     echo "No /var/qmail/control/rcpthosts!"
>     echo "Refusing to start SMTP listener because it'll create an open
> relay"
>     exit 1
> fi
> exec /usr/local/bin/softlimit −m 2000000 \
>     /usr/local/bin/tcpserver −v −R −l "$LOCAL" −x /etc/tcp.smtp.cdb −c
> "$MAXSMTPD" \
>         −u "$QMAILDUID" −g "$NOFILESGID" 0 smtp /var/qmail/bin/qmail
> −smtpd 2>&1
> 
> Now the errors I'm getting are:
> 
> Try `id --help' for more information.
> Try `id --help' for more information.
> head: cannot open `−1' for reading: No such file or directory
> ./run: line 6: [: too many arguments
> ./run: line 11: [: −f: unary operator expected
> softlimit: fatal: unable to run −m: file does not exist
> 
> I know the first two are invalid because I did try to run "id -u qmaild"
> and returned a number, so does the second command. Same thing applies to
> the "head" command and _no_ there isn't too few arguments in line 6 an
> so on.

Hi Gezim,

How are you running the script? There are environment variables that
affect the separator characters used by the shell - maybe that is the
problem.

You may want to verify the /bin/sh is a symlink to bash.

As you say, the syntax in the script above should be fine (works for me
in FC3).

Cheers, Ben

> 
> Anyway, I'm a little frustrated and I would be grateful if someone help
> me out.
> 
> Thank you,
> -Gezim
> 
> 
> 


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux