The amavisd-new init.d script seems somewhat broken. Amavisd-new just doesn't play very well with start-stop-daemon, as evidenced by Bugs 245434, 174343, etc. The amavisd script/executable itself has 'start', 'stop', and 'reload' commands that can be called on the command line directly (like postfix). These commands work MUCH BETTER and more reliably. I'm including the rc script we've been using without problems since 2.5.x. This script has been used on multiple production servers for years now, so it's definitely been tested thoroughly, though not widely. It is modelled after the postfix init script, which functions similarly. In addition to adding the 'reload' function, it also uses a conf.d file for passing options to the amavisd executable (there are quite a few useful options available). The new init.d script can also be used to run multiple instances (functionality available since 2.5.0), again similarly to how postfix works. Using start-stop-daemon makes it difficult to run multiple instances, in several ways (--start --name amavisd makes multiple instances impossible, but it "fixes" bug 174343). Creating a link /etc/init.d/amavisd.alt pointing to /etc/init.d/amavisd lets a user start amavisd with the '-i alt' flag automatically included. Details on running amavisd-new with multiple instances using -i can be found in the 2.5.0 release notes (follows as Additional Information): The new init.d script includes a comment on how to set up multiple instances, and refers the user to the above passage for details. WRT Bugs 174343 & 245434, '/etc/init.d/amavisd status' has never had a problem on my systems with the upgraded rc script. I've tested with gentoo 2.6.1-r1 as well as 2.6.2 (current ebuild works fine for 2.6.2. Is the version bump happening some time? Bug 255077). If there's any cleanup, comment adjustment, clarification, additional info, or testing required, I'm happy to help however I can. Reproducible: Always From amavisd-new relase notes regarding multiple instances using -i: "a new command line option -i, it takes one argument which can be any string (an instance/personality name), which is then made available to amavisd.conf in a variable $instance_name (intended to be read-only); code in amavisd does not assign any semantics to this argument and does not use it for any purpose, it is purely intended for administrator's use in amavisd.conf if desired; this simple mechanism may facilitate running multiple instances of amavisd using a single configuration file, or to choose at startup time between amavisd personalities using the same config file; A possible usage is to start a test instance of amavisd while a production amavisd is still running, and letting a test instance listen on its dedicated TCP port number. Each server instance needs its own pid and lock files, its own TCP port number or socket name, and its own $db_home (nanny, cache, agent) unless bdb usage is disabled. A working directory may be shared or kept separate."
Created attachment 185673 [details, diff] changes to amavisd.rc6
Created attachment 185674 [details, diff] changes to amavisd-new ebuild
Created attachment 185675 [details] /etc/conf.d/amavisd full text (Does this need more explanatory comments?)
Created attachment 185677 [details] /etc/init.d/amavisd full text
(In reply to comment #0) > These > commands work MUCH BETTER and more reliably. Agreed. Thanks for the patches.
I'll try to look at this weekend and also finally bump to 2.6.2.
1 year pass still no luck:( Fixed ebuild version (also fixed #109132) available at my overlay at http://code.google.com/p/barzog-gentoo-overlay/
Should be fixed with amavisd-new-2.7.0. Please check and reopen if necessary.