@damaru: A classic SYSV init script
Lemme dig up the interesting runlevels, but, OTOH, 5 is boot, 6 is reboot, 0 is shutdown, and 3 is update.
For example, the same script I linked to earlier, but in its K3 version: ScreenSavers hack
. (Check the install script for more details on the whole symlinking into the right runlevel stuff).