Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sendmail runs every hour: NOT installed, NOT CRONed, WTF?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
MBMarduk
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jan 2003
Posts: 80
Location: NL

PostPosted: Tue Sep 30, 2003 12:41 pm    Post subject: Sendmail runs every hour: NOT installed, NOT CRONed, WTF? Reply with quote

I got this freakish error happening every hour or so I think.
I spend most of my time in X so every now and then when I CTRL+ALT+F1 into a console I see my screen full of the message:
Quote:
sendmail: Cannot open mail:25

Sometimes I actually NOTICE it's running 'cuz my mouse pointer starts hiccupping all over the screen.
I then run a 'ps aux' just to see among other things a "/bin/sh" running
"/usr/sbin/sendmail"

Thing is: I've never installed Sendmail
A quick 'emerge -S mail' shows that only mailbase and fetchmail are installed.

Another 'grep -r 'sendmail' /var/log/portage' shows this:
Quote:

root@blackheart Stuff # grep -r 'sendmail' /var/log/portage/
/var/log/portage/1330-fetchmail-6.2.3.log:checking for sendmail... /usr/sbin/sendmail
/var/log/portage/1332-fetchmail-6.2.3.log:checking for sendmail... /usr/sbin/sendmail

(Yeah I emerged it twice, dumbo.)
So basically that /usr/sbin/sendmail was there beforehand and I've no idea where from.
Oh yeah 'grep -r 'sendmail' /etc' returns NOTHING!

But the weirdest thing is that I only have 3 cronscripts:
Quote:

root@blackheart Stuff # ls -las /etc/cron.hourly/
total 12
4 drwxr-xr-x 2 root root 4096 Sep 20 05:54 .
4 drwxr-xr-x 57 root root 4096 Sep 29 15:41 ..
0 -rw-r--r-- 1 root root 0 Sep 16 19:33 .keep
4 -rwxr-xr-x 1 root root 22 Sep 19 05:17 portage_sync
root@blackheart Stuff # ls -las /etc/cron.daily/
total 16
4 drwxr-xr-x 2 root root 4096 Sep 20 05:54 .
4 drwxr-xr-x 57 root root 4096 Sep 29 15:41 ..
0 -rw-r--r-- 1 root root 0 Sep 16 19:33 .keep
4 -rwxr-xr-x 1 root root 155 Jul 28 03:39 makewhatis.cron
4 -rwxr-xr-x 1 root root 142 Jul 28 04:09 slocate

...and no fetchmail either, even 'ps aux' shows no fetchmail (which you'd THINK calls sendmail)

Anyone have an idea how to find out what's summoning sendmail every time???
Back to top
View user's profile Send private message
Unlucky_Alf
Tux's lil' helper
Tux's lil' helper


Joined: 02 Feb 2003
Posts: 92

PostPosted: Tue Sep 30, 2003 5:54 pm    Post subject: Reply with quote

I've seen that too, but I don't know how often it happens. Could you post output of
Code:
lsattr /etc/shadow
Back to top
View user's profile Send private message
MBMarduk
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jan 2003
Posts: 80
Location: NL

PostPosted: Tue Sep 30, 2003 5:57 pm    Post subject: Reply with quote

Sure,
Quote:
root@blackheart Stuff # lsattr /etc/shadow
------------- /etc/shadow
Back to top
View user's profile Send private message
funkmankey
Guru
Guru


Joined: 06 Mar 2003
Posts: 304
Location: CH

PostPosted: Tue Sep 30, 2003 6:15 pm    Post subject: Reply with quote

some mail programs (e.g. exim) install a sendmail symbolic link, just 'cos there are other old programs out there that expect to find /usr/{lib,sbin}/sendmail.

my guess is that you have ssmtp installed, which also creates a sendmail link...
_________________
I've got the brain, I'm insane, you can't stop the power
Back to top
View user's profile Send private message
Malakin
Veteran
Veteran


Joined: 14 Apr 2002
Posts: 1692
Location: Victoria BC Canada

PostPosted: Tue Sep 30, 2003 6:33 pm    Post subject: Reply with quote

I've had this same problem for a long time and have always ignored it. I just unmerged ssmtp, hoping this will fix it.
Back to top
View user's profile Send private message
zhenlin
Veteran
Veteran


Joined: 09 Nov 2002
Posts: 1361

PostPosted: Wed Oct 01, 2003 7:36 am    Post subject: Reply with quote

Ah, you're mistaken.

Cron attempts to run sendmail everytime for each job it runs (if it outputs to stdout)

Solution is to tell cron to not send mail at all. man 5 crontab.
Back to top
View user's profile Send private message
MBMarduk
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jan 2003
Posts: 80
Location: NL

PostPosted: Wed Oct 01, 2003 9:02 am    Post subject: Reply with quote

Say what? Did you even READ what I posted (about my cronscripts etc.)?
Back to top
View user's profile Send private message
Dinini
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 236

PostPosted: Wed Oct 01, 2003 9:32 am    Post subject: Reply with quote

I DID read what you wrote and what you are replying to. The previous post made perfect sense and might pinpoint the source of your trouble.

Please try and run /etc/cron.hourly/portage_sync from the command line. If you see ANY output then cron would try to send you mail. Cron defaults to sending the owner of the crontab mail if any output occurs unless MAILTO is defined and set as empty (MAILTO="").

To find out what package installed /usr/sbin/sendmail try
Code:
grep -R /var/db/pkg/ -e "/usr/sbin/sendmail"

Ok I'm terrible at grep but that should work.
The files installed by packages are listed in /var/dg/pkg/{package type}/{package name}/CONTENTS

There is undoubtedly a nice utility to give you the same information (I would have hoped it was an emerge parameter) but I haven't managed to find it yet.
Back to top
View user's profile Send private message
funkmankey
Guru
Guru


Joined: 06 Mar 2003
Posts: 304
Location: CH

PostPosted: Wed Oct 01, 2003 2:12 pm    Post subject: Reply with quote

not quite emerge, but close...

Code:
%etcat belongs "/usr/sbin/sendmail"
Searching for /usr/sbin/sendmail in * ...
net-mail/ssmtp-2.48


agreed, zhenlin is exactly right. any cronjob that generates output will result in mail being sent to root by default.
_________________
I've got the brain, I'm insane, you can't stop the power
Back to top
View user's profile Send private message
MBMarduk
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jan 2003
Posts: 80
Location: NL

PostPosted: Wed Oct 01, 2003 2:24 pm    Post subject: Reply with quote

Hi people.
Ok 2 people said zhenlin got it right, but for the life of me his 3 sentences are cryptic as hell (sorry zhen :wink: ) for someone like me who doesn't yet grasp the intricacies of CRON (5).
So basically the problem lays with CRON sending mail by default, right?
I'll look into it, thanx.
Back to top
View user's profile Send private message
funkmankey
Guru
Guru


Joined: 06 Mar 2003
Posts: 304
Location: CH

PostPosted: Wed Oct 01, 2003 3:06 pm    Post subject: Reply with quote

Code:
%man 5 crontab
(then search about mail, e.g.  /MAIL)


or you might find info to be easier to use than man (hmm, I don't really use info a lot, it seems to default to 1...anyone know how to specify 3, 5, etc.?)
_________________
I've got the brain, I'm insane, you can't stop the power
Back to top
View user's profile Send private message
Dinini
Apprentice
Apprentice


Joined: 11 Jun 2003
Posts: 236

PostPosted: Thu Oct 02, 2003 5:09 pm    Post subject: Reply with quote

funkmankey wrote:
%etcat belongs "/usr/sbin/sendmail"

Thank you so much!

funkmankey wrote:
or you might find info to be easier to use than man (hmm, I don't really use info a lot, it seems to default to 1...anyone know how to specify 3, 5, etc.?)

*shudder* I hate info, then again I hate emacs so there's a theme here. :D

Info defaults to the lowest lvl man page available, you get to the other pages using the SEE ALSO listings (which serve as links). Since various man pages aren't accessed as nodes or menu items I don't see a way to directly access them through the command line. [Patiently waiting for someone to prove me wrong.]

If you like X, there's always tkman, yelp (gnome), konquerer (man:commandname) or the KDE Help Center.
Back to top
View user's profile Send private message
funkmankey
Guru
Guru


Joined: 06 Mar 2003
Posts: 304
Location: CH

PostPosted: Thu Oct 02, 2003 6:33 pm    Post subject: Reply with quote

that's funny, I love emacs but I really can't stand info!

yeah, etcat has been the best even back before it became part of gentoolkit. although now we're finally seeing features like
Code:
emerge -pv vcron

which provide similar functionality to
Code:
etcat uses vcron

...but in this example etcat still gives you slightly more info: it will tell you not only what USE flags the package has, but if the package is already installed it will tell you which ones were turned on when it was installed. brilliant...

</derail>

er, so, how's cron treating you these days Marduk?
_________________
I've got the brain, I'm insane, you can't stop the power
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Thu Oct 02, 2003 9:13 pm    Post subject: Reply with quote

Moving to Networking and Security since all mail related issues belongs there.

Moved from OTG.

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum