LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-24-2004, 08:43 PM   #1
negface
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Rep: Reputation: 0
Killing X Blindly (by Script)?


Hello,

I'm running Slax 4.1.4 and am having problems with X. I get a black screen, lose keyboard functionality, and must reboot. Ive tried a bunch of stuff with no luck, and now I have an idea thats beyond my know-how.

Id like to edit my xinitrc (or a more relevant script) to include something that will kill X after a given amount of time, like 1 minute, and drop me back to prompt. Since I lose my keyboard, scripting seemed like a natural choice.

I figure if I can get back to prompt and look at the /var/log/Xorg.0.log then I can see whats causing the problem/formulate solution. I cant look at it after reboot because everything is saved in RAM (LiveCD), and dont feel like setting up partitions/finding a floppy.

My assumption is that the script continues to run after I get the black screen and keyboard lockup (which may be false). It might be the case that the whole shebang hangs, which will render this idea pointless.

Here are some of the "bunches of stuff" Ive tried before this:
-Slax's guisafe and guifast scripts (these are just startx's with pre-loaded values. "gui" is the default w/kde and what I try unless otherwise stated)
-startx
-manually editing slax's gui.conf multiple times (including putting in obviously bad but safe values to try and get a different response)
-manually editing the actual gui* script (dont understand why it does xinitrc 2<dev/null <dev/null more than once...)
-running xorgconfig a few times, then doing startx
-creating another user, running x, then trying ctrl+alt+F1/BS and alt+f7 (this is how I found out my keyboard was locking up, cant toggle numlock/capslock either)
-doing the same without making a new user (another root tty)
-asking for help on the slax website
-asking for help on the linuxquestions.org newbie forum
-google searching for solution
-asking my box nicely in binary/japanese/pimp-speak

And some possibly relevant specs:
-nVidia GeForce 3 Ti500
-circa 1999 eMachines eView 17 monitor (supports resolutions up to -1280x1024 with refresh rates within slax's default values)
-360MB pc 133 sdram
-Generic 104 keyboard with windows button

Thanks, any input is appreciated
 
Old 09-24-2004, 08:47 PM   #2
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
How about using virtual terminals to check what is going on while you are having the probelm? just ctrl-alt-fx, where x is each of 1 through 12. One of them should give you a usable login prompt.
 
Old 09-24-2004, 08:52 PM   #3
negface
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Yeah, like I said, thats how I found out my keyboard was locking up. I cant toggle the leds by hitting numlock/capslock either. It seems no input is accepted at all, so I thought maybe a script could do what I couldnt.
 
Old 09-24-2004, 09:00 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
If you have a spare machine try connecting trough SSH to see if it's still alive (I got some lockups, no keyboard or graphic response while trying some stuff on X and could get it back trought ssh). If you do, you can kill X and startx from the ssh connection so the X messages will be dumped there, and of course you can see the X log

Btw, "I'm running Slax 4.1.4 and am having problems with X. I get a black screen, lose keyboard functionality, and must reboot. Ive tried a bunch of stuff with no luck, and now I have an idea thats beyond my know-how." When do you get the black screen? And does Slax uses framebuffer (the console with the Tux logo) and Xorg (which version) or Xfree86?

Last edited by gbonvehi; 09-24-2004 at 09:03 PM.
 
Old 09-24-2004, 09:19 PM   #5
negface
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
gbonvehi-

Unfortunatly no spare machine

And yes, I suppose that first bit was a slight vague...

Slax 4.1.4 uses X.org 6.7.0 and KDE 3.3.0 (Final)

I get the black screen when I do anything with the intent of starting a gui environment. Slax has a few built in scripts (gui, guifast, guisafe, etc) that basically slap default values into the xorg.conf. The black screen happens after I enter one of those, and also if I enter 'startx'. I'm running from root with the exception of when I tried adding a new user as mentioned above (echo $PATH is correct...).

Dont know what framebuffer is; I'm working from a CLI. Only graphical effects are a 4 leafed clover (slax logo) at boot prompt, and colored text.
 
Old 09-24-2004, 10:20 PM   #6
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Mmm I can't be of any help then, sorry, but I don't know Slax's scripts.
The only thing I can recommend you to try (If it works on Slax) is: X -configure
and run X with the configuration generated there (it says how to do it when the configuration finishes)
 
Old 09-24-2004, 10:42 PM   #7
Nichole_knc
Member
 
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
Well I have ran `hup startx &` to capture the output to hup.out. WORKED...
I was having problems close to what is listed above...
DO tell....
Seems xorg (as many other programs) that do not exit on a good note leaves a few lock files around...
As I 'experiment' with machines quite often I have this happen regularly.
Solultion??
As root goto /tmp and remove everything related to the user and xwindows/gnome/kde...
Usually fixes it right up...
This is of course that a bad exit started the whole lock up to begin with...
 
Old 09-24-2004, 10:51 PM   #8
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
"Well I have ran `hup startx &` to capture the output to hup.out. WORKED..."
Nice command

Regarding the tmp files, Slax is a LiveCD Slackware based distribution, so every gets "reseted" on each reboot because it's mantained on ram during uptime so I guess deleting /tmp folder won't do it here :/ .
 
Old 09-25-2004, 12:33 AM   #9
negface
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
'hup startx &'

Not sure what 'hup' is. I get the 'startx &' part... Tried it and it just gave a "bash-invalid command" or some such. Is it some script you made? Or just some random name you made up? Or a command omitted from the Slax cd?

Anyways, 'Xorg -configure' gives me the same black screen of oddness; I assume because it probes compatibility by cycling through different things. The difference is I get some error text before the black screen, but it goes by too fast for me to ctrl+c, alt+sysrq+k, etc. I did manage to get a ctrl+alt+F2 off during the error text though; it went to the black screen at the new tty's login prompt. XD

Ive been playing around with the watch command. The intent is to set it to where I run something like "watch -n 60 kill startxPID#" (the commandname exception doesnt seem to be set up in slax). Then running startx and waiting for watch to kill it, thus dumping me back to prompt. Trouble is, Im not sure what part of Xorg to kill, theres xinit, xinitrc, xserverrc... Is there a way to just kill everything except the shell from the CLI?

Like say I knew startx ran xinit, then xinitrc, then xserverrc. I could do a 'ps' to get the current PID, say 1500. My watch command could then be set up like 'watch -n 60 kill 1504; watch -n 60 kill 1505; watch -n 60 kill 1506' since the watches themselves would be 1501,2 and 3. Or can you even kill rc's? It would not be fun to set it up to kill every process within those files...

One other idea: Is there a way to startx in another tty while staying within the original tty? I thought this was what 'startx &' would do, but apparantly that just gives you a continuous xterm upon getting into X. Also tried 'startx -- :1 &' but the black screen returned, I guess thats more for multiple monitor systems or something?

Anyways thanks again for replying
 
Old 09-25-2004, 12:38 AM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
startx -- :1 will open another X server on :1 instead of :0 the default. (So you can have two X servers running)
try: watch -n 60 killall X
or watch -n 60 kill <PID of X in ps>

Last edited by gbonvehi; 09-25-2004 at 12:41 AM.
 
Old 09-25-2004, 01:10 AM   #11
negface
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Well, I tried "watch -n 60 killall X &" and "watch -n 60 killall Xorg &" before startx with no luck. Might just be the case that my entire system halts...
 
Old 09-25-2004, 06:33 AM   #12
Nichole_knc
Member
 
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
My Bad... late night and tired...

The command is `nohup startx &`
this will send the output of startx (stdout) to the file pwd/nohup.out.
 
Old 09-25-2004, 01:27 PM   #13
negface
LQ Newbie
 
Registered: Sep 2004
Posts: 18

Original Poster
Rep: Reputation: 0
Tried nohup, still tried to run x...still black screen. But trying to send output somewhere is a good idea. Ill need to send it to floppy... Maybe I can get something like 'startx 2>/mnt/floppy/logfile.txt >/mnt/floppy/logfile.txt' to work.
 
Old 09-25-2004, 02:18 PM   #14
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
startx > /mnt/floppy/logfile.txt 2>&1

would be more appropriate, but I think X logs error already in /var/log
 
Old 09-25-2004, 03:53 PM   #15
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Try:

Code:
startx -- -logfile /mnt/floppy/logfile.txt
and

Code:
startx -- -logfile /mnt/floppy/logfile2.txt -logverbose 5
Good luck! I hope you can get trough this.

Last edited by gbonvehi; 09-25-2004 at 04:19 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
Automating the "killing" process via a shell script fatrandy13 Linux - Software 5 09-13-2007 11:59 PM
killing a hung up process with a script lockejr Linux - General 2 04-13-2006 11:40 PM
Process killing script owix Linux - General 2 07-19-2005 11:08 AM
This is killing me UncleEricB Linux - Networking 2 02-01-2005 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration