?
Solved

What is this line of code doing?

Posted on 2004-08-31
1
Medium Priority
?
519 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 1500 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 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