Dave Kitabjian <[EMAIL PROTECTED]> wrote:
>
> What about removing the "exec" completely? I don't see why exec is
> necessary...

It's necessary to save one process. Otherwise, the script itself
continues running, doing nothing except waiting for the tcpserver
process to exit.

(Decent sysadmin types make a hobby out of conserving process-table
slots. It's a good hobby. The first step along the way is to make your
shell scripts ``exec'' their final command. I'd go so far as to say
that that's a good definition of a ``wrapper script''.)

> ...and I don't know if your script variables will be passed
> into the new process created by the exec.

They won't, in the script below. You must export the shell variables
into the environment, or they won't be inherited by exec-ed processes.
Like so:

> > #!/bin/sh
> > QMAILUID=`id -u qmaild`
> > NOFILESGID=`id -g qmaild`

export QMAILUID NOFILESGID

> > exec /usr/local/bin/softlimit -m 2000000 \
> >   /usr/local/bin/tcpserver -v -p -x /etc/tcprules.d/smtpd.cdb \
> >   -u $QMAILUID -g $NOFILESGID geceventures.com 25 \
> >   /var/qmail/bin/qmail-smtpd 2>&1

Len.

--
Frugal Tip #38:
Don't buy mustache wax. It's much cheaper to let the handlebars droop.

Reply via email to