Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 143445 - spamd doesn't daemonize
Summary: spamd doesn't daemonize
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-10 03:58 UTC by Jimmy.Jazz
Modified: 2006-08-10 05:24 UTC (History)
0 users

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 Jimmy.Jazz 2006-08-10 03:58:01 UTC
Hello,

spamd daemon needs the TMPDIR environment variable to be set otherwise it won't   deamonize and die

please read the function preload_modules_with_tmp_homedir() in /usr/sbin/spamd perl script.

Thx

Jj
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-08-10 04:18:17 UTC
You are missing /tmp on your system or what? 

perldoc File::Spec
<snip>
tmpdir
Returns a string representation of the first writable directory from a list of possible temporary directories.  Returns the current directory if no writable temporary directories are found.  The list of directories checked depends on the platform; e.g. File::Spec::Unix checks $ENV{TMPDIR} (unless taint is on) and /tmp.
</snip>
Comment 2 Jimmy.Jazz 2006-08-10 05:13:02 UTC
(In reply to comment #1)
> You are missing /tmp on your system or what? 

Of course not :),

env | grep TMP
TMPDIR=/var/tmp

If i omit TMPDIR in the /etc/conf.d/spamd config file /etc/init.d/spamd won't work in daemon mode. Doesn't matter if it is set to /tmp or /var/tmp.

/etc/profile is not called, it isn't a login session.
To convince you, here is the result of env variable when called from /etc/init.d/spamd

TERM=gnome
SHELL=/bin/bash
DEFAULTLEVEL=default
LC_ALL=fr_FR.utf8
USER=root
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/lib/ccache/bin:/usr/lib/distcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/opt/ati/bin:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/qt/3/bin:/var/qmail/bin:/var/vpopmail/bin
PWD=/var/log
LANG=fr_FR
BOOTLEVEL=boot
SVCNAME=spamd
CONSOLETYPE=pty
SHLVL=1
HOME=/root
SOFTLEVEL=default
LC_TIME=fr_FR.utf8
_=/bin/env


i added TMPDIR=${TMPDIR:-/tmp} in /etc/init.d/spamd like workaround

Jj
Comment 3 Jimmy.Jazz 2006-08-10 05:24:28 UTC
(In reply to comment #1)
> You are missing /tmp on your system or what? 

Sorry, my fault. It isn't TMPDIR related. spamd simply doesn't work with -d option. 

I changed the title for a more accurate one.

Anyway, thx for the help

Jj