What is Halevts?
----------------

Halevts (HAL events manager) is a daemon that executes arbitrary commands 
when a device with certain properties is added to the system and when 
device properties change. Halevts uses HAL to monitor the state of your 
system's hardware. With the default config file and script, it can handle 
the mounting of media as they are inserted/attached to the system.


Who wrote it?
-------------

The initialization of hal and dbus is based on gnome-volume-manager, 
by Robert M. Love. The remaining is by Patrice Dumas 
<pertusus at free dot fr>.

The design is largely based on Ivman which was written by 
Ikke <eikke at users dot sourceforge dot org>, and
maintained by Rohan McGovern afterwards.


Homepage
--------

http://www.environnement.ens.fr/perso/dumas/halevt.html
You can reach the current maintainer at <pertusus at free dot fr>.


Install
-------

libxml2, D-Bus, glib and D-Bus glib and HAL are required.
A less known library is also needed, boolstuff which may be found at
http://perso.b2b2c.ca/sarrazip/dev/boolstuff.html

Halevts uses the autotools, so may be installed simply with

./configure
make
make install

When run as root (system-wide) the default is to drop privileges 
and run as the halevt user. A make target allows to create this 
user and set the permissions to the directories that it should own:

   make perms

For automounting to work well, it is advisable to have either 
gome-mount or pmount installed for user mount, and pmount
installed for system-wide mounts.

The non standard glibc daemon function is used, it could be missing on
some platform.


Configuration
-------------

The config file is called halevt.xml, it is searched first in the user home 
directory in .halevt/, then in the system configuration directory which is
typcally along /etc/halevt, and last in the vendor directory along 
/usr/share/halevt/. It is an xml file. 

The default file allows the automounting of removable devices. The script
hvmount is used for for that, it allows to keep a list of mounted and inserted
devices. gnome-mount, (hal-)pmount or mount are used to perform the actual 
mount.


Usage
-----

The commands accept the -h switch to show their help.

A typical use would be to add, in login scripts

   halevt -p ~/.halevt/halevt.pid

And in log out scripts

   kill `cat ~/.halevt/halevt.pid`

If you want halevt to run system-wide, you could use the halevt-initscript.
It has been tested on a fedora. It is likely that strange things will happen 
if you mix up running halevt system-wide and as users. There may be some
permission issues when running system-wide. Indeed, the halevt user should
be able to mount device, and users should be granted the right to access
to devices mounted by halevt.

Automatically mounted devices may be umounted by calling

   hvumount <mount_point>

All mounted devices may be umounted by calling

   hvumount -a

If you want to use the automounting facilities, you could also add, in your
startup scripts:

   hvmount clean

This cleans possible stale devices registered by hvmount. This can happen,
for example, if devices are removed after halevt is stopped.

And in log out scripts, to umount all the devices:

   hvumount -a

If you really want to run halevt as root you'll have to specify:
  -u root -g root

When using pmount/pumount you have to unmount all your devices before 
removing the removable media, since pumount cannot operate without the
device file.
