Discussion:
MailScanner starting new parent processes
Chris Labatt-Simon
2014-09-29 18:40:26 UTC
Permalink
Hi All -



I just went through a painful upgrade of an Ubuntu server from 10.04 to
14.04. In the process, MailScanner was removed and I had to re-install it. I
copied over my old etc settings. My old version was 4.79.11. My new version
is 4.84.6.



It seems as if MailScanner can't tell whether it's already running. I have
"Restart Every" set to 7200. Every time the time passes, a new primary
process of MailScanner starts. Over the period of a day, I'll have a large
number of parent processes running.



Help?



If this helps at all. the mailscanner script in /etc/init.d uses
start-stop-daemon to start and stop the MailScanner process. It would start
fine, but it wouldn't stop as it didn't recognize the MailScanner name in
the process list. I had to modify the script to use the PID file to stop the
processes.



Here's the ps -edf output after the first 7200 seconds:



root 11829 1 0 12:31 ? 00:00:00 MailScanner: master waiting
for children, sleeping

root 11830 11829 0 12:31 ? 00:00:11 MailScanner: waiting for
messages

root 11839 11829 0 12:31 ? 00:00:13 MailScanner: waiting for
messages

root 11857 11829 0 12:32 ? 00:00:14 MailScanner: waiting for
messages

root 11863 11829 0 12:32 ? 00:00:14 MailScanner: waiting for
messages

root 11871 11829 0 12:32 ? 00:00:14 MailScanner: waiting for
messages

root 14269 1 0 13:17 ? 00:00:00 MailScanner: master waiting
for children, sleeping

root 14270 14269 0 13:17 ? 00:00:07 MailScanner: waiting for
messages

root 14278 14269 0 13:17 ? 00:00:07 MailScanner: waiting for
messages

root 14284 14269 0 13:17 ? 00:00:10 MailScanner: waiting for
messages

root 14290 14269 0 13:17 ? 00:00:07 MailScanner: waiting for
messages

root 14298 14269 0 13:17 ? 00:00:08 MailScanner: waiting for
messages



Thanks!



Chris





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20140929/03929d29/attachment.html
Gabor FUNK
2014-09-29 21:31:05 UTC
Permalink
I just went through a painful upgrade of an Ubuntu server ...
Welcome to the club :-}
It seems as if MailScanner can't tell whether it's already running.
I have "Restart Every" set to 7200. Every time the time passes, a new primary process of MailScanner starts.
Over the period of a day, I'll have a large number of parent processes running.
If this helps at all. the mailscanner script in /etc/init.d uses start-stop-daemon to start and stop the MailScanner process.
It would start fine, but it wouldn't stop as it didn't recognize the MailScanner name in the process list.
I had to modify the script to use the PID file to stop the processes.
You basically found out what your problem is/was.

Issue more thorougly described at:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649835#25

So basically you need to change "$NAME"s to "$PIDFILE" like:

< start-stop-daemon --start --quiet --startas $STARTAS --name $NAME --test > /dev/null \
---
start-stop-daemon --start --quiet --startas $STARTAS --pidfile "$PIDFILE" --test > /dev/null \
< start-stop-daemon --start --quiet --nicelevel $run_nice --exec $DAEMON --name $NAME -- $DAEMON_ARGS \
---
start-stop-daemon --start --quiet --nicelevel $run_nice --exec $DAEMON --pidfile "$PIDFILE" -- $DAEMON_ARGS \
< start-stop-daemon --stop --retry=TERM/10/TERM/20 --name $NAME
---
start-stop-daemon --stop --quiet --retry=TERM/10/TERM/20 --pidfile "$PIDFILE"
< start-stop-daemon --stop --signal 1 --quiet --name $NAME
---
start-stop-daemon --stop --signal 1 --quiet --pidfile "$PIDFILE"
(with having a
PIDFILE=`${QUICKPEEK} 'PID file' ${CONFFILE}`
line as well at the beginning)


Here is a link to the script I'm using currently without problems in case you don't want to edit
http://maques.hu/linux/mailscanner
There are some extras like possibiliity to ulimit and checking for multiple installation directories to start the daemon (tgz:opt/deb:bin).
You might need to edit though...

G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20140929/595f8d04/attachment.html
Glenn Steen
2014-09-30 12:23:58 UTC
Permalink
Good to know. I had a much smaller but similar hiccup when going to
CentOS 7, but that was mostly attributed to my ... noobishness when it
comes to systemd (no noob any more:-).

BTW, Chris... Are you the same guy who, together with me and a few
swiss guys, was very ... intoxicated... at the Langebro pub in
Copenhagen after the SimCorp GTS a few years ago?:-)

Cheers!
--
-- Glenn
Randal, Phil
2014-09-30 13:28:24 UTC
Permalink
Hi Glenn,

What was your workaround for CentOS 7?

Cheers,

Phil


-----Original Message-----
From: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Glenn Steen
Sent: 30 September 2014 13:24
To: MailScanner discussion
Subject: Re: MailScanner starting new parent processes

Good to know. I had a much smaller but similar hiccup when going to CentOS 7, but that was mostly attributed to my ... noobishness when it comes to systemd (no noob any more:-).

BTW, Chris... Are you the same guy who, together with me and a few swiss guys, was very ... intoxicated... at the Langebro pub in Copenhagen after the SimCorp GTS a few years ago?:-)

Cheers!
--
-- Glenn
--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner

Before posting, read http://wiki.mailscanner.info/posting

Support MailScanner development - buy the book off the website!
Hoople Ltd, Registered in England and Wales No. 7556595
Registered office: Plough Lane, Hereford, HR4 0LE

"Any opinion expressed in this e-mail or any attached files are those of the individual and not necessarily those of Hoople Ltd. You should be aware that Hoople Ltd. monitors its email service. This e-mail and any attached files are confidential and intended solely for the use of the addressee. This communication may contain material protected by law from being passed on. If you are not the intended recipient and have received this e-mail in error, you are advised that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please contact the sender immediately and destroy all copies of it."
Glenn Steen
2014-10-02 21:32:25 UTC
Permalink
Hi Phil,

Sorry for missing this ... Not at work atm, but IIRC there were two
distinct anomalies vis-a-vis systemd... first There seemed to be a
problem where systemctl status Mailscanner.service reported the
process dead, altough it actually lived... Think that had something to
do with it not detecting the restart behaviour of MS... Don't rightly
remember what, if anything, I did about that (not at the terminal
right now... ISTR verifying MailScanner init script could write the
pid file and then things went much better:-), second at reboots, the
order of startup was such that the network hadn't been started
(sometimes), so Postfix as started by MailScanner failed... And
possibly a failure for MS proper... But futzing the dependency for
MailScanner.service (to just wait for network start) fixed that.
No biggie, hence didn't take careful notes (not like the horrible
trouble I had with SElinux, until I could stop it enforcing AND shut
up in the logs via some careful policy creation:-).

Cheers
--
-- Glenn
Post by Randal, Phil
Hi Glenn,
What was your workaround for CentOS 7?
Cheers,
Phil
-----Original Message-----
From: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Glenn Steen
Sent: 30 September 2014 13:24
To: MailScanner discussion
Subject: Re: MailScanner starting new parent processes
Good to know. I had a much smaller but similar hiccup when going to CentOS 7, but that was mostly attributed to my ... noobishness when it comes to systemd (no noob any more:-).
BTW, Chris... Are you the same guy who, together with me and a few swiss guys, was very ... intoxicated... at the Langebro pub in Copenhagen after the SimCorp GTS a few years ago?:-)
Cheers!
--
-- Glenn
--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
Hoople Ltd, Registered in England and Wales No. 7556595
Registered office: Plough Lane, Hereford, HR4 0LE
"Any opinion expressed in this e-mail or any attached files are those of the individual and not necessarily those of Hoople Ltd. You should be aware that Hoople Ltd. monitors its email service. This e-mail and any attached files are confidential and intended solely for the use of the addressee. This communication may contain material protected by law from being passed on. If you are not the intended recipient and have received this e-mail in error, you are advised that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please contact the sender immediately and destroy all copies of it."
--
MailScanner mailing list
mailscanner at lists.mailscanner.info
http://lists.mailscanner.info/mailman/listinfo/mailscanner
Before posting, read http://wiki.mailscanner.info/posting
Support MailScanner development - buy the book off the website!
--
-- Glenn
email: glenn < dot > steen < at > gmail < dot > com
work: glenn < dot > steen < at > ap1 < dot > se
Loading...