TOAD(8)

NAME
toad - device automounter for hotplugd(8)

SYNOPSIS
toad action devclass devname

DESCRIPTION
toad (Toad Opens All Devices) is a utility meant to be started from the hotplugd(8) attach and detach scripts. It will try to mount all partitions found on the device under /run/media/${USER}/device. Where ${USER} is the active user login name and device is the type of the device, usb or cd, followed by its number (from 0 to 9). This follows the udev hierarchy in Linux which allows interaction with GLib/GIO's GUnixMount.

Users outside the default UID range (1000...60000) are ignored (nothing will be done).

The arguments are as follows:

action
    Can be attach (for device attachment) or detach (for device detachment).

devclass
    Integer corresponding to the device class as described in the <sys/device.h> header file, e.g. 2 for disk drives.

devname
    Device name as listed in MAKEDEV(8), and the unit number, e.g. sd1.

Detection of the currently active user is done using ConsoleKit and DBus, toad will not do anything unless these are properly setup and running. Obviously, hotplugd(8) must be running as well. rcctl(8) can be used to enable and start hotplugd(8) and dbus-daemon(1):

    rcctl enable hotplugd messagebus
    rcctl start hotplugd messagebus

EXAMPLES
This sample code can be used for both the attach and detach scripts:

    #!/bin/sh
    DEVCLASS=$1
    DEVNAME=$2
    case $DEVCLASS in
    2)
    	/usr/local/libexec/toad ${0##*/} $DEVCLASS $DEVNAME
    	;;
    esac

SEE ALSO
dbus-daemon(1), hotplugd(8)

AUTHORS
Antoine Jacoutot <antoine@mtier.org>