LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 11-02-2007, 05:10 AM   #1
icechong
Member
 
Registered: Oct 2006
Posts: 42

Rep: Reputation: 15
qmail smtp hang / stop working a few times everyday


Hi there,

I am having a qmail server with fedora 6 running for few months already. Basically the installation steps are majority follow qmailrocks guides. After few months using the qmail server, i have noticed a problem here.

My SMTP hang a few times a day, each time for about 10-15 minutes. When it hangs, the users are unable to send mail. When i do qmailctl pause and then qmailctl cont, sometime it can bring up the server.

Here is my qmail-smtp/run. can anyone help me on this?

#!/bin/sh
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"; export QMAILQUEUE

QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi
if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
fi
exec /usr/local/bin/softlimit -m 40000000 \
/usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir \
/usr/local/bin/tcpserver -H -P -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
/usr/local/bin/relay-ctrl-check \
/var/qmail/bin/qmail-smtpd etv.com.my \
/home/vpopmail/bin/vchkpw /usr/bin/true 2>&1


thanks.
 
Old 11-02-2007, 05:36 AM   #2
ghostdancer
Member
 
Registered: Apr 2002
Distribution: Slackware
Posts: 266

Rep: Reputation: 30
Since it hanged during run time, this mean, there is some problem with run time (not setup). Can you check the current file for both qmail-smtpd, there maybe some messages for us to get a clue what had happened.?

Last edited by ghostdancer; 11-02-2007 at 05:39 AM.
 
Old 11-04-2007, 09:47 AM   #3
icechong
Member
 
Registered: Oct 2006
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ghostdancer View Post
Since it hanged during run time, this mean, there is some problem with run time (not setup). Can you check the current file for both qmail-smtpd, there maybe some messages for us to get a clue what had happened.?
the current file looks ok, but it stops taking in new log during the hang time, because the smtp not running.

thanks.
 
Old 11-05-2007, 08:41 PM   #4
icechong
Member
 
Registered: Oct 2006
Posts: 42

Original Poster
Rep: Reputation: 15
if i do qmailstat restart, this will bring back the service until the next "hang", in 3-4 hours time.
 
Old 09-30-2011, 01:33 AM   #5
mangesh.dhamale
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Rep: Reputation: Disabled
i am facing the same problem, in every 10 min i need to restart qmail server.
Please suggest.
 
Old 10-01-2011, 08:49 AM   #6
roberto967
Member
 
Registered: Apr 2011
Distribution: Slackware64-current
Posts: 65

Rep: Reputation: 12
Quote:
Originally Posted by icechong View Post
/usr/local/bin/envdir /etc/relay-ctrl /usr/local/bin/relay-ctrl-chdir \
did you try to do a test without pop before smtp?
 
Old 10-01-2011, 02:24 PM   #7
ShanxT
Member
 
Registered: Apr 2007
Location: India
Distribution: Ubuntu 10.04, RHEL/Centos 5.x, Knoppix
Posts: 41

Rep: Reputation: 3
It could be due to lack of memory. To confirm, comment out the 'QMAILQUEUE' line in the qmail-smtpd run file,(just add a '#' before it), and restart qmail. See if it still hangs after doing this.

Edit: Please be aware that this will stop your emails from being scanned for viruses and spam, so only do this for troubleshooting purposes (ie, not for a very long time)

Last edited by ShanxT; 10-01-2011 at 02:29 PM.
 
Old 10-03-2011, 02:27 AM   #8
mangesh.dhamale
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Rep: Reputation: Disabled
Thank you for your reply;

# free -m
total used free shared buffers cached
Mem: 2006 1974 31 0 81 1203
-/+ buffers/cache: 690 1316
Swap: 4996 0 4995
#

Yes, may be its due to lack of memory. But when i tring to find out where my server memory use.
I got following output.

Tasks: 163 total, 1 running, 161 sleeping, 0 stopped, 1 zombie
Cpu(s): 0.0% us, 0.2% sy, 0.0% ni, 98.8% id, 1.1% wa, 0.0% hi, 0.0% si
Mem: 2055144k total, 2025368k used, 29776k free, 84064k buffers
Swap: 5116692k total, 824k used, 5115868k free, 1220876k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3480 spamd 15 0 139m 60m 3340 S 0.0 3.0 0:25.44 spamd
4056 spamd 16 0 136m 57m 3348 S 0.0 2.9 0:15.06 spamd
24990 apache 16 0 258m 49m 12m S 0.0 2.5 0:11.91 httpd
24993 apache 16 0 258m 49m 12m S 0.0 2.5 0:15.13 httpd
24989 apache 16 0 258m 49m 12m S 0.0 2.5 0:19.90 httpd
24986 apache 16 0 258m 49m 12m S 0.0 2.5 0:20.04 httpd
24994 apache 15 0 258m 49m 12m S 0.0 2.5 0:18.76 httpd
24988 apache 16 0 258m 48m 12m S 0.0 2.4 0:08.97 httpd
24987 apache 16 0 258m 48m 12m S 0.0 2.4 0:16.27 httpd
1976 root 16 0 121m 47m 2704 S 0.0 2.4 0:03.30 spamd
17096 apache 15 0 256m 47m 12m S 0.0 2.4 0:08.72 httpd
17120 apache 16 0 256m 47m 12m S 0.0 2.4 0:17.61 httpd
27428 apache 15 0 256m 47m 12m S 0.0 2.3 0:14.13 httpd
24992 apache 15 0 254m 45m 12m S 0.0 2.3 0:12.65 httpd
1954 mysql 16 0 152m 24m 4120 S 0.0 1.2 0:01.89 mysqld
1985 root 16 0 180m 19m 10m S 0.0 0.9 0:01.20 httpd
1704 named 17 0 97696 12m 2888 S 0.0 0.6 28:34.48 named
4857 qscand 16 0 28576 8016 1984 S 0.0 0.4 0:00.11 perl5.8.6
1860 ntp 16 0 18556 7520 6196 S 0.0 0.4 0:00.38 ntpd
27739 mangesh. 16 0 46608 3724 2868 S 0.0 0.2 0:00.19 sshd
27714 root 16 0 46608 3652 2796 S 0.0 0.2 0:00.01 sshd
27779 root 15 0 92072 3084 2336 S 0.0 0.2 0:00.01 su
2023 root 16 0 33080 2396 1852 S 0.0 0.1 0:01.75 authdaemond
2019 root 16 0 33080 2392 1852 S 0.0 0.1 0:01.82 authdaemond
2020 root 16 0 33080 2392 1852 S 0.0 0.1 0:01.80 authdaemond
2021 root 15 0 33080 2392 1852 S 0.0 0.1 0:01.69 authdaemond
2022 root 16 0 33080 2392 1852 S 0.0 0.1 0:01.62 authdaemond
2745 mangesh. 16 0 16700 2372 1356 S 0.0 0.1 0:02.45 imapd
27740 mangesh. 16 0 60900 2360 1760 S 0.0 0.1 0:00.02 bash
976 root 18 0 4324 2148 748 S 0.0 0.1 0:00.00 kmodule
1840 root 16 0 23104 2116 1664 S 0.0 0.1 0:00.04 sshd
5159 root 16 0 14272 1896 1352 R 0.7 0.1 0:00.07 top
 
Old 10-05-2011, 09:04 AM   #9
ShanxT
Member
 
Registered: Apr 2007
Location: India
Distribution: Ubuntu 10.04, RHEL/Centos 5.x, Knoppix
Posts: 41

Rep: Reputation: 3
Most of your memory is being used by the SpamAssassin daemon (spamd), and Apache (httpd). Are you running a separate site as well on the same server? There's also no 'clamd' (ClamAV's daemon) entry. I'm guessing that only pops up when there is an email to scan. If that is indeed the case, then there's definitely no ram for it to run, as in my experience the clamd process takes up quite a bit of memory as well.

So please try commenting out the 'QMAILQUEUE' line, as I mentioned in my previous post, and see if it helps. After commenting the line, restart qmail and stop (kill if necessary) the SpamAssassin and ClamAV processes. If it does help, then there's definitely a memory issue, and I don't think you can do much other than increase the RAM on the system.

Also, I noticed that you have a zombie process running. You can try stopping that by following the instructions on this site.
 
  


Reply

Tags
qmail, smtp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
qmail- smtp problem? namgayp Linux - Server 10 10-22-2012 08:04 AM
Qmail deliver the same message multiple times sufiah Linux - Software 0 02-19-2006 07:31 PM
qmail ssl and smtp not working together shmude Linux - Software 0 11-02-2005 08:02 PM
Bash script to alert by email 3 times then stop. pmpc00 Linux - General 2 11-04-2004 08:23 AM
qmail and smtp ethanchic Linux - Networking 1 04-19-2003 12:36 AM


All times are GMT -5. The time now is 06:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration