Wind River Support Network

HomeDefectsLIN5-7124
Fixed

LIN5-7124 : cronie errors when sendmail removed

Created: Nov 12, 2013    Updated: Dec 19, 2017
Resolved Date: Dec 19, 2013
Found In Version: 5.0.1
Fix Version: 5.0.1.11
Severity: Severe
Applicable for: Wind River Linux 5
Component/s: Userspace

Description

By default, cronie uses sendmail to report the results of scheduled jobs. However, this can be changed so that syslog is used by setting the -s option as the man page describes:

     -s     This option will direct Cron to send the job output to the
              system log using syslog(3).  This is useful if your system
              does not have sendmail(8), installed or if mail is disabled.

However, even when using this option errors are seen in the cron.log and syslog files like this:

Nov 12 13:29:27 qemu0 /usr/sbin/crond[4793]: (CRON) INFO (Syslog will be used instead of sendmail.): No such file or directory

and

Nov 12 13:32:01 qemu0 /USR/SBIN/CROND[4804]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory

Steps to Reproduce

The customer has a custom rootfs which does not include sendmail. Since removing packages isn't easy, the quickest way to reproduce this is to use a standard rootfs and just delete the sendmail symlink from the rootfs as follows.

$ configure --enable-board=qemux86-64 --enable-rootfs=glibc_cgl --enable-kernel=cgl \
      --enable-jobs=4 --enable-parallel-pkgbuilds=4 \
      --enable-rm-work=yes --enable-rm-oldimgs=yes \
      --enable-reconfig --with-rcpl-version=0009
$ make
$ make start-target

Log in as root, then:

# vi /etc/sysconfig/crond

to add the -s option, the file should now look like this:

# Settings for the CRON daemon.
# CRONDARGS= :  any extra command-line startup arguments for crond
CRONDARGS=-s

Next:

# rm /usr/sbin/sendmail
# /etc/init.d/crond restart

You can verify that the -s option takes effect using ps:

# ps ax | grep [c]ron
 1112 ?        Ss     0:00 /usr/sbin/crond -s

You can also set up a job to test like this:

# crontab -e

and add an entry like this:

32 * * * * echo "test crontab"

If you look at /var/log/cron.log and/or /var/log/syslog you will find entries similar to the following after the job has been executad:

Nov 12 13:29:27 qemu0 /usr/sbin/crond[4793]: (CRON) STARTUP (1.4.8)
Nov 12 13:29:27 qemu0 /usr/sbin/crond[4793]: (CRON) INFO (Syslog will be used instead of sendmail.): No such file or directory
Nov 12 13:29:27 qemu0 /usr/sbin/crond[4793]: ((null)) Unauthorized SELinux context=system_u:system_r:alsa_t:s0-s15:c0.c1023 file_context=system_u:object_r:nfs_t:s0 (/etc/crontab)
Nov 12 13:29:27 qemu0 /usr/sbin/crond[4793]: ((null)) SELinux in permissive mode, continuing (/etc/crontab)
Nov 12 13:29:27 qemu0 /usr/sbin/crond[4793]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Nov 12 13:30:01 qemu0 crontab[4797]: (root) BEGIN EDIT (root)
Nov 12 13:30:36 qemu0 ntpd_intres[4521]: host name not found: time.server.example.com
Nov 12 13:31:35 qemu0 crontab[4797]: (root) REPLACE (root)
Nov 12 13:31:35 qemu0 crontab[4797]: (root) END EDIT (root)
Nov 12 13:32:01 qemu0 /USR/SBIN/CROND[4803]: (root) CMD (echo "test crontab")
Nov 12 13:32:01 qemu0 /USR/SBIN/CROND[4801]: (root) CMDOUT (test crontab)
Nov 12 13:32:01 qemu0 /USR/SBIN/CROND[4804]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory
Nov 12 13:32:01 qemu0 /USR/SBIN/CROND[4801]: (root) MAIL (mailed 13 bytes of output but got status 0x0001
)

i.e. it looks like it is still trying to use sendmail.

Other Downloads


Live chat
Online