Solved

What is this line of code doing?

Posted on 2004-08-31
1
516 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 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Server is saturating the IP table.. 14 375
what does getent do 3 54
How to use docker to run your java program on a linux box 9 115
Linux: disable vim auto-comment 7 157
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

733 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