Bug#279205: exim4-base: Correct with this

Andreas Metzler Andreas Metzler <ametzler@downhill.at.eu.org>, 279205@bugs.debian.org
Wed, 1 Dec 2004 10:23:57 +0100


On 2004-11-06 Andreas Metzler <ametzler@downhill.at.eu.org> wrote:
> On 2004-11-01 Marc Haber <mh+debian-packages@zugschlus.de> wrote:
> > On Mon, Nov 01, 2004 at 02:47:01PM +0100, Antonio Biasio wrote:
> [...]
> > > 	if [ -e $file ]; then exim_tidydb_as_mail /var/spool/exim4 $file >/dev/null
> [...]
> > That's a bad fix. Probably the script should be rewritten with some
> > find construction.
[...]

Hmm.
This one is proper:

if [ -x /usr/sbin/exim_tidydb ]; then
  cd /var/spool/exim4/db || exit 1
  find /var/spool/exim4/db -maxdepth 1 -name '*.lockfile' -or -type f \
    -printf '%f\0' | \
      xargs -0r -n 1 \
      start-stop-daemon --start --exec /usr/sbin/exim_tidydb \
      --chuid Debian-exim:Debian-exim -- /var/spool/exim4 > /dev/null
fi

It is less readable, but afaict the only clean solution. We cannot use
our exim_tidydb_as_mail shell-alias with the find construction and we
need to use find|xargs instead of find -exec because exim_tidydb
expects the name without any path ("./retry" would[1] not work)
              cu andreas
[1] It might work currently, but is not documented to work so we
should not rely on it.
-- 
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"