Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9907 - sendmail init script broken; also, sendmail won't run from prompt
Summary: sendmail init script broken; also, sendmail won't run from prompt
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Nick Hadaway
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-29 12:22 UTC by Whit Blauvelt
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Whit Blauvelt 2002-10-29 12:22:44 UTC
After starting sendmail from the init.d script once (with the pid complaint then
too) it will not restart because for some reason it believe it is already
running, even though it is not:

whit /etc/init.d # ./sendmail stop
 * Stopping sendmail...
sed: can't read /var/run/sendmail.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l
[sigspe  [ !! ]

whit /etc/init.d # ./sendmail start
 * WARNING:  "sendmail" has already been started.

whit /etc/init.d # ps x | grep sendmail
14130 pts/3    S      0:00 grep sendmail

- so: no sendmail running, no pid where the script expects it, but the script
falsely deduces that sendmail is already running.

Oh, and when I try any command line invocation of sendmail I get:

whit ~ # sendmail
can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

What is that error from? I'm doing this as root. Should sendmail have been
installed suid root? If so, that's another bug.
Comment 1 Grant Goodyear (RETIRED) gentoo-dev 2002-10-30 18:19:03 UTC
Raker, 
  Can you take care of this?  I'm afraid that I won't be able to get to it
until next week.
Comment 2 Nick Hadaway 2002-10-30 20:07:27 UTC
If you have a problem starting sendmail or for some reason it gets an error...
and doesn't start... but the init script system thinks it is running...
You can type "zap sendmail" and that will reset status of the init script so you
can at that time do "/etc/init.d/sendmail start" to start sendmail.

Please check your system log for the error message on starting sendmail.

If you are still having problems, please post a copy of the log which shows
error messages given by sendmail when you run the /etc/init.d script.
Comment 3 Whit Blauvelt 2002-10-30 20:50:13 UTC
Oct 29 12:32:15 whit sendmail[13992]: alias database /etc/mail/aliases rebuilt
by root
Oct 29 12:32:15 whit sendmail[13992]: /etc/mail/aliases: 21 aliases, longest 10
bytes, 221 bytes total
Oct 29 12:32:16 whit sendmail[13994]: starting daemon (8.12.6):
SMTP+queueing@00:30:00
Oct 29 12:32:40 whit sendmail[14001]: NOQUEUE: SYSERR(root): can not
chdir(/var/spool/clientmqueue/): Permission denied

- that's on a fresh attempt to start - also shows same error if sendmail invoked
from command line
Comment 4 Whit Blauvelt 2002-10-30 21:05:23 UTC
Just for comparison, here's the perms on the Gentoo installation:

drwxrwx---    2 root     root           72 Oct 29 12:10 clientmqueue/
drwx------    2 root     root           72 Oct 29 12:10 mqueue/

Here's the perms on a working Debian installation (on the same box):

drwxr-x---    2 root     mail          113 Oct 30 21:58 mqueue/

Should Gentoo be setting the group ownership to "mail"? Also, what's with the
clientmqueue vs the mqueue? If even e-mail from root goes to the clientmqueue,
does the mqueue even have a Gentoo use?

Comment 5 Grant Goodyear (RETIRED) gentoo-dev 2002-11-01 13:33:43 UTC
Unexpectedly gone for at least a week; returning to bug-wranglers
Comment 6 Whit Blauvelt 2002-11-04 10:13:29 UTC
Changing the group ownership of /var/spool/clientmqueue to smmsp ends the 

can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

error but still produces an error from mutt on trying to send a test message,
but does not produce an error message in the logs (although it also doesn't show
the message as being sent). The "smmsp" ownership is some new security dohingus
- for people who didn't bother to build sendmail to run as "mail"?

BTW, sendmail is logging to mail.info and mail.log - both identically - and also
logging to syslog - identically again. It should really only be going to
mail.log, imho.
Comment 7 Whit Blauvelt 2002-11-04 10:25:46 UTC
See http://ls.berkeley.edu/mail/magnet/0289.html (I'm still working through this ;)
Comment 8 Whit Blauvelt 2002-11-04 11:11:07 UTC
Sendmail still won't start up okay - even after group ownership changes. Doing
an /etc/init.d/sendmail zap allows it to be /etc/init.d/sendmail start'ed - but
then a ps x doesn't show it as running despite the start script producing and
"OK" messsage. Testing sendmail at the prompt gives a segfault both for Gentoo's
version of the binary and for a version built from a fresh tar:

# sendmail whit
test 
.
Segmentation fault

The box has the Gentoo Linux.2.4.19-gentoo-r9 kernel - is the segfault related
to some option there, or to the gcc version??
Comment 9 Nick Hadaway 2002-11-04 12:13:19 UTC
fowners root.smmsp /var/spool/clientmqueue
fperms 770 /var/spool/clientmqueue

The ebuild does create and set ownership to the /var/spool/clientmqueue...

When set as mentioned above, do you still get problems?
If so can you paste log information trying to start sendmail making sure that 
the clientmqueue directory has the above permissions set?
Comment 10 Whit Blauvelt 2002-11-04 13:49:46 UTC
/var/spool # ls -l      
total 4
drwxrwx---    2 root     smmsp        1032 Nov  4 14:44 clientmqueue

- this is after changing the group manually - the ebuild did _not_ accomplish
this, it had it as root.root.

# /etc/init.d/sendmail start
 * Starting sendmail...                                                        
                    [ ok ]

BUT

# ps x | grep sendmail
 8358 pts/1    S      0:00 grep sendmail

DESPITE

Nov  4 14:45:52 whit sendmail[8353]: alias database /etc/mail/aliases rebuilt by
root
Nov  4 14:45:52 whit sendmail[8353]: /etc/mail/aliases: 21 aliases, longest 10
bytes, 221 bytes total
Nov  4 14:45:52 whit sendmail[8355]: starting daemon (8.12.6):
SMTP+queueing@00:30:00

Which _may_ be related to the segfault when trying to run sendmail from the
command line to send a test message:

# sendmail whit
test
.
Segmentation fault
Comment 11 Nick Hadaway 2002-11-05 22:57:54 UTC
can you paste the results of 

ldd /usr/sbin/sendmail

here?
Maybe a library got uninstalled which sendmail linked to?
Comment 12 Whit Blauvelt 2002-11-05 23:09:01 UTC
Here's the paste - but I unmerged sendmail and the current /usr/sbin/sendmail is
actually a compilation from the tar distribution - which also segfaults. Maybe a
library is just not compatible with sendmail?? Haven't uninstalled any that I'm
aware of (and I'd be aware of that, right?).

# ldd /usr/sbin/sendmail
        libdb-3.2.so => /usr/lib/libdb-3.2.so (0x40022000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x400c0000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x400d2000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x400ff000)
        libdl.so.2 => /lib/libdl.so.2 (0x40114000)
        libc.so.6 => /lib/libc.so.6 (0x40117000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
Comment 13 Nick Hadaway 2002-11-25 17:13:53 UTC
if you do a -v when running sendmail *for verbose* do the log messages say 
anything else that might help in solving this... I don't have any troubles with 
sendmail and there are many users running the same package as well...
Comment 14 Whit Blauvelt 2002-11-26 10:35:29 UTC
I think the whole problem had to do with the segfaulting, and I was getting the
segfaulting whether using Gentoo's sendmail build or building it from tar
myself, so it appears to be related to something in the libraries. Since I
wasn't getting anywhere with that, I installed qmail. If there is some
suggestion of what might get sendmail not to segfault I can try that. This
system began with the stage three Pentium ebuild (whichever it was for Pentium
Pro) with regular emerge -u world's since, so the libraries should be standard
as far as this goes - nothing experimental or custom there.
Comment 15 Nick Hadaway 2003-01-19 19:55:35 UTC
There are many working sendmail installations out there currently and permissions are set as suggested by the current SIAOG.  I'm glad you got a working qmail setup. :)