You are not logged in.

#1 2009-02-18 10:11:51

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 99

mysterious cron job...

hi,
i noticed this in my /var/log/crond and can't figure out why its even started.

18-Feb-2009 11:01  FILE /var/spool/cron/root USER root pid 7942 cmd /usr/sbin/run-cron /etc/cron.hourly
18-Feb-2009 11:01  unable to exec /usr/sbin/sendmail -t, user -oem, output to sink null

i didnt install sendmail and in cron.hourly there's just this:

[konni@distance] /etc/cron.hourly$ ls 
update
[konni@distance] /etc/cron.hourly$ cat update 
#!/bin/sh
/usr/bin/pacman -Sy

any ideas?

Last edited by konni (2009-02-18 10:12:24)

Offline

#2 2009-02-18 10:34:54

CuleX
Member
Registered: 2007-09-15
Posts: 107

Re: mysterious cron job...

Maybe you have a hidden file and cron executes that one too?

Offline

#3 2009-02-18 12:15:13

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 99

Re: mysterious cron job...

nope, nothing there.
created a hidden file just to be sure it gets found

[konni@distance] /etc$ find cron.* -type f
cron.daily/updatedb
cron.daily/logrotate
cron.daily/whatis
cron.daily/shadow
cron.hourly/.hiddentest <- testfile
cron.hourly/update

crontab user

*/5   *   * * *    /usr/bin/syncmail

which is just a small script running imapfilter and offlineimap - no sendmail in there. and its executed each five minutes, the error occurs every hour.

/usr/bin/syncmail

imapfilter
offlineimap 2&>/dev/null

crontab root

01 * * * *  /usr/sbin/run-cron /etc/cron.hourly
02 00 * * * /usr/sbin/run-cron /etc/cron.daily
22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly

Offline

#4 2009-02-18 12:17:28

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 99

Re: mysterious cron job...

so the only reason is the pacman -Sy script. but what in there could invoke sendmail??

Offline

#5 2009-02-18 15:07:59

thisperishedmin
Member
Registered: 2008-11-04
Posts: 164

Re: mysterious cron job...

it may be trying to send you logs via email, though i have no idea why it would autocreate a cron job to do that if you never provided any info.

personally, i would be inclined to delete (well...move it to a file just in case...) the cronjob and see if any adverse affects crop up down the line.  I cant imagine it would...

its hourly, so youll find out soon enough either way tongue


EDIT:
DERP....disregard my advice...i misread this and thought you invoked the sendmail inside the pacman -Sy for whatever reason.  not sure how i jumped to that conclusion rereading the thread.

in short, i have no idea why pacman would trigger sendmail (as it runs on the hour, it is throwing the error presumably...)...this is odd to me haha.

Last edited by thisperishedmin (2009-02-18 15:10:41)

Offline

#6 2009-02-18 21:48:24

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: mysterious cron job...

Cron is complaining that there is no sendmail binary to send you the output from the /etc/cron.hourly/update script.

Possible Solutions:
1) Install an MTA (sendmail, postfix, ssmtp etc); or
2) Prevent pacman from generating output:

#!/bin/bash
pacman -Sy > /dev/null

Offline

#7 2009-02-19 16:48:49

konni
Member
From: berlin
Registered: 2008-09-25
Posts: 99

Re: mysterious cron job...

so by default the output of a cron job gets sent to me via mail?

Offline

#8 2009-02-19 17:03:49

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: mysterious cron job...

konni wrote:

so by default the output of a cron job gets sent to me via mail?

This is correct.

cron(8) man-page:

[...]  When executing commands, any output
is mailed to the owner of the crontab (or to the user named in the MAILTO
environment variable in the crontab, if such exists).

Offline

#9 2009-08-25 15:54:03

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: mysterious cron job...

That must be the manpage for vixiecron. The arch package core/dcron doesn't understand the MAILTO environment variable. It just mails any output from a cronjob's stdout and/or stderr to the local user. So you need a smtp agent on your machine, /usr/sbin/sendmail has to link to it, and it has to be capable of handling mail to local users (for example, msmtp cannot handle such mail but esmtp can). If you want to send all cron output to a single email address, perhaps an address@some.other.host instead of a local user, you could look at my package. But if you just want to eliminate the log messages, it's enough to add

> /dev/null 2>&1

to the end of each crontab line which might produce output.

(I realize this is an old thread, and probably already solved to the original poster's satisfaction. I'm just doing a sweep and answering some recent-or-at-least-not-ancient cron-related questions in case someone might find it useful.)

Offline

Board footer

Powered by FluxBB