Sorry, I meant to post this to the mailing list. -- Brian May <[EMAIL PROTECTED]>
--- Begin Message ---On Fri, Sep 10, 1999 at 07:32:45AM -0400, Norris Preyer wrote: > Brian May <[EMAIL PROTECTED]> writes: > > > I have a script to put in /etc/init.d/X that will automatically > > restart X as required, in my diskless boot package. Please > > ask for further details. > > > > -- > > Brian May <[EMAIL PROTECTED]> > > [2 <application/pgp-signature>] > > I'm very interested in this too--could you post to the newsgroup, > please?Ok. In /etc/inittab, I have the line: 7:23:respawn:/etc/init.d/X vt7 -group_x (where group_x is replaced by the appropriate parameter by M4, eg indirect localhost). The /etc/init.d/X file is attached. Comments welcome. The only possibly strange part is that the script delays for 5mins if there isn't a valid XF86Config file, this prevents inetd from complaining that the service is restarting too frequently. -- Brian May <[EMAIL PROTECTED]>#!/bin/sh # /etc/init.d/X: start or stop the X display manager set -e PATH=/bin:/usr/bin:/sbin:/usr/sbin DAEMON=/usr/bin/X11/X PARAMS="$*" LOG=/var/log/X.log exec > $LOG 2>&1 test -x $DAEMON || exit 0 if head -1 /etc/X11/Xserver 2> /dev/null | grep -q Xsun; then # the Xsun X servers do not use XF86Config CHECK_LOCAL_XSERVER= else CHECK_LOCAL_XSERVER=yes fi if [ "$CHECK_LOCAL_XSERVER" ]; then problem=yes echo -n "Checking for valid XFree86 server configuration..." if [ -e /etc/X11/XF86Config ]; then if [ -x /usr/sbin/parse-xf86config ]; then if parse-xf86config --quiet --nowarning --noadvisory /etc/X11/XF86Config; then problem= else echo "error in configuration file." fi else echo "unable to check." fi else echo "file not found." fi if [ "$problem" ]; then echo "Not starting X display manager." echo "Pausing for five minutes." sleep 300 exit 1 else echo "done." fi fi echo "Starting X server: X" $DAEMON $PARAMS exit 0
pgpmWj1dnHmJe.pgp
Description: PGP signature
--- End Message ---
pgpGZkPq5Ad6c.pgp
Description: PGP signature