During system shutdown, what would be the best was to execute some code after the drives have been unmounted?
The system consists of a x86 system running Debian Linux from a CompactFlash. On the end product there will be no monitor so I need to disable a LED (simple I/O write) to indicate to the user that it is safe to power-down.
My current train of thought is to write a daemon that loads at startup and does the I/O write at exit. But, being a linux noob, I'm not sure how to a) hook the system shutdown to the daemon or b) tie into the exit functionality within the daemon code.