You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2005/10/31 04:24:21 UTC

[Bug 4655] New: [patch] init.d spamassassin restart kills wrong process and fails

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655

           Summary: [patch] init.d spamassassin restart kills wrong process
                    and fails
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Packaging: RPM
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: wtogami@redhat.com


https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=161785
Sometimes "service spamassassin stop" fails on distros like Fedora because
killproc returns before spamd is fully dead.

  service spamassassin restart
  Shutting down spamd:                                       [  OK  ]
  Starting spamd: Could not create INET socket on 127.0.0.1:783: Address already 
  in use (IO::Socket::INET: Address already in use)          [FAILED]    

This happens in instances where PPID wraparound happened.  It tried to kill the
first process named spamd, which is no longer the parent process, and thus
causes this failure.  Patch forthcoming target trunk, 3.1.1 and 3.0.5.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From sidney@sidney.com  2005-11-07 20:45 -------
+1




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|need 1 more vote            |needs one more vote
   Target Milestone|3.0.5                       |3.1.1




------- Additional Comments From sidney@sidney.com  2005-11-19 01:33 -------
Committed revision 345610.

Leaving open to retarget to 3.1.1

Strictly speaking it needs one more vote before committing ot the 3.1.1 branch
because Henry voted just on 3.0.5.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From felicity@apache.org  2006-03-10 22:14 -------
Created an attachment (id=3408)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3408&action=view)
just use /var/run/spamd.pid




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Additional Comments From felicity@apache.org  2006-03-10 22:08 -------
I was just noticing that this doesn't quite work.

SPAMD_PID=/var/run/spamassassin/spamd.pid

but nothing ever makes /var/run/spamassassin, so upon starting:

Mar 10 17:00:46 eclectic spamd[23924]: spamd: server started on port 783/tcp (running version 3.1.1) 
Mar 10 17:00:46 eclectic spamd[23924]: spamd: cannot write to PID file: No such file or directory 
Mar 10 17:00:46 eclectic spamd[23924]: spamd: server pid: 23924 

also, the pid file is never cleaned up.  in stop:

                rm -f /var/run/spamd.pid

which isn't the right path.

anyway, I'll put up a patch in a minute.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From wtogami@redhat.com  2006-03-10 22:51 -------
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=161785#c10
I need to get a similar solution into Red Hat's package.

You are right, /var/run/spamd.pid is fine, we just have to be sure other parts
are using it properly.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From jm@jmason.org  2005-10-31 04:36 -------
+1



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From jm@jmason.org  2006-03-10 22:29 -------
sorry, I get it; it's cumulative.  +1



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From henry@stern.ca  2005-11-19 00:54 -------
Patch applies cleanly and make test is happy.  +1 for 3.0.5 release.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From shiva@sewingwitch.com  2006-03-11 02:23 -------
(In reply to comment #15)
> +1
> 
> I keep thinking that there may be a reason why it was in a spamassassin
> subdirectory and it made that symbolic link, perhaps some RedHat standard

Some packages use a /var/run subdirectory if the program writes the pid file
after it drops root privileges. (Similar measures must be taken with /var/log.)
Presumably spamd or its script did this in the past?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655


spamassassin@dostech.ca changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
  Status Whiteboard|needs one more vote         |




------- Additional Comments From spamassassin@dostech.ca  2005-11-20 06:02 -------
+1 for all

3.1 r345719





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From sidney@sidney.com  2005-11-07 20:46 -------
If this is the place to vote for this for 3.1 too, here's my +1 for that.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |need 1 more vote






------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From sidney@sidney.com  2006-03-10 22:41 -------
+1

I keep thinking that there may be a reason why it was in a spamassassin
subdirectory and it made that symbolic link, perhaps some RedHat standard, but
1) most if not all of my daemons on my Fedora Core 4 system create pid files in
/var/run and don't do that symbolic link to the subdirectory thing, and 2) the
way this was just would not work unless something makes the spamassassin
subdirectory, which I don't see in the spec file and certainly is not true when
make install is done from source.

Unfortunately, I will not get to test a new tarball candidate for 3.1.1 until
about 8 or 9 hours from now :-(




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From jm@jmason.org  2005-11-07 23:35 -------
explicitly: +1 for all



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From jm@jmason.org  2005-11-18 06:47 -------
applied to trunk; revision 345454.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655


felicity@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From felicity@apache.org  2006-03-11 02:27 -------
committed, thanks.

Sending        spamd/redhat-rc-script.sh
Transmitting file data .
Committed revision 384991.




------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From jm@jmason.org  2006-03-10 22:28 -------
doesn't that need "-r $SPAMD_PID" on the spamd invocation line?



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655


wtogami@redhat.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Target Milestone|Undefined                   |3.0.5




------- Additional Comments From wtogami@redhat.com  2005-11-07 20:13 -------
Target 3.0.5, although this needs to be applied to other branches too.  Two more
votes needed.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

[Bug 4655] [patch] init.d spamassassin restart kills wrong process and fails

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4655





------- Additional Comments From wtogami@redhat.com  2005-10-31 04:28 -------
Created an attachment (id=3219)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=3219&action=view)
spamassassin-3.0.4-4655-initrd-kill-ppid.patch

Explicitly creates .pid file when service runs, and uses it in the .pid
killproc codepath during service stop.	This has the benefit of leaving alone
other instances of spamd that might also be running on the system.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.