[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Daemontools



Quoting Klaus Reimer <kay@debian.org>:
> Hi,
> 
> > : No, I think this isn't working, too. If I upgrade proftpd, the init
> > : script will be re-created and the next reboot causes TWO proftpd
> > : instances to run.
> > man dpkg-divert
> 
> Sounds interesting. Just to be sure, I understand that thing: Do you mean I 
> should "divert" /etc/init.d/proftpd and replace this file with an empty file 
> (If I remove it, upgrades to proftpd failes, because the file is executed 
> (start/stop)). And if I remove my package I shall simply remove the diversion 
> and everything is fine? If this is working and everybody is happy with it, I 
> will do it in that way.

Since your package provides a wrapper around proftpd, shouldn't it
divert /usr/sbin/proftpd and call the diverted file once the
wrapper has done what wrappers do?

A simple example: I want to log every time proftpd starts, so I do:

dpkg-divert --package <your-pkgname> --rename --divert \
  /usr/sbin/proftpd.real /usr/sbin/proftpd
cat > /usr/sbin/proftpd <<eof
#! /bin/sh
mailx root -s 'ProFTPD just started'
exec -a proftpd /usr/sbin/proftpd.real "$@"
# notreached
eof
chmod a+x /usr/sbin/proftpd

Once you've finished with the wrapping, do the reverse.

Cheerio,

Andrew Stribblehill
Systems programmer, IT Service, University of Durham, England



Reply to: