Hi On Mon, Feb 08, 2010 at 11:32:17PM +0100, J.M.Roth wrote: > >>>> First, postrm does not check for the possible location of the init.cfg > >>>> file in /var/lib/ntop/ => fixed > >>> > >>> True and intentional. With the debian package /etc/ntop/init.cfg is > >>> the place where it should be. > >> > >> However, after a new installation there is no (default) one there. > > > > It isn't? I must have missed that one then. > > # ls -l /etc/ntop > total 4568 > -rw-r--r-- 1 root root 2342693 May 9 2003 AS-list.txt > -rw-r--r-- 1 root root 87090 May 8 2006 etter.finger.os > -rw-r--r-- 1 root root 1977 Jan 2 2002 ntop-cert.pem > -rw-r--r-- 1 root root 1215373 Dec 1 2004 oui.txt > -rw-r--r-- 1 root root 997574 Feb 16 2004 p2c.opt.table > -rw-r--r-- 1 root root 382 Aug 6 2008 protocol.list > -rw-r--r-- 1 root root 2998 Apr 24 2003 specialMAC.txt
Hmm. This must have been changed on the way... > >>>> Second, there is no ntop/createuser entry in debconf, as none is added > >>>> in the config file => check removed > >>> > >>> True. But it has been so in the past. It is still there to make > >>> transitions possible. However it has not been there for quite some > >>> time, so it could potentially be removed. > >>> > >>> But the way you propose would cause users to be removed always which > >>> is not good. > >>>> if [ "$1" = "purge" ] ; then > >> > >> The whole case /is/ about ntop being purged... > > > > Yes, but this would violate it anyway. Assume that someone have created > > a user ntop before the package is installed. Then that is broken > > afterwards. > > Yeah... well... is it possible NOT to create a user for ntop at > installation time? > If that is not the case (i.e. one always has to create a user) then one > should check at install time if the user already exists and warn that it > might be purged on uninstall. You are right. This is also something that I have changed on the way. Thanks. > >>> What happens if there are no /var/lib/ntop/init.cfg /etc/ntop/init.cfg > >>> files? Then the installation would break. I do not like this one. > >> > >> The user would not be removed in that case. > > > > User? > > Yeah, the user "ntop" -- postrm after the patch would look like: > > if [ "$1" = "purge" ] ; then > > # source debconf library > if [ -f /usr/share/debconf/confmodule ]; then > . /usr/share/debconf/confmodule > fi > > for f in /var/lib/ntop/init.cfg /etc/ntop/init.cfg; do > if [ -f $f ]; then > INIT=$f > fi > done > if [ -n "$INIT" ]; then > # parse config file for user > . $INIT > > # remove user > if grep -q ^$USER: /etc/passwd; then > deluser $USER > fi > fi > > # Remove init.cfg file and dir > if [ -d /etc/ntop ]; then > rm -rf /etc/ntop > fi > # remove stored data > if [ -d /var/lib/ntop ]; then > rm -rf /var/lib/ntop > fi > if [ -d /var/log/ntop ]; then > rm -rf /var/log/ntop > fi > > db_purge > > update-rc.d -f ntop remove >/dev/null > fi > > i.e. if none of the config files was there, the deluser command finally > would not be executed, as in the original script. Ok. thanks. // Ola > JM > > > -- --------------------- Ola Lundqvist --------------------------- / o...@debian.org Annebergsslingan 37 \ | o...@inguza.com 654 65 KARLSTAD | | http://inguza.com/ +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --------------------------------------------------------------- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org