Solved

What is this line of code doing?

Posted on 2004-08-31
1
510 Views
Last Modified: 2008-03-06
Can anyone please explain me what this line of code is doing:

1) daemon /usr/sbin/sendmail $([ "x$DAEMON" = xyes ] && echo -bd) $([ -n "$QUEUE" ] && echo -q$QUEUE) $SENDMAIL_OPTARG

2) daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac -q $SMQUEUE $SENDMAIL_OPTARG

These lines of code I have taken from sendmail script of Fedora Core, they seem to be too complex for me. Please explain as details as possible ;).

Thx a lot,
0
Comment
Question by:jetli
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 500 total points
ID: 11946355
The short answer is that they startup the MTA & MSP instance of sendmail. In both cases the actual launch of the sendmail binary is done by the daemon function from /etc/rc.d/init.d/functions. Its a "smart" function that tries to start the utility safely.

In the first line daemon will execute /usr/sbin/sendmail and build the argument list from the the variables:

If DAEMON=yes in /etc/sysconfig/sendmail -bd will be in the argument list from $([ "x$DAEMON" = xyes ] && echo -bd).

If QUEUE=?? in /etc/sysconfig/sendmail the value (??) will be used for the queue interval (e.g., -q1h) from $([ -n "$QUEUE" ] && echo -q$QUEUE)

And finally if there are any optional arguments (SENDMAIL_OPTARG) defined in /etc/sysconfig/network they'll be included.

The defaults of a RedHat/Fedora system would result in the following command line for starting Sendmail:

/usr/sbin/sendmail -bd -q 1h

In the second line the MSP instance is started in a similar manner. SMQUEUE will be set to the value of QUEUE (from /etc/sysconfig/sendmail) if it isn't otherwise defined. So the command looks like:

/usr/sbin/sendmail -L sm-msp-queue -Ac -q 1h
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now