You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by we...@my-it-brain.de on 2015/01/12 08:08:33 UTC

Permission Problem and bad file descriptor

Hello guys,

Since yesterday I'm running a server with ubuntu 14.04.1 and 
spamassassin version
3.4.0-1ubuntu2. Spamassassin was installed as a package from the ubuntu 
repositories. SpamAssassin runs in daemon mode with a user named spamd.

This morning I got the following email. It indicates, that there is 
something wrong with my permission settings.

/etc/cron.daily/spamassassin:
Jan 12 02:42:56.374 [23592] warn: config: path 
"/var/lib/spamassassin/.spamassassin/user_prefs" is inaccessible: 
Permission denied
config: path "/var/lib/spamassassin/.spamassassin/user_prefs" is 
inaccessible: Permission denied
cannot create a directory: Permission denied at 
/usr/share/perl5/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 
1034.
cannot write to 
/var/lib/spamassassin/.spamassassin/sa-compile.cache/rules.body_0 at 
/usr/share/perl5/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 
1036.
print() on closed filehandle CACHE at 
/usr/share/perl5/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 
1037.
plugin: eval failed: error writing: Bad file descriptor at 
/usr/share/perl5/Mail/SpamAssassin/Plugin/BodyRuleBaseExtractor.pm line 
1037.

"/var/lib/spamassassin/.spamassassin/user_prefs" doesn't exist. The 
directory permissions are as follows:

:~# ll -d /var/lib/spamassassin/.spamassassin
drwx------ 3 spamd spamd 4096 Jan 12 05:01 
/var/lib/spamassassin/.spamassassin/

Now, I have two questions:

1. Do I have to create the file user_prefs manually?
2. What are the correct permissions for the directory and the file?

Thanks in advance.
John

Re: Permission Problem and bad file descriptor

Posted by we...@my-it-brain.de.
Problem solved.

The cronjob runs as user debian-spamd. On my system the user 
debian-spamd is a member of the group spamd. Unfortunately this group 
didn't have any permissions on the directory /var/lib/spamassassin.

So I changed the permissions wit "sudo chmod -R g+rx 
/var/lib/spamassassin". Since this moment the cronjob runs without the 
mentioned error message.

Thanks again.
John

Am 2015-01-12 15:14, schrieb Kevin A. McGrail:
> Looks like you have a cron job for sa-update running.  What user is
> running that cron job and what are the perms on the directory?
> 
> For the user pref dir, no it is not created manually.  It is going to
> be a combination of parameters for your spamc and spamd, what user the
> progs run as and the permissions involved.
> Regards,
> KAM
> 
> On January 12, 2015 2:08:33 AM EST, webmaster@my-it-brain.de wrote:
>> 
>> Now, I have two questions:
>> 
>> 1. Do I have to create the file user_prefs manually?
>> 2. What are the correct permissions for the directory and the file?
>> 
>> Thanks in advance.
>> John


Re: Permission Problem and bad file descriptor

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
Looks like you have a cron job for sa-update running.  What user is running that cron job and what are the perms on the directory?

For the user pref dir, no it is not created manually.  It is going to be a combination of parameters for your spamc and spamd, what user the progs run as and the permissions involved.
Regards,
KAM

On January 12, 2015 2:08:33 AM EST, webmaster@my-it-brain.de wrote:
>
>Now, I have two questions:
>
>1. Do I have to create the file user_prefs manually?
>2. What are the correct permissions for the directory and the file?
>
>Thanks in advance.
>John