"Len Budney" <[EMAIL PROTECTED]> wrote:

>Dave Kitabjian <[EMAIL PROTECTED]> wrote:
>
>> ...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

Yes, but there's no need to pass QMAILUID and NOFILESGID to softlimit, 
tcpserver, or qmail-smtpd. They're only needed by the shell that does
the exec, and it expands them before doing the exec.

-Dave

Reply via email to