From Fedora Project Wiki
(→‎Scope: New plan - patch cronie to use syslog)
Line 34: Line 34:
MTAs are not a necessary daemon on a desktop system, so we need not include one by default.  
MTAs are not a necessary daemon on a desktop system, so we need not include one by default.  


{{package|cronie}} is the only package in a default Fedora install that requests the use of an MTA. If <code>/usr/sbin/sendmail</code> is not present, it will simply stop sending mail. Therefore, if the existing cron jobs are modified so they don't need to send mail, we can remove the requirement for an MTA with no loss of functionality.
<code>cronie</code> is the only package in a default Fedora install that requests the use of an MTA. If <code>/usr/sbin/sendmail</code> is not present, it will simply stop sending mail. Therefore, if we modify <code>cronie</code> to send job output to a log file, we can remove the requirement for an MTA with no loss of functionality.


All cron jobs launched by files in <code>/etc/cron.{hourly,daily,weekly,monthly}</code> are run through the <code>/usr/bin/run-parts</code> script<ref>You can verify this by tracing how the jobs are launched - <code>/etc/cron.d/0hourly</code> runs the jobs in <code>/etc/cron.hourly</code> and <code>/etc/anacrontab</code> launches the daily/weekly/monthly jobs.</ref>. Therefore ''we can fix all these cron jobs by modifying <code>run-parts</code> to send stdout to syslog''.
The <code>cron</code> syslog facility exists for this purpose, and our current <code>cron</code> setup already uses it<ref><code>/usr/bin/run-parts</code> runs all the cron jobs in <code>/etc/cron.{hourly,daily,weekly,monthly}</code> - see <code>/etc/cron.d/0hourly</code> (which runs the jobs in <code>/etc/cron.hourly</code>) and <code>/etc/anacrontab</code> (which launches the daily/weekly/monthly jobs.)</ref> to log ''some'' messages<ref>In fact, our current setup does ''not'' log the output of cron jobs to <code>/var/log/cron</code> - this feature would fix that.</ref> to <code>/var/log/cron</code>.
 
The remaining cron jobs are launched by placing a file in <code>/etc/cron.d/</code>. These cron jobs will have to be examined individually to determine if they need modification to send output to a log file.


Required changes:
Required changes:
# Modify <code>run-parts</code> to send stdout to syslog (<code>/var/log/cron</code>)
# Modify <code>cronie</code> to send job output to the <code>cron</code> syslog facility if <code>sendmail</code> is missing
#* Add something like: <code>| logger -p cron.notice -t "$(basename $i)"</code>
#* Using syslog should be configurable even if <code>sendmail</code> is installed
# Change any <code>/etc/cron.d/</code> cron job that emits output to send its output to syslog or a log file
# Remove <code>Requires: /usr/sbin/sendmail</code> from {{package|cronie}}'s spec file
# Remove <code>Requires: /usr/sbin/sendmail</code> from {{package|cronie}}'s spec file
# Add comments to default/example <code>crontab</code> that sendmail must be installed for mail sending to work


Packages that may require changes:
Packages that may require changes:
* {{package|cronie}} - {{bz|472710}}
* {{package|cronie}} - {{bz|472710}}
* {{package|crontabs}}
* {{package|crontabs}}
* Any package that places files in <code>/etc/cron.d</code> (see <code>repoquery --source -qf '/etc/cron.d/*'</code>)
** {{package|atop}} - <code>/etc/cron.d/atop</code> is redundant, see {{bz|524703}}
** {{package|cacti}}
** {{package|checkdns}}
** {{package|clamav}}
** {{package|denyhosts}}
** {{package|dmraid}}
** {{package|dwatch}}
** {{package|glpi}}
** {{package|glpi-mass-ocs-import}}
** {{package|leafnode}}
** {{package|mailman}}
** {{package|mldonkey}}
** {{package|moodle}}
** {{package|mrepo}}
** {{package|mrtg}}
** {{package|munin}}
** {{package|nssbackup}}
** {{package|olpc-update}}
** {{package|olpc-utils}}
** {{package|ovirt-server}}
** {{package|queuegraph}}
** {{package|rancid}}
** {{package|sagator}}
** {{package|sbackup}}
** {{package|smolt}}
** {{package|spamassassin}}
** {{package|sysstat}}
** {{package|sysusage}}
** {{package|tiger}}
** {{package|vnstat}}


== How To Test ==
== How To Test ==

Revision as of 18:23, 22 September 2009

No MTA

Summary

Don't ship a MTA by default for the desktop.

Owner

  • email: maxamillion [AT] gmail.com

Current status

  • Targeted release: Fedora 13
  • Last updated: 2009-09-21
  • Percentage of completion: 0%

Working:

  • Everything as designed (Aside from messages that would normally be sent via a MTA)

TODO:

  • Write a patch for cronie that will redirect messages that would be sent to a MTA to be logged to syslog in the event a MTA is not present. Once this patch is written, submit it upstream.

Done:

  • Verify there are no packages that will require a patch to function without a MTA --> There are, cronie will need a patch unless we accept that messages will simply be lost.

Detailed Description

The shipping of a default MTA has long been the de facto standard, but for the vast majority of users this is simply wasted resources and wasted disk space for the packages installed. Without an MTA the utilities that would have previously delivered local mail will just simply silently not deliver mail. Instead we can redirect the output to a log and those users who need a MTA are free to install any one they so choose.

Benefit to Fedora

Less used disk space for default install, less used resources, stopping of the MTA madness.

Scope

MTAs are not a necessary daemon on a desktop system, so we need not include one by default.

cronie is the only package in a default Fedora install that requests the use of an MTA. If /usr/sbin/sendmail is not present, it will simply stop sending mail. Therefore, if we modify cronie to send job output to a log file, we can remove the requirement for an MTA with no loss of functionality.

The cron syslog facility exists for this purpose, and our current cron setup already uses it[1] to log some messages[2] to /var/log/cron.

Required changes:

  1. Modify cronie to send job output to the cron syslog facility if sendmail is missing
    • Using syslog should be configurable even if sendmail is installed
  2. Remove Requires: /usr/sbin/sendmail from cronie's spec file
  3. Add comments to default/example crontab that sendmail must be installed for mail sending to work

Packages that may require changes:

How To Test

Uninstall sendmail on your current machine and enjoy the "no warning messages, no crashing, just blissful MTA-free silence" - wwoods

User Experience

Transparent to majority of users, will add a 'yum install <insert-MTA-here>' step to advanced users who have an actual use case for a MTA on their machines.

Dependencies

none

Contingency Plan

Do Nothing.

Documentation

  • None

Release Notes

  • None

References

  1. /usr/bin/run-parts runs all the cron jobs in /etc/cron.{hourly,daily,weekly,monthly} - see /etc/cron.d/0hourly (which runs the jobs in /etc/cron.hourly) and /etc/anacrontab (which launches the daily/weekly/monthly jobs.)
  2. In fact, our current setup does not log the output of cron jobs to /var/log/cron - this feature would fix that.

Comments and Discussion