|
|
||
A Slackware Desktop Enhancement GuideAutomagically Running Programs During Startup and Shutdown© Copyright Darrell Anderson. Running programs automatically is something computers are well designed for. Unfortunately, operating system developers tend to ignore that users might want to run programs other than system programs during startup and shutdown. Yet configuring the Slackware box to provide such a feature is a straightforward process. For system programs, running programs during startup takes place in the rc.d scripts. Because most of those scripts are configured and developed by the distro vendor, users are encouraged to house their additional individual startup programs in a specific rc.d script called rc.local. The Slackware rc.d scripts are designed to look for this special script at the end of the rc.M script. The respective commands at the end of the rc.M script look like this: # Start the local setup procedure. The default Slackware configuration provides no useful rc.local script and users are expected to customize that file. Appropriate tasks might include running hdparm to enable DMA for hard drives, enabling Num Lock, enabling the NTP daemon, or running some preliminary “cleanup” scripts. Unfortunately, Slackware provides no direct method for running additional programs or tasks during shutdown. The rc.6 script performs system shutdown tasks and some people add their own specific shutdown programs there, but that process might clutter the original script. A “cleaner” method is to create a separate script to run additional shutdown tasks and then call that one script from within rc.6. Modify the beginning of rc.6 with only one change like this: # Set the path. Insert the call to run the new script just after the rc.6 script establishes a command path and before running any System V scripts. Then create a new script called rc.shutdown and store additional system shutdown tasks there. Of course, be sure to enable the executable bits for both rc.local and rc.shutdown. KDE users can provide additional flexibility because two special directories are available to store KDE-related startup and shutdown tasks. One directory is created automatically when installing KDE and that directory is called ~/.kde/Autostart. The second directory does not exist by default, but KDE will recognize the directory if created. That directory is called ~/.kde/shutdown. The Autostart directory could be used to run Kwikdisk so that the utility is available to mount hard drive partitions on demand. Similarly, the shutdown directory might contain a soft link to a script located in /usr/local/bin that performs some basic housecleaning tasks upon exiting KDE. Only a few years ago system developers ignored users with respect to running programs and tasks at startup and shutdown. Users need no longer concern themselves about that old problem. Finis. |
||