3

I have setup Cron Jobs to run inside a Chroot Environment, depending on the User/Group;

I have noticed that these cron jobs, running inside the chroot environment, fail to send any mail.

Log files report that it cannot find a program to send mail.

Where does the Cron process look for the default mail binary? Can you set or configure this path?

and on a side note.. if the MAILTO= variable is not set, how does Cron know where to send mail to? does it just send mail to the user running the job, on the local host?

thanks!

1 Answer 1

5

Where does the Cron process look for the default mail binary?

Unless otherwise specified I'm fairly sure it just uses the mail program it finds in the path (/bin:/usr/bin). You can though specify the -m command line argument for some versions of cron

-m This option allows you to specify a shell command string to use for sending cron mail output instead of sendmail(8). This com- mand must accept a fully formatted mail message (with headers) on stdin and send it as a mail message to the recipients speci- fied in the mail headers.

The above works on CentOS/RHEL, Ubuntu looks different

Can you set or configure this path?

See above.

if the MAILTO= variable is not set...

If MAILTO is not set then as you suspect the mail is delivered to the local user who is running the job.

On CentOS/RHEL you can specify extra command line arguments in /etc/sysconfig/crond so that you dont't have to edit your init scripts. Other OS/distros may provide similar functionality.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.