I know that Ubuntu (and Fedora) uses Upstart istead of the classical System V init daemon (SysVinit).
I would like to know how to detect when a USB-drive has been insert
In Ubuntu 9.10 and newer Upstart has some udev capabilities through the upstart-udev-bridge
service.
#thumbdrive_special.conf
start on block-device-added
task
script
if [ `blkid $DEV` -eq "YOUR-THUMBDRIVES-UUID" ]; then
/home/you/bin/thumbdrive_special $DEV
fi
end script
I love how simple and elegant upstart can be. However, a DBus solution might be better if less elegant. With a DBus solution you could pop up notifications to the user and provide easy user control.