This one time, at band camp, Chris Lawrence said: > > > >[EMAIL PROTECTED]:/home/joey>/etc/init.d/clamav-freshclam start > >+ start_daemon /usr/bin/freshclam -p /var/run/clamav/freshclam.pid -d > >--quiet > >+ local force nice pidfile exec i > >+ force=0 > >+ nice=0 > >+ pidfile=/dev/null > >+ getopts fn:p: opt > >+ shift 2 > >+ '[' /var/run/clamav/freshclam.pid = -- ']' > >+ exec=/var/run/clamav/freshclam.pid > >+ shift > >+ '[' 0 = 1 ']' > >+ '[' /dev/null ']' > >+ /sbin/start-stop-daemon --start --nicelevel 0 --quiet --exec > >/var/run/clamav/freshclam.pid --oknodo --pidfile /dev/null -- -d --quiet > > > >If this is a bug in clamav-freshclam for passing the daemon to start before > >the options, please reassign the bug; I haven't checked the LSB and this > >package doesn't seem to bother to document start_daemon's syntax > >internally. > > The LSB does require that all options be specified before the > executable name; I am revising README.Debian in lsb-base to include > documentation of all of the functions.
The command line options are options to be passed to freshclam on startup, on the right side of the -- in the s-s-d call. They are not arguments to start_daemon. The problem here is that the clamav init scripts use other functions from lsb before running start_daemon, and OPTIND is still > 1 in the second call. This makes the getopt run in start_daemon do the wrong thing, and it misparses the arguments. I have worked around this in the clamav init scripts by manually setting OPTIND=1 before each invocation of start_daemon (as that's the only function where ordering matters). Joey, can you please test that 0.88.4-2 works correctly for you? It does here, but I wouldn't mind a second set of eyes on it. Chris, can you take a look at the patch in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=381822;msg=15;att=0 and see if that looks OK? It sets OPTIND before each getopt call to avoid these issues, and it also cleans up the remaining mistakes in my original patch to you. Thanks all, -- ----------------------------------------------------------------- | ,''`. Stephen Gran | | : :' : [EMAIL PROTECTED] | | `. `' Debian user, admin, and developer | | `- http://www.debian.org | -----------------------------------------------------------------
signature.asc
Description: Digital signature