next up previous
Next: Init file parser Up: Internals Previous: Organization of the Sourcefiles

Overall Design

As stated above the application consists of a daemon and a user level program. The two communicate via a fifo (named pipe). After starting up (reading the initfile and sending itself to background) the daemon sleeps for DEFAULT_INTERVALL or the value specified via the commandline switch -i (in seconds). After the sleep it checks the different flags for work to do. By now two flags are used:

Reread can be set 'by hand' using kill -HUP <pid>, checkrequest is set by the volcheck client.

Then the fifo is checked for an unmount request. If one is present, it is handled. The next step is to go through the table of mountable devices and issue a mount command for each entry. Now the loop starts again. Starting with version 0.08.00, the default is to combine the two steps 'sleep' and 'check fifo' into one using select(). This function returns if either the fifo holds data or the timeout occurred. The read from the fifo is only done when it actually has data ready. This should reduce system load. As of version 0.09.05 an additional option (SKIPROUND) was added to allow for a delay to be added before an ejected device is tried again. This is intended to help with the problem that ATAPI CDROM drives close the tray upon the mount is tried. The duration is controlled by the compile time option SKIP_ROUNDS, which gives the number of subsequent mount operations to leave out.

The process is ended when a signal (SIGTERM or SIGQUIT) is received. In this case the fifo is deleted and all devices mounted by the daemon are unmounted. A compile time flag can be used to extend this to call unmount for all devices in the configuration file.


next up previous
Next: Init file parser Up: Internals Previous: Organization of the Sourcefiles


Fri Sep 25 18:04:42 GMT 1998