[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[bam@snoopy.apana.org.au: Re: Connecting to another X Server with WDM]



Sorry, I meant to post this to the mailing list.

-- 
Brian May <bam@snoopy.apana.org.au>
--- Begin Message ---
On Fri, Sep 10, 1999 at 07:32:45AM -0400, Norris Preyer wrote:
> Brian May <bam@snoopy.apana.org.au> 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 <bam@snoopy.apana.org.au>
> > [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 <bam@snoopy.apana.org.au>
#!/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

Attachment: pgpTspSVxc3d8.pgp
Description: PGP signature


--- End Message ---

Attachment: pgpNT14ppyfGr.pgp
Description: PGP signature


Reply to: