Hi, I'm using Centos 4.4 with: mimedefang.org + spamassassin.org
Mimedefang(MD) is a perl program that calls SpamAssassin(SA) perl module.
The problem I'm getting is that from update 4.4, SA does not seems to find the $HOME variable only when it is called during system boot. If you later login as root and run: $ service mimedefang restart then SA does indeed find the $HOME variable
I checked the /etc/init.d/mimedefang file and the chain of commands seems to be this:
/etc/init.d/mimedefang -> daemon function from /etc/init.d/function -> /sbin/runuser
SpamAssassin perl module is called from the mimedefang perl program.
I'm thinking that /sbin/runuser is the root cause of the problem.
My questions are: - does /sbin/runuser set the $HOME at boot time? - should /sbin/runuser be called with the -l option?
Thanks Oliver
On 10/23/06, Oliver Schulze L. oliver@samera.com.py wrote:
Hi, I'm using Centos 4.4 with: mimedefang.org + spamassassin.org
Mimedefang(MD) is a perl program that calls SpamAssassin(SA) perl module.
The problem I'm getting is that from update 4.4, SA does not seems to find the $HOME variable only when it is called during system boot. If you later login as root and run: $ service mimedefang restart then SA does indeed find the $HOME variable
HOME is defined by your shell. Its not specified that it should be set by init, and it appears its isn't. I've never used mimedefang so I don't know the context of its use of the HOME environment variable, such that I could suggest a solution to your problem. I will say that in the past I have made the script that is to be ran in that environment give HOME a default of some sort so if/when it was ran out of init it would still function properly (BTW, its likely you would see this in cron too).
Cheers...james
Hi James, as recommended in the miemdefang list(and you), I added this line in mimedefang init file: export HOME=/path/to/home in order to solve the problem
I was thinking that /sbin/runuser could unset all variables that was setup by bash in /etc/init.d/mimedefang
Thanks Oliver
James Olin Oden wrote:
such that I could suggest a solution to your problem. I will say that in the past I have made the script that is to be ran in that environment give HOME a default of some sort so if/when it was ran out of init it would still function properly (BTW, its likely you would see this in cron too).