Bug#361785: hal: Breaks autofs expiry

2006-05-03 Thread Roland Mas
Roland Mas, 2006-04-23 15:27:27 +0200 :

 And here's a patch implementing that suggestion.

That patch applies cleanly onto 0.5.7-2, except for the changelog part
(hint hint).

Roland.
-- 
Roland Mas

It would be hard to be deader without special training.
  -- in Theatre of Cruelty (Terry Pratchett)


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



Bug#361785: hal: Breaks autofs expiry

2006-04-23 Thread Roland Mas
Roland Mas, 2006-04-10 11:48:06 +0200 :

[...]

 seconds of non-usage.  Unfortunately, it seems hal catches this unmount
 event and does stuff with it, which I wouldn't argue against, except it
 tries to access /mnt/auto/removable/usb-key/.created-by-hal.

When I think about it, I end up concluding that this file (or
directory or whatever it is) doesn't belong there.  Even if I wanted
to let HAL mount and unmount stuff, there's no guarantee that the
filesystem containing the mountpoints is writable.  Such state
information should therefore be stored somewhere else, like /var/run,
which seems more appropriate and should fix both problems.

Roland.
-- 
Roland Mas

  ()Campagne du ruban ASCII :
  /\Contre les mails en HTML et les vcard !


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



Bug#361785: hal: Breaks autofs expiry

2006-04-23 Thread Roland Mas
Roland Mas, 2006-04-23 11:54:37 +0200 :

 When I think about it, I end up concluding that this file (or
 directory or whatever it is) doesn't belong there.  Even if I wanted
 to let HAL mount and unmount stuff, there's no guarantee that the
 filesystem containing the mountpoints is writable.  Such state
 information should therefore be stored somewhere else, like
 /var/run, which seems more appropriate and should fix both problems.

And here's a patch implementing that suggestion.  It works for me,
since it allows autofs to expire mountpoints again, and it seems not
to prevent Gnome from mounting and unmounting USB keys automagically.
I haven't tested that second part very thouroughly though, since it's
not in my regular usage patterns.  Feel free to rewrite if needed :-)

Roland.
-- 
Roland Mas

It would be hard to be deader without special training.
  -- in Theatre of Cruelty (Terry Pratchett)
diff -ruN hal-0.5.7/debian/changelog hal-0.5.7+lolando/debian/changelog
--- hal-0.5.7/debian/changelog  2006-04-23 15:13:03.0 +0200
+++ hal-0.5.7+lolando/debian/changelog  2006-04-23 15:16:18.0 +0200
@@ -1,3 +1,11 @@
+hal (0.5.7-1+lolando) unstable; urgency=low
+
+  * debian/patches/07_state_files_location.patch
++ Added.  Change location of .created-by-hal files.
+  * Fixed hal.dirs and hal.init.dbus accordingly.
+
+ -- Roland Mas [EMAIL PROTECTED]  Sun, 23 Apr 2006 15:16:18 +0200
+
 hal (0.5.7-1) unstable; urgency=low
 
   * New upstream release
diff -ruN hal-0.5.7/debian/hal.dirs hal-0.5.7+lolando/debian/hal.dirs
--- hal-0.5.7/debian/hal.dirs   2006-04-23 15:13:03.0 +0200
+++ hal-0.5.7+lolando/debian/hal.dirs   2006-04-23 13:36:50.0 +0200
@@ -1,2 +1,3 @@
 /var/run/hal
+/var/run/hal/storage-states
 /etc/hal/fdi
diff -ruN hal-0.5.7/debian/hal.init.dbus hal-0.5.7+lolando/debian/hal.init.dbus
--- hal-0.5.7/debian/hal.init.dbus  2006-04-23 15:13:03.0 +0200
+++ hal-0.5.7+lolando/debian/hal.init.dbus  2006-04-23 13:38:09.0 
+0200
@@ -12,6 +12,7 @@
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/sbin/hald
 PIDDIR=/var/run/hal
+STATE_DIR=/var/run/hal/storage-states
 PIDFILE=$PIDDIR/hald.pid
 NAME=hald
 DAEMONUSER=hal
@@ -33,6 +34,10 @@
 mkdir -p $PIDDIR
 chown $DAEMONUSER:$DAEMONUSER $PIDDIR
   fi
+  if [ ! -d $STATE_DIR ]; then
+mkdir -p $STATE_DIR
+chown $DAEMONUSER:$DAEMONUSER $STATE_DIR
+  fi
log_daemon_msg Starting $DESC $NAME
start-stop-daemon --start --pidfile $PIDFILE \
--exec $DAEMON -- $DAEMON_OPTS
diff -ruN hal-0.5.7/debian/patches/07_state_files_location.patch 
hal-0.5.7+lolando/debian/patches/07_state_files_location.patch
--- hal-0.5.7/debian/patches/07_state_files_location.patch  1970-01-01 
01:00:00.0 +0100
+++ hal-0.5.7+lolando/debian/patches/07_state_files_location.patch  
2006-04-23 13:34:34.0 +0200
@@ -0,0 +1,188 @@
+diff -Nur hal-0.5.7-old/hald/linux2/blockdev.c hal-0.5.7/hald/linux2/blockdev.c
+--- hal-0.5.7-old/hald/linux2/blockdev.c   2006-02-24 05:29:06.0 
+0100
 hal-0.5.7/hald/linux2/blockdev.c   2006-04-23 12:38:39.0 +0200
+@@ -251,7 +251,7 @@
+   device_property_atomic_update_end ();
+   HAL_INFO ((set %s to unmounted, hal_device_get_udi (dev)));
+ 
+-  mount_point_hal_file = g_strdup_printf (%s/.created-by-hal, 
mount_point);
++  mount_point_hal_file = g_strdup_printf 
(%s/%s/.created-by-hal, STATE_DIR, mount_point);
+   if (g_file_test (mount_point_hal_file, G_FILE_TEST_EXISTS)) {
+   char *cleanup_stdin;
+   char *extra_env[2];
+diff -Nur hal-0.5.7-old/hald/linux2/blockdev.h hal-0.5.7/hald/linux2/blockdev.h
+--- hal-0.5.7-old/hald/linux2/blockdev.h   2005-12-08 20:03:02.0 
+0100
 hal-0.5.7/hald/linux2/blockdev.h   2006-04-23 12:38:39.0 +0200
+@@ -28,6 +28,8 @@
+ 
+ #include glib.h
+ 
++#define STATE_DIR /var/run/hal/storage-states
++
+ void hotplug_event_begin_add_blockdev (const gchar *sysfs_path, const char 
*device_file, gboolean is_partition, HalDevice *parent, void *end_token);
+ 
+ void hotplug_event_begin_remove_blockdev (const gchar *sysfs_path, gboolean 
is_partition, void *end_token);
+diff -Nur hal-0.5.7-old/tools/hal-luks-remove hal-0.5.7/tools/hal-luks-remove
+--- hal-0.5.7-old/tools/hal-luks-remove2006-02-13 08:29:44.0 
+0100
 hal-0.5.7/tools/hal-luks-remove2006-04-23 12:38:39.0 +0200
+@@ -6,6 +6,8 @@
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License version 2.
+ 
++STATE_DIR=/var/run/hal/storage-states
++
+ if [ $HAL_PROP_BLOCK_DEVICE ==  ] || [ $HAL_PROP_INFO_UDI ==  ] || [ 
$HAL_PROP_VOLUME_UUID ==  ] ; then
+ echo Missing or empty environment variable(s). 2
+ echo This script should be started by hald. 2
+@@ -22,9 +24,9 @@
+ if [ ! 

Bug#361785: hal: Breaks autofs expiry

2006-04-10 Thread Roland Mas
Package: hal
Version: 0.5.7-1
Severity: normal

I have an autofs mount for my USB key, so that it gets mounted on
/mnt/auto/removable/usb-key when accessed.  autofs has an expiry time of
30 seconds, which means the key is automatically unmounted after 30
seconds of non-usage.  Unfortunately, it seems hal catches this unmount
event and does stuff with it, which I wouldn't argue against, except it
tries to access /mnt/auto/removable/usb-key/.created-by-hal.  Which
triggers autofs, which in turn mounts /mnt/auto/removable/usb-key again.
So the key is unmounted and automatically remounted every 30 seconds if
I don't use it, which means I can't unplug it cleanly.

For some reason, this behaviour only appears for the USB key and the
(USB mass storage) digital camera, but not for the CD-ROM.  USB key has
an ext3 filesystem on it, camera has vfat.

Killing hald fixes the problem (the automounts get to properly expire).
Restarting it restarts the problem.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1-k7
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages hal depends on:
ii  adduser   3.85   Add and remove users and groups
ii  dbus  0.61-5 simple interprocess messaging syst
ii  libc6 2.3.6-5GNU C Library: Shared libraries an
ii  libdbus-1-2   0.61-5 simple interprocess messaging syst
ii  libdbus-glib-1-2  0.61-5 simple interprocess messaging syst
ii  libexpat1 1.95.8-3.2 XML parsing C library - runtime li
ii  libglib2.0-0  2.10.2-1   The GLib library of C routines
ii  libhal1   0.5.7-1Hardware Abstraction Layer - share
ii  libusb-0.1-4  2:0.1.12-2 userspace USB programming library
ii  lsb-base  3.0-16 Linux Standard Base 3.0 init scrip
ii  pciutils  1:2.1.11-16Linux PCI Utilities
ii  udev  0.089-1/dev/ and hotplug management daemo
ii  usbutils  0.71+cvs20051029-5 USB console utilities

hal recommends no packages.

-- no debconf information


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