Summary: | mail-filter/spamassassin-3.1.x - spamd doesn't daemonize | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jimmy.Jazz |
Component: | Current packages | Assignee: | Gentoo Perl team <perl> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | jakub |
Priority: | High | ||
Version: | 2006.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | spamd and children output |
Description
Jimmy.Jazz
2006-08-10 06:43:20 UTC
Err, -D is *debug*, not daemonize.... (In reply to comment #1) > Err, -D is *debug*, not daemonize.... > Hello, okay, that's not my day... you seems really in a bad mood. Anyway, here is the -d option in gentoo /etc/init.d/spamd file ;) start() { ebegin "Starting spamd" start-stop-daemon --start --quiet \ --exec /usr/sbin/spamd -- -d -r ${PIDFILE} \ ^ ${SPAMD_OPTS} eend $? "Failed to start spamd" } Jj Maybe -d and -D don't go hand-in-hand? Just a wild guess... (In reply to comment #3) > Maybe -d and -D don't go hand-in-hand? > Just a wild guess... > Hi, That's for sure a wild guess :) I have checked it before. In fact, i don't use -D in normal use. So just ignore it. In debug mode spamd returns the following messages and stops: Thu Aug 10 19:16:37 2006 [24084] dbg: logger: successfully added file method Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: creating INET socket: Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: Listen: 128 Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: LocalAddr: 0.0.0.0 Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: LocalPort: 783 Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: Proto: 6 Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: ReuseAddr: 1 Thu Aug 10 19:16:37 2006 [24084] dbg: spamd: Type: 1 Thu Aug 10 19:16:37 2006 [24084] dbg: logger: adding facilities: all Thu Aug 10 19:16:37 2006 [24084] dbg: logger: logging level is DBG Thu Aug 10 19:16:37 2006 [24084] dbg: generic: SpamAssassin version 3.1.4 Thu Aug 10 19:16:37 2006 [24084] dbg: config: score set 0 chosen. Thu Aug 10 19:16:37 2006 [24084] dbg: message: ---- MIME PARSER START ---- Thu Aug 10 19:16:37 2006 [24084] dbg: message: main message type: text/plain Thu Aug 10 19:16:37 2006 [24084] dbg: message: parsing normal part Thu Aug 10 19:16:37 2006 [24084] dbg: message: added part, type: text/plain Thu Aug 10 19:16:37 2006 [24084] dbg: message: ---- MIME PARSER END ---- Thu Aug 10 19:16:37 2006 [24084] dbg: dns: is Net::DNS::Resolver available? yes Thu Aug 10 19:16:37 2006 [24084] dbg: dns: Net::DNS version: 0.53 Thu Aug 10 19:16:37 2006 [24084] info: logger: removing stderr method Jj (In reply to comment #0) > i'm using the following settings, > SPAMD_OPTS=" -r /var/run/spamd/spamd.pid -D -i -A 127.0.0.1/8,192.168.1.0/24 -u > spamd -H /var/spool/spamassassin --port=783 --nouser-config -s > /var/log/spamd.log" > What's the debug output look like (to cut the argument short, -D==debug, line 179 of /usr/bin/spamassassin and in man spamd)? -i is missing an ip address to bind to. I'm curious why you overriding some of these options by the way, but I suppose knowing what your actual error output is will help. Created attachment 94060 [details]
spamd and children output
(In reply to comment #5) > > What's the debug output look like (to cut the argument short, -D==debug, line > 179 of /usr/bin/spamassassin and in man spamd)? If -D has no argument then all debugging information is printed. As remark, that was not a cutting output but really what spamd returns before dying. To be sure if i haven't overseen something i do the test again with -D=debug has you have suggested me. Also, spamd will this time output the debug messages only. Since spamassassin script cannot be daemonize, i proceed with spamd as usual. Here is the output, Sat Aug 12 16:09:42 2006 [23236] info: logger: removing stderr method and spamd immediately dies after it. As you can see there is nothing to do with that :( strace is more verbose, see the attachment above (I only altered the hostname and its domain for security purpose). I don't know if you can work on it but spamd seems this time to fork children and continue to live. That's an improvement, BUT the owner stays root instead of the user spamd as it already should (-u spamd)!!! You will get the same behaviour if you run spamd as a service like qmail or djbdns tools. The children stays root !? ps aux | grep spamd output, root 24369 1.9 0.1 1684 676 pts/1 S+ 16:16 0:02 /usr/bin/strace -f /usr/sbin/spamd -- -d -r /var/run/spamd/spamd.pid -D=debug -i -A 127.0.0.1/8,192.168.1.0/24 -u spamd -H /var/spool/spamassassin --port=783 --nouser-config -s /var/log/spamd.log --max-spare=1 --min-children=1 root 24370 3.1 12.3 67684 63376 pts/1 S+ 16:16 0:03 /usr/bin/perl -w /usr/sbin/spamd -- -d -r /var/run/spamd/spamd.pid -D=debug -i -A 127.0.0.1/8,192.168.1.0/24 -u spamd -H /var/spool/spamassassin --port=783 --nouser-config -s /var/log/spamd.log --max-spare=1 --min-children=1 root 24397 0.4 12.4 69152 64180 pts/1 S+ 16:16 0:00 spamd child ^^^^ root 24399 0.0 11.7 67684 60372 pts/1 S+ 16:16 0:00 spamd child ^^^^ (The owner should be spamd as -u spamd suggests to us !) Perhaps is it where we have to look for ? Why doesn't spamd die when it is run with strace or like a service ? I don't know. > > -i is missing an ip address to bind to. When you miss the ip address, 0.0.0.0 is used by default. > > I'm curious why you overriding some of these options by the way, but I suppose > knowing what your actual error output is will help. > I need to lower spamd rights. root was not an option. That's why i use the user spamd with no login access et special rights. -A limits the valid network addresses that are allowed to use spamd port. --max-spare=1 --min-children=1 are pretty much used to limit the size of spamd in memory (78Mb !). I hope can help you. Thx Jj Did you create the user 'spamd'? (In reply to comment #8) > Did you create the user 'spamd'? > yes, of course, and the group as well. Below, spamd works _without_ the -p flag. root 13043 0.0 5.0 67404 25792 ? Ss 07:10 0:03 /usr/bin/perl -w /usr/sbin/spamd -r /var/run/spamd/spamd.pid -i -A 127.0.0.1/8,192.168.1.0/24 -u spamd -H /var/spool/spamassassin --port=783 --nouser-config -s /var/log/spamd.log --max-spare=1 --min-children=1 spamd 13554 2.9 11.5 75456 59432 ? S 07:11 2:13 spamd child ^^^^^ Same behavior with spamassassin 3.1.7. Probably a perl v5.8.x bug. #perl -v This is perl, v5.8.8 built for i686-linux-thread-multi Please, don't use -d flag. It doesn't work well. At least modify /etc/init.d/spamd file like the example below. Thx, Jj start() { ebegin "Starting spamd" start-stop-daemon --start --quiet --background \ --nicelevel ${SPAMD_NICELEVEL:-0} \ --exec /usr/sbin/spamd -- -r ${PIDFILE} \ ${SPAMD_OPTS} eend $? "Failed to start spamd" } stop() { ebegin "Stopping spamd" start-stop-daemon --stop --quiet --retry 20 --pidfile ${PIDFILE} eend $? "Failed to stop spamd" } Is everyone experiencing this problem running a threaded perl? Closing a dead bug. |