Le mardi 18 août 2009 à 19:36 +0200, Julien Valroff a écrit :
> Le mardi 18 août 2009 à 08:48 +0200, Julien Valroff a écrit :
> > Le mardi 18 août 2009 à 01:40 +0200, Steve a écrit :
> [...]
> > > 
> > > > Aug 17 18:20:41 nix dspam[10481]: Reloading configuration
> > > > Aug 17 18:20:41 nix dspam[10481]: received signal. waiting for 
> > > > processing
> > > > threads to exit.
> > > > Aug 17 18:20:41 nix dspam[10481]: daemon is down.
> > > > Aug 17 18:20:41 nix dspam[10481]: reloading configuration
> > > > Aug 17 18:20:41 nix dspam[10703]: Reloading configuration
> > > > Aug 17 18:20:41 nix dspam[10703]: received signal. waiting for 
> > > > processing
> > > > threads to exit.
> > > > Aug 17 18:20:41 nix dspam[10703]: daemon is down.
> > > > Aug 17 18:20:41 nix dspam[10481]: Unable to open file for writing: ck:
> > > > Permission denied
> > > > Aug 17 18:20:41 nix dspam[10703]: reloading configuration
> > > > Aug 17 18:20:41 nix dspam[10703]: Unable to open file for writing: ck:
> > > > Permission denied
> > > > 
> > > Could you try to compile DSPAM with debug and verbose debug enabled
> > > and then run once with "dspam --daemon --debug" and then look if you
> > > have some useful info in the log file?
> > 
> > It is already built with --debug, nothing interesting, I will try with
> > --verbose-debug and post if anything is.
> 
> Nothing interesting with --verbose-debug
> 
> I have now purged and re-written from scratch my config files, and still
> the same issue.
> 
> I have even had 2 different errors, sending 2 SIGHUP's in a row:
> Aug 18 16:51:53 nix dspam[5652]: Reloading configuration
> Aug 18 16:51:53 nix dspam[5652]: received signal. waiting for processing 
> threads to exit.
> Aug 18 16:51:53 nix dspam[5652]: daemon is down.
> Aug 18 16:51:53 nix dspam[5652]: reloading configuration
> Aug 18 16:51:53 nix dspam[5652]: Unable to open file for writing: 
> �"#006#010#010##006#...@##006#010: Permission denied
> Aug 18 16:52:09 nix dspam[5652]: Reloading configuration
> Aug 18 16:52:09 nix dspam[5652]: received signal. waiting for processing 
> threads to exit.
> Aug 18 16:52:09 nix dspam[5652]: daemon is down.
> Aug 18 16:52:09 nix dspam[5652]: reloading configuration
> Aug 18 16:52:09 nix dspam[5652]: Unable to open file for writing: : No such 
> file or directory
> 
> And it happened once I had:
>       Unable to open file for writing: mysqld.sock: Permission denied
> 
> But it also happens when using tcp connection to my MySQL server.
> 
> I have been able to identify where the error comes from, it is in
> dspam.c, around line 3981:
>     if (pidfile) {
>       FILE *file;
>       file = fopen(pidfile, "w");
>       if (file == NULL) {
>         LOG(LOG_ERR, ERR_IO_FILE_WRITE2, pidfile, strerror(errno));
>       } else {
>         fprintf(file, "%ld\n", (long) getpid());
>         fclose(file);
>       }
>     }
> 
> I have changed the error to ERR_IO_FILE_WRITE2 to be able to catch where
> was the issue.
> 
> If I do not set the ServerPID variable in dspam.conf, it seems everything is 
> ok: no error in the log, and the PID file is re-created:
> Aug 18 19:15:40 nix dspam[16183]: Reloading configuration
> Aug 18 19:15:40 nix dspam[16183]: received signal. waiting for processing 
> threads to exit.
> Aug 18 19:15:40 nix dspam[16183]: daemon is down.
> Aug 18 19:15:40 nix dspam[16183]: reloading configuration
> 
> # ls -l /var/run/dspam/
> total 4
> -rw-rw---- 1 dspam dspam 6 aoû 18 19:15 dspam.pid
> srwxrwxrwx 1 dspam dspam 0 aoû 18 19:15 dspam.sock
> 
> Sorry, I am not able to help more... I can however test any proposal to
> fix this.

I have been able to reproduce it easily on a test machine with the
default configuration, simply using the hash driver.

On SIHGUP, the pid file is not re-created if the ServerPID configuration
parameter is set in dspam.conf (I have also tried changing the path to
the pid file, and whatever it is set to, I have the same problem).

When running dspam as root, there is no "Unable to open file for
writing" error, but if running as unprivileged user, the pid file
start_daemon tries to create seems to be a random configuration option
taken from dspam.conf. I fear some files are created "randomly" when
running dspam as root.

Should I open a bug on SF?

Cheers,
Julien


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to