How should I specify the "start on" condition to run an upstart script when a device (an external disk) is attached?
Yes. Have a read of
man upstart-udev-bridge. Basically anything that can trigger a
udev script can trigger an Upstart event. There's more in the Upstart Cookbook's Bridges section.
#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
The other route is just using udev to trigger run a script when you plug something in. That could be anything, including running a upstart command.
Upstart has a
mounted event but this only comes off the back of the booting mountall call. I don't think it's any use here.