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/username/device. Where username 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.

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. If the mount(8) is successful and a DISPLAY is available, toad will try to call xdg-open(1) which will start the user's preferred application for opening URIs.

SECURITY NOTES
toad will automatically set the kern.usermount sysctl(3) to allow regular users to mount devices they own.

toad will change the device ownership to the active user just before mounting. It will change it back to root after the mount is done (removable drives) or after ejection (optical media).

EXAMPLES
This same 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
hotplugd(8)

AUTHORS
Antoine Jacoutot <antoine@mtier.org>