login
Header Space

 
 

Re: problems getting X running

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Monday, August 24, 1992 - 4:43 pm

In article <Aug.19.22.38.33.1992.8120@athos.rutgers.edu> hedrick@athos.rutgers.edu (Charles Hedrick) writes:

I've had the same problem with MGR and X11.  Configuring either one is
incredibly frustrating because of the need to capture output blindly, then
reboot if things go wrong.  I got so sick of this a few months ago that
I wrote the following (tiny) script.

BTW, I would appreciate it if someone would post at least one followup to this
article, since I'm not sure my postings are making it out into the world.

===== file test_x starts on next line =====
#!/bin/sh -
echo kill -HUP $$ > /tmp/kill_x
echo exec rm /tmp/kill_x >> /tmp/kill_x
(sleep 10; /binsh /tmp/kill_x) &
exec startx
# end of file test_x

Don't forget to make this file executable (chmod +x test_x).

For the 'sh impaired' :-), here's what test_x does; skip it if you don't care
or already know:

line 1) "tells" the kernel to run this script with the program /bin/sh
line 2) $$ is used here.  It expands to the current process number -- the
        process number when test_x is executed.  This line therefore creates a
        file 'kill_x' in /tmp that contains a command to send a hangup signal
        (HUP) to the current process number.
line 3) adds a line to /tmp/kill_x that will remove the file /tmp/kill_x (I'm
        a neat freak :-).  See line 5 for an explanation of the 'exec'
line 4) creates a subshell (in the background due to the '&') that will pause
        for 10 seconds, then execute the script /tmp/kill_x using /bin/sh.
        A 10 second delay is long enough for me to see if the current config-
        uration in Xconfig has worked.  You may need to lengthen it if your
        machine is slower than mine.
line 5) executes the command 'startx'.  The 'exec' causes execution of the
        script ('test_x') to cease, and begins executing the following command
        ('startx') *using the same process number* (I think this is also called
        chaining).  Thus, when /tmp/kill_x is executed after the 10-second
        delay, the process to which kill_x sends the HUP is 'startx', which
        will terminate the X server *cleanly*.

You may now proceed to examing debugging output on your text screen, or modify
Xconfig and try again.
---
Claude Morin
(that's "klode", NOT "clod"...French :-)
London, Ontario, Canada
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

This is the only confirmed message in this thread.
Possibly related messages:
speck-geostationary