Bug#301671: apt-listbugs: cron.daily destroys the contents of symlinked /etc/apt/preferences

2005-04-11 Thread paddy
Thanks for the quick reply, Steve.
I didn't mean to imply that it wasn't a good reason.
I take it that all such removals are documented by the RC bugs.

The contents of the preferences file seem to get destroyed by the
line:

  /usr/share/apt-listbugs/aptcleanup  /etc/apt/preferences.apt-listbugs.$$

when it is writing to the same file it is reading from.

Perhaps something more like:
(stealing shamelessly from /etc/cron.monthly/acct)

  #!/bin/sh -e
  
  prefclean() {
  
test -x /usr/share/apt-listbugs/aptcleanup || return 0
test -x /usr/sbin/apt-listbugs || return 0
test -f /etc/apt/preferences || return 0
  
PTMP=$(tempfile)
/usr/share/apt-listbugs/aptcleanup  $PTMP
if ! diff $PTMP /etc/apt/preferences  /dev/null; then
  savelog /etc/apt/preferences
  mv $PTMP /etc/apt/preferences
fi
/bin/rm -f $PTMP
  
  }
  
  prefclean
  
savelog doesn't seem to handle the symlink either.

better options might be something along the lines of

  cp -aH /etc/apt/preferences /etc/apt/preferences.0

or resolving the symlink and rotating in the parent directory of the file.

(the difference between making the backup at the client or the server
in Zed's configuration where preferences is mounted shared from a server)

or perhaps savelog should.

Regards,
Paddy
-- 
Perl 6 will give you the big knob. -- Larry Wall


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#301671: apt-listbugs: cron.daily destroys the contents of symlinked /etc/apt/preferences

2005-04-11 Thread paddy
On Mon, Apr 11, 2005 at 01:33:16PM +0100, paddy wrote:
 PTMP=$(tempfile)
 /usr/share/apt-listbugs/aptcleanup  $PTMP
 if ! diff $PTMP /etc/apt/preferences  /dev/null; then
   savelog /etc/apt/preferences
   mv $PTMP /etc/apt/preferences
 fi

D'oh!

s/mv/cp/

Regards,
Paddy
-- 
Perl 6 will give you the big knob. -- Larry Wall


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#301671: apt-listbugs: cron.daily destroys the contents of symlinked /etc/apt/preferences

2005-04-06 Thread paddy
Hi,

[EMAIL PROTECTED] writes:
snip
 If you don't notice it before the next night's autoupgrade sequence 
 suddenly tries to update a bunch of machines on your network to 
 unstable, breaking them all
snip

*ouch* that would hurt.

I just noticed that:

 Why is package X not in testing yet?
 Checking apt-listbugs
 
 * apt-listbugs is scheduled for removal
 * Removal request by vorlon 
 
Is this because of this bug ?

From your description, the real problem is with aptcleanup?
which sadly I don't understand, yet.

Does this cron job even need to be enabled by default?

I really like apt-listbugs, it would be a shame to lose it.

On a rather silly note, 

Perhaps there should be a mechanism in apt-listbugs to issue a recall
by placing a bug in the BTS.  It could then issue a message along 
the lines of:

### 
### We have just recieved an urgent message 
###  from an apt-bugs in the future.
### 
###  This mission will now self-terminate.
###  Expect the replacement agent shortly.
###

or perhaps this is a job better left to apt-removebugs ...

Regards,
Paddy
-- 
Perl 6 will give you the big knob. -- Larry Wall


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#301671: apt-listbugs: cron.daily destroys the contents of symlinked /etc/apt/preferences

2005-04-06 Thread Steve Langasek
On Wed, Apr 06, 2005 at 05:32:55PM +0100, paddy wrote:
 [EMAIL PROTECTED] writes:
 snip
  If you don't notice it before the next night's autoupgrade sequence 
  suddenly tries to update a bunch of machines on your network to 
  unstable, breaking them all
 snip

 *ouch* that would hurt.

 I just noticed that:

Why is package X not in testing yet?
Checking apt-listbugs

* apt-listbugs is scheduled for removal
* Removal request by vorlon 

 Is this because of this bug ?

Yes, apt-listbugs has already been removed from testing because of this bug.
I'd be glad to see apt-listbugs included in sarge, but apparently it needs
to be fixed first to not destroy users' configs.

-- 
Steve Langasek
postmodern programmer


signature.asc
Description: Digital signature


Bug#301671: apt-listbugs: cron.daily destroys the contents of symlinked /etc/apt/preferences

2005-03-27 Thread Zed Pobre
Package: apt-listbugs
Version: 0.0.47
Severity: critical
Justification: causes serious data loss

I have a network where /etc/apt/preferences (and a lot of other files
in /etc on various machines) are symlinked to a NFS-mounted drive so
they can be changed globally.  Unfortunately, the cron.daily file for
apt-listbugs doesn't take this into account, and so when it makes a
backup of the file before changing it, only creates a backup symlink,
then edits the first file, destroying all of the contents in the
master.

If you had a complex preferences file, and you don't have a backup,
this is very, very bad.  If you don't notice it before the next
night's autoupgrade sequence suddenly tries to update a bunch of
machines on your network to unstable, breaking them all, that is even
worse.

I managed to avoid this fate only barely.  Eventually, someone else
isn't going to be as fortunate, and become very unhappy with Debian.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.10.erdos
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1) (ignored: LC_ALL set to 
en_US)

Versions of packages apt-listbugs depends on:
ii  apt   0.5.27 Advanced front-end for dpkg
ii  libdpkg-ruby1.8   0.3.1  modules/classes for dpkg on ruby 1
ii  libintl-gettext-ruby1.8   0.11-5 Gettext wrapper for Ruby 1.8
ii  libruby1.8 [libzlib-ruby1.8]  1.8.2-3Libraries necessary to run Ruby 1.
ii  libxml-parser-ruby1.8 0.6.8-1Interface of expat for the scripti
ii  ruby  1.8.1-8An interpreter of object-oriented 

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]