
Don’t Let Elvis Leave the Building #73
Chapter 9, Administration and Automation
|
225
HACK
HACK
#73
Don’t Let Elvis Leave the Building Hack #73
Keep a program running in the background by automatically restarting it
whenever it exits.
Some programs behave contrary to our wishes and exit prematurely, either
because they are designed to do so, or because they are flaky and prone to
crashing. This hack provides a neat trick to restart such programs automati-
cally every time they exit.
The xcompmgr program that provides drop shadows and other special
effects for Xorg is still a work in progress, and it often exits unexpectedly.
With a simple script, you can automatically restart it every time it exits.
First, log in as root, fire up your favorite editor, and create the following
script, naming it /usr/local/bin/keep-xcompmgr-running:
Figure 9-1. The Gnome Sessions settings dialog