Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 217849 - mail-filter/spamassassin provides bad init script
Summary: mail-filter/spamassassin provides bad init script
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-15 20:07 UTC by Graham Murray
Modified: 2010-04-19 13:30 UTC (History)
9 users (show)

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


Attachments
Patch for "files/3.0.0-spamd.init" (3.0.0-spamd.init.patch,369 bytes, patch)
2008-04-18 20:54 UTC, Roger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Murray 2008-04-15 20:07:12 UTC
Following the upgrade to baselayout-2.0 and openrc, starting spamd shows the following error.

/etc/init.d/spamd start
 * Starting spamd ...
 * start-stop-daemon: /usr/sbin/spamd is a script
 * start-stop-daemon: and should be started, stopped or signalled with
 * start-stop-daemon: --exec /usr/bin/perl -w /usr/sbin/spamd
 * start-stop-daemon: or you should specify a pidfile or process name
 * Failed to start spamd                                                  [ !! ]
 * ERROR: spamd failed to start

emerge --info
Portage 2.1.5_rc3 (default-linux/x86/2007.0/desktop, gcc-4.2.3, glibc-2.7-r2, 2.6.24-gentoo-r5 i686)
=================================================================
System uname: 2.6.24-gentoo-r5 i686 Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz
Timestamp of tree: Tue, 15 Apr 2008 16:45:01 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.5
dev-lang/python:     2.4.4-r4, 2.5.1-r5
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -mtune=native -pipe -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -mtune=native -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildsyspkg distlocks installsources metadata-transfer parallel-fetch sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://gentoo.blueyonder.co.uk http://gentoo.tiscali.nl/ http://gentoo.mirror.solnet.ch http://pandemonium.tiscali.de/pub/gentoo/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS=""
LINGUAS="en_GB en"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/musicbrainz /usr/portage/local/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac aalib acl acpi aim alsa apache2 arts audiofile avi bash-completion berkdb bluetooth bonobo browserplugin bzip2 bzlib cairo caps cddb cdparanoia cdr cjk cli cracklib crypt cups curl cvs dbus directfb doc dri dts dvd dvdr dvdread eds emacs emboss encode esd ethereal evo examples exif expat fam fbcon ffmpeg fftw firefox flac foomaticdb fortran ftp gcj gd gdbm gif glut gmp gnome gnutls gphoto2 gpm graphviz gstreamer gtk gtk2 gtkhtml guile hal iconv icq idn ieee1394 imagemagick imlib ipv6 isdnlog jabber jack java javascript jbig jce jpeg jpeg2k junit kde kdehiddenvisibility kerberos ladspa latex lcms ldap leim libgda libnotify libsamplerate libwww lirc lm_sensors logrotate lua m17n-lib mad matroska mbox midi mikmod milter mime mmap mmx mng modplug mono mp3 mpeg mpi mplayer msn mudflap musepack ncurses nls nptl nptlonly nsplugin odbc offensive ogg oggvorbis openal opengl openmp oscar oss pam pcntl pcre pdf perl png postgres ppds pppd profile pulseaudio python qt3 qt3support qt4 quicktime readline recode reflection ruby sasl sdl seamonkey session sharedmem sndfile snmp sockets sox speex spell spl sqlite3 sse sse2 ssl subversion svg sysvipc tcl tcltk tcpd tetex theora threads tiff tk truetype uicktime unicode usb v4l v4l2 vim-syntax vorbis win32codecs wmf wxwindows x264 x86 xattr xcb xface xine xml xml2 xorg xulrunner xv xvid yahoo zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CAMERAS="canon ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en" LIRC_DEVICES="asusdh" USERLAND="GNU" VIDEO_CARDS="radeon vesa fbdev vga"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2008-04-15 20:11:06 UTC
Because a package provides a bad init script does not mean it's base-system's problem.
Comment 2 Paolo Pedroni 2008-04-16 12:16:11 UTC
Same problem.

# emerge --info
Portage 2.1.4.4 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.24-gentoo-r4 x86_64)
=================================================================
System uname: 2.6.24-gentoo-r4 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
Timestamp of tree: Wed, 16 Apr 2008 06:00:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17-r1
dev-java/java-config: 1.3.7, 2.1.4
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.0/env /usr/kde/4.0/share/config /usr/kde/4.0/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache collision-protect distcc distlocks fixpackages metadata-transfer sandbox sfperms strict test unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ http://ftp.vein.hu/pub/linux/distributions/gentoo/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LINGUAS="it"
MAKEOPTS="-j14"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://pedroni03/gentoo-portage"
USE="X Xaw3d a52 aac aalib acpi alsa amd64 ao arts audiofile avahi bash-completion berkdb bluetooth bzip2 cairo caps cddb cdparanoia cdr cli cracklib crypt cups curl dbus dga dio dri dvd dvdr dvdread emboss encode exif expat fam fbcon ffmpeg fftw firefox flac fontconfig foomaticdb fortran ftp gd gdbm ggi gif glut gmp gnutls gphoto2 gpm gtk guile hal htmlhandbook iconv idn ieee1394 imagemagick imlib isdnlog jack java javascript jbig jikes jpeg jpeg2k kde kdeenablefinal lcms libcaca libsamplerate lm_sensors lua lzo mad maildir matroska memlimit midi mikmod mime mmap mmx mng mozilla mp3 mpeg mpi mplayer mudflap ncurses nls nptl nptlonly nsplugin offensive ogg openal openexr opengl openmp oss pam pcre pdf perl png portaudio posix ppds pppd python qt3 qt3support qt4 quicktime rdesktop readline recode reflection ruby samba sdl session sharedmem shorten sndfile sockets sox speex spell spl sse sse2 ssl startup-notification svg symlink syslog sysvipc tcl tcpd theora threads tidy tiff tk truetype unicode usb vcd vim-syntax vorbis wmf wxwindows x264 xcb xcomposite xine xinerama xml xorg xosd xpm xscreensaver xv xvid yahoo zlib" ALSA_CARDS="intel8x0 virmidi" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="kodak ptp2" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Guillaume Castagnino 2008-04-17 05:30:24 UTC
Hi,

A solution could be to add the "--name" option to start-soap-daemon :

start() {
        ebegin "Starting spamd"
        start-stop-daemon --start --quiet --name spamd \
                --nicelevel ${SPAMD_NICELEVEL:-0} \
                --exec /usr/sbin/spamd -- -d -r ${PIDFILE} \
                        ${SPAMD_OPTS}
        eend $? "Failed to start spamd"
}

This fixes the problem with openrc and also works with baselayout 1.12.
See bug #215031 related to postgrey : this is the same problem (and same solution)
Note that #218008 is a duplicate.
Comment 4 Roger 2008-04-18 20:39:20 UTC
Solution provided in Comment  #3 doesn't work here.

=mail-filter/spamassassin-3.2.4

# service spamd restart
 * Caching service dependencies ...                                                                [ ok ]
 * Starting spamd ...
 * start-stop-daemon: /usr/sbin/spamd died
 * Failed to start spamd                                                                           [ !! ]
 * ERROR: spamd failed to start

However, a new spamd process, *only if* no previous spamd process is currently running.

# ps -ax |grep spamd
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
11233 ?        Rs     0:01 /usr/sbin/spamd 5 -d -r /var/run/spamd.pid -m 1 -c -H

(FYI: Comment #3 seems like a hack rather then a solution?)
Comment 5 Roger 2008-04-18 20:43:22 UTC
Wish I could strike my last comment. :-/

I failed to see "--name spamd" (instead only typed "--name" omitting the following "spamd")!

(ARG! The only reason I hate bugzilla, I can't strike my own mistakes ;-)


Works here now!
Comment 6 Roger 2008-04-18 20:54:38 UTC
Created attachment 150233 [details, diff]
Patch for "files/3.0.0-spamd.init"

Adds --name option to /etc/init.d/spamd
Comment 7 Markus Krainer 2008-06-02 13:52:20 UTC
This bug is open for more than 6 weeks! 
Is it really that hard to add this tiny patch?
Comment 8 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2009-03-20 01:21:44 UTC
(In reply to comment #7)
> This bug is open for more than 6 weeks! 
> Is it really that hard to add this tiny patch?
> 

This patch has already been added to Gentoo. Please see mail-filter/spamassassin-3.2.5. However, even with the --name option, the scripts fail with sys-apps/openrc-0.4.3-r1.

The reason for failure is that passing spamd the -d option causes spamd to fork and let the initial process die. The following is guessed: The initial process is named spamd and openrc pick up on the process. That process, after bearing children, dies, so openrc says:
spamd            |* start-stop-daemon: /usr/sbin/spamd died
And yet I can see the processes in ``ps -Aef |grep spamd'' and ``cat /var/run/spamd.pid''. But the pidfile isn't created for 5 seconds and, currently, openrc won't wait 5 seconds for me and check the pidfile then (when using the --pidfile option).

Thus, I propose this method of launching spamd:
remove the -d option from spamd and add the --background option to start-stop-daemon. I use this on my system to get the spamass-milter initscript to run.

I would also recommend the following change to the script: the ``kill -HUP'' in reload() should be replaced with ``start-stop-daemon --signal HUP --pidfile ${PIDFILE}'' . I'm not sure if the baselayout-1's start-stop-daemon supports the --signal option, though.
Comment 9 Peter Ruskin 2009-10-31 20:00:01 UTC
Re: Comment 8

That fixes it for me.  Thanks.
Comment 10 Peter Ruskin 2009-11-01 14:50:45 UTC
Except, although spamd is running OK and /var/log/rc shows no errors, "rc-status" always reports spamd as "crashed".  I'm on ~amd64 here.
Comment 11 David Abbott (RETIRED) gentoo-dev 2010-04-19 10:35:02 UTC
Updated init.d script provided with spamassassin-3.3.1-r1 please test.
Comment 12 Peter Ruskin 2010-04-19 13:30:40 UTC
Works here now.