Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 263180 - mail-filter/amavisd-new-2.6.x: init.d script enhancements: multiple instances, daemon options in conf.d, work reliably.
Summary: mail-filter/amavisd-new-2.6.x: init.d script enhancements: multiple instances...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 255077
  Show dependency tree
 
Reported: 2009-03-20 22:18 UTC by noah
Modified: 2011-07-02 05:44 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
changes to amavisd.rc6 (rc.patch,1.78 KB, patch)
2009-03-20 22:19 UTC, noah
Details | Diff
changes to amavisd-new ebuild (ebuild.patch,470 bytes, patch)
2009-03-20 22:21 UTC, noah
Details | Diff
/etc/conf.d/amavisd full text (amavisd.conf,69 bytes, text/plain)
2009-03-20 22:23 UTC, noah
Details
/etc/init.d/amavisd full text (amavisd.rc6,1.28 KB, text/plain)
2009-03-20 22:23 UTC, noah
Details

Note You need to log in before you can comment on or make changes to this bug.
Description noah 2009-03-20 22:18:52 UTC
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."
Comment 1 noah 2009-03-20 22:19:45 UTC
Created attachment 185673 [details, diff]
changes to amavisd.rc6
Comment 2 noah 2009-03-20 22:21:49 UTC
Created attachment 185674 [details, diff]
changes to amavisd-new ebuild
Comment 3 noah 2009-03-20 22:23:14 UTC
Created attachment 185675 [details]
/etc/conf.d/amavisd full text

(Does this need more explanatory comments?)
Comment 4 noah 2009-03-20 22:23:46 UTC
Created attachment 185677 [details]
/etc/init.d/amavisd full text
Comment 5 Eray Aslan gentoo-dev 2009-03-24 06:11:32 UTC
(In reply to comment #0)
> These
> commands work MUCH BETTER and more reliably.

Agreed.  Thanks for the patches.
Comment 6 Tobias Scherbaum (RETIRED) gentoo-dev 2009-03-24 17:36:45 UTC
I'll try to look at this weekend and also finally bump to 2.6.2.
Comment 7 Oleg Gawriloff 2010-05-07 10:59:37 UTC
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/
Comment 8 Eray Aslan gentoo-dev 2011-07-02 05:44:55 UTC
Should be fixed with amavisd-new-2.7.0.  Please check and reopen if necessary.