Bug Tracker item #2842529, was opened at 2009-08-22 12:53
Message generated for change (Tracker Item Submitted) made by valroff
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2842529&group_id=250683

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: daemon
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Julien Valroff (valroff)
Assigned to: Nobody/Anonymous (nobody)
Summary: PID file not re-created on SIGHUP

Initial Comment:
When sending a SIGHUP to dspam daemon, the PID file is not re-created if the 
ServerPID configuration option is set in dspam.conf.

When running dspam daemon as non-privileged user, dspam log shows an error when 
creating the PID file:

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

The file is most of the time different and it *seems* these are random portions 
of the dspam.conf file.


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_WRITE, pidfile, strerror(errno));
      } else {
        fprintf(file, "%ld\n", (long) getpid());
        fclose(file);
      }
    }

Changing the value of ServerPID to something different than the default leads 
to the same behaviour, but when not using the ServerPID configuration option, 
everything works as expected.

I can reproduce it easily in virtual box running Debian lenny, using the latest 
git code with a very basic configuration.

Cheers,
Julien

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2842529&group_id=250683

------------------------------------------------------------------------------
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