[runscript] problem starting sendmail

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
mobidyc
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Mon May 01, 2006 5:40 pm

[runscript] problem starting sendmail

Post by mobidyc »

Hello,

it seems i can't stop/start sendmail through the init.d/sendmail script, i need to start it manually:

Code: Select all

#> ps -ef|grep sendmail|grep -v grep
root     19607     1  0 16:58 ?        00:00:00 sendmail: accepting connections       
smmsp    19610     1  0 16:58 ?        00:00:00 sendmail: Queue runner@00:30:00 for /var/spool/clientmqueue

#> /etc/init.d/sendmail stop
 * Caching service dependencies ...                                                                                                                    [ ok ]
 * Service sendmail stopping
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]                                                           [ !! ]
 * ERROR:  sendmail failed to stop

#> ps -ef|grep sendmail|grep -v grep
smmsp    19610     1  0 16:58 ?        00:00:00 sendmail: Queue runner@00:30:00 for /var/spool/clientmqueue

#> kill 19610
#> ps -ef|grep sendmail|grep -v grep

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

Code: Select all

#> cat /etc/init.d/sendmail 
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-mta/sendmail/files/sendmail,v 1.6 2007/09/26 10:46:26 lcars Exp $

depend() {
        need net
        use logger antivirus
        provide mta
}

start() {
        ebegin "Starting sendmail"
        /usr/bin/newaliases > /dev/null 2>&1
        (cd /var/spool/mqueue; rm -f xf*)
        /usr/sbin/sendmail ${SENDMAIL_OPTS} > /dev/null 2>&1
        /usr/sbin/sendmail ${CLIENTMQUEUE_OPTS} > /dev/null 2>&1
        eend $?
}

stop() {
        ebegin "Stopping sendmail"
        kill ${KILL_OPTS} `head -n 1 /var/run/sendmail.pid`
        kill ${KILL_OPTS} `head -n 1 /var/spool/clientmqueue/sm-client.pid`
        eend $?
}

Code: Select all

#> source /etc/conf.d/sendmail
#> echo ${SENDMAIL_OPTS}     
-bd -q30m -L sm-mta
#> echo ${CLIENTMQUEUE_OPTS}
-Ac -q30m -L sm-cm

#> /usr/sbin/sendmail ${SENDMAIL_OPTS}
#> /usr/sbin/sendmail ${CLIENTMQUEUE_OPTS}

#> ps -ef|grep sendmail|grep -v grep
root     19762     1  0 17:03 ?        00:00:00 sendmail: accepting connections       
smmsp    19765     1  0 17:03 ?        00:00:00 sendmail: Queue runner@00:30:00 for /var/spool/clientmqueue
as you can see, i can manually start sendmail.

i use the stable sendmail and baselayout ebuilds :
sys-apps/baselayout-1.12.9-r2
mail-mta/sendmail-8.14.0

am i the only one with this problem?
(found nothing on bugs.gentoo.org)

--
Regards,
Mobidyc
User avatar
SnEptUne
l33t
l33t
Posts: 656
Joined: Mon Aug 23, 2004 4:13 am

Post by SnEptUne »

Is using sendmail a requirement? Postfix would be much better in term of configurations and easy of use.
"There will be more joy in heaven over the tear-bathed face of a repentant sinner than over the white robes of a hundred just men." (LM, 114)
mobidyc
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Mon May 01, 2006 5:40 pm

Post by mobidyc »

Hello,

why asking me to change my MTA?
is my post seems to be a configuration or easy to use problem?

sendmail have prove its performance/robustness and is definitively not more complicated than postfix!!!, at the moment you have m4 in preprocessor, it's true;)

thanks for your answer SnEptUne but my problem is not through sendmail,
it is through the init script to launch sendmail, created by the gentoo team.

--
Regards,
Cedrick Gaillard
User avatar
SnEptUne
l33t
l33t
Posts: 656
Joined: Mon Aug 23, 2004 4:13 am

Post by SnEptUne »

Postfix is also proven to be robust and easier to use than sendmail. Maybe sendmail has fixed their unorganized configuration and syntax in the pass 4 years?

Unfortunately, I cannot help you with sendmail runscript problem since I don't have sendmail installed. You could however try to run the runscript by hands and see where it fails, such as the following:

Code: Select all

/usr/bin/newaliases
cd /var/spool/mqueue; rm -f xf*
You could also remove the "> /dev/null 2>&1" from run script to see what error is being displayed.

There should also be a pidfile in /var/run/sendmail.pid with the pid of sendmail.

There isn't any thing special about run script beside it is being ran with root priviledge
"There will be more joy in heaven over the tear-bathed face of a repentant sinner than over the white robes of a hundred just men." (LM, 114)
mobidyc
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Mon May 01, 2006 5:40 pm

Post by mobidyc »

Hi SnEptUne,

thanks for yout interest.

actually, it seems i'm the only one with this problem, strange because on this server, all packages are marqued stable and no special programs are installed (and revdep-rebuild is ok).
as you can see in my first post, i've manually ran the run script by hand, without any problem.

i persists an day that the problem is /sbin/runscript, it's not a shell script and i don't want to strace it nor to open a bug (because i'm the only one whit this problem).
maybe a future reboot will solve it.

anyway, i will rewrite the init.d/sendmail launcher for my purpose.

Thanks

--
Mobidyc
User avatar
SnEptUne
l33t
l33t
Posts: 656
Joined: Mon Aug 23, 2004 4:13 am

Post by SnEptUne »

mobidyc wrote:thanks for yout interest.

actually, it seems i'm the only one with this problem, strange because on this server, all packages are marqued stable and no special programs are installed (and revdep-rebuild is ok).
as you can see in my first post, i've manually ran the run script by hand, without any problem.
No problem. But you have only ran sendmail, not newaliases and (rm -f xf*). Who knows where it failed?
"There will be more joy in heaven over the tear-bathed face of a repentant sinner than over the white robes of a hundred just men." (LM, 114)
dreamlx
n00b
n00b
Posts: 1
Joined: Wed Jan 02, 2008 4:46 pm
Contact:

Post by dreamlx »

I just had the same problem. In my case, it occured as the script was not able to stop sendmail once.

Here the steps I did to resolve the problem (everything in /etc/init.d/sendmail):

1. comment out the killproc lines
2. ./sendmail stop
3. uncomment the killproc lines

after these steps, everything worked again normally.

I thinks there must be a better way, but this solved my problem.

Bye,
David
mobidyc
Tux's lil' helper
Tux's lil' helper
Posts: 109
Joined: Mon May 01, 2006 5:40 pm

Post by mobidyc »

thanks dreamlx,

i've re-wrote the init script for my convenience so, i've no more the problem.
this post is not solved because hacking the init script is no a clean way for solve it.

Happy new year

--
Mobidyc
Post Reply