PDA

View Full Version : HD Knpx3.8.1, then later only get TEXT login promp FIXED



Mike Colley
02-03-2007, 02:09 PM
Hats off to Klaus and all the Knoppix developers for a wonderful wonderful work.
Their work helped me enter linux, and Knoppix HD install works GREAT! Thanks Guys!

My HD Hard Drive Knoppix Install of version 3.8.1 using knoppix-installer works GREAT!
This install was so easy, it just worked and I loved it that it actually worked.
After several weeks one day I booted up to find I had a text login prompt instead of the GUI.
I was lost. Eventually I remembered startx was the command for starting the X windows.
I tried startx and it didn't work. I tried kdestart and startkde and anything else I could think of and it didn't work.
I was lost and just tried a bunch of things and one of them gave me an error message (I don't remember now which one).
It said a temporary file needed to be deleted if I wanted to run X. AH-HHAAAA! Maybe I can figure this out.
I wanted to know which runlevel I was in so I entered the command runlevel and it told me 5, this was important in the future.

--- CORRECTION BY AUTHOR --- NEXT LINE IS INCORRECT (.../etc/init.d... should be .../tmp/X0.lock...). DO NOT DELETE /etc/init.d !!! ---
Incorrect line: I deleted the file /etc/init.d and re-booted and I had my GUI back! Wow! It worked, I actually fixed something, pretty proud of myself.
--- CORRECTION BY AUTHOR --- NEXT LINE IS CORRECTION: - Mike Colley - (Thanks to xicor and Justin for catching my error.) ---
Corrected line: I deleted the file /tmp/X0.lock and re-booted and I had my GUI back! Wow! It worked, I actually fixed something, pretty proud of myself.

I noted this info, but have since lost the notes.

Mind you now this is written by a newbie so I'm sure there are better ways of doing what I did.
I hope I remember exactly all the steps I did, I will try to relate them here.

I decided to make this fix permanent and automatically delete this file every time I booted up.
I like the nano editor so it is the editor I used
I clicked K and chose SYSTEM and KONSOLE and got a terminal (Black Text Box)
I changed to su by entering the command
su
next I entered the command
cd /etc/init.d
then I entered the command
nano del-xlockout

The text I put in this file was

echo Make sure the X lock file is deleted at startup
rm /tmp/.X0-lock

then I saved this file with CTRL-x and y

then I entered the command

chmod 755 del-xlockout

I double checked some of my work with the command
ls -al
to see it looked like the other entries, yes it did.
I entered the command
cat del-xlockout
and the text looked like what I wanted the file to look like

Note that above I remember I was in run level 5 so I went to the directory for that, I entered the command

cd ..
cd rc5.d

Now I don't know why or how this works, but I learned it a few months ago
The procedures that run for runlevel 5 occur in alphabetical order and in this directory. There are files S20... and S99...
These are symbolic links (no I don't know why)
I wanted to delete the tmp file as early as possible in the boot process so I made a symbolic link with this command
ln -s ../init.d/del-xlockout S15make-x-ok

I hope my memory didn't fail me here and I hope I didn't reverse the ../init.d/del-xlockout S15make-x-ok entries.

DONE!

I double checked some of my work with the command
ls -al
to see it looked like the other entries, yes it did.

Now every time I boot if this tmp file is there it gets deleted and the GUI starts.
If the tmp file is not there, it makes some small error message, but it works ok.
This was months ago I made this change.

By the way, this machine is still in service to this day Feb 3, 2007,
it is used and booted daily and works GREAT!
My experience with Knoppix 3.8.1 and the knoppix-installer to HD is that it just plain works.

Hats off to Klaus and all the Knoppix developers for a wonderful wonderful work.
Their work helped me enter linux, and Knoppix HD install works GREAT! Thanks Guys!

xizor
02-04-2007, 06:11 AM
Having this exact same problem :'(
I tried to delete /etc/init.d but it's a folder so it wouldn't let me (this whole time I'm root)
so then i see a file named /etc/init thinking you meant that one I removed it, lol then I tried
reboot, but it wouldn't let me because it needed that init file I just deleted lol, so I'm going to reinstall linux in the morning,
I did have the debian style HD install just fyi

onemyndseye
02-05-2007, 09:50 AM
Wow....could you have possibly read that post more wrong :) LOL


Nice little writeup there.. :) This is a problem from time-to-time with Knoppix and the above is a great fix..

You may want to change your line to:



rm -f /tmp/.X0-lock >/dev/null



-f for force and >/dev/null to hide any output..... This will cure your small error message when the file isnt found.




Or more complicated:



# Lets check to see if the file exists first. If found, print a message, and delete it. If not found just print a message"
if [ -f /tmp/.X0-lock ]; then
echo -n "Stale X-Lock file detected! Removing .."
rm -f /tmp/.X0-lock >/dev/null
echo ".Done!"
else
echo "No stale X-Lock file found."
fi

-or-

# Same thing different form
[ -f /tmp/.X0-lock rm ] && echo -n "Stale X-Lock file detected! Removing .." ; rm -f /tmp/.X0-lock >/dev/null ; echo ".Done!"




Take Care :)
-Justin
One Mynds Eye

Mike Colley
02-06-2007, 11:02 AM
Thanks for the code improvement Justin!
I'm going to change to the "Or more complicated" script you suggested.
I was depending on the error message to tell me what was happening,
but your solution is even clearer.
By the way xizor, don't erase init.d, rather re-read the initial post again.
- Mike

onemyndseye
02-06-2007, 01:03 PM
WHooops! ... Looks like xizor is smarter than both of us! LOL


Your post actually does read: "....I deleted the file /etc/init.d ..."


My HD Hard Drive Knoppix Install of version 3.8.1 using knoppix-installer works GREAT!
This install was so easy, it just worked and I loved it that it actually worked.
After several weeks one day I booted up to find I had a text login prompt instead of the GUI.
I was lost. Eventually I remembered startx was the command for starting the X windows.
I tried startx and it didn't work. I tried kdestart and startkde and anything else I could think of and it didn't work.
I was lost and just tried a bunch of things and one of them gave me an error message (I don't remember now which one).
It said a temporary file needed to be deleted if I wanted to run X. AH-HHAAAA! Maybe I can figure this out.
I wanted to know which runlevel I was in so I entered the command runlevel and it told me 5, this was important in the future.
I deleted the file /etc/init.d and re-booted and I had my GUI back! Wow! It worked, I actually fixed something, pretty proud of myself.
I noted this info, but have since lost the notes.



you probably meant to say /tmp/X0.lock


FYI.. There is a lock file created for each X display in the following format: /tmp/.X<Display #>.lock. -- As such.. it may best to have the script do " rm -f /tmp/X*.lock >/dev/null " This wouldnt usually apply to a Desktop machine but it would a server or anywhere that you have Multiple X sessions going on at once


You are quite welcome BTW :)
-Justin
One Mynds Eye

Mike Colley
02-06-2007, 05:20 PM
Yep, mistake on my part. I guess I am unable to proff-read my own material!
And you are correct, where it says
....I deleted the file /etc/init.d ... I really meant to say /tmp/X0.lock
Is there any way to get this post edited and that mistake of mine fixed?
The reason I request the edit that is I am afraid someone will succeed in following that incorrect and very damaging statement.

Your note about multiple X displays is useful because I run vncserver on this machine.
If I remember correctly, that makes multiple X sessions, and therefore multiple X lock files.

Thanks for noting the mistake I made. Hopefully others will read your correction before they take action.
All the Best - Mike

Harry Kuhman
02-06-2007, 05:32 PM
....Is there any way to get this post edited and that mistake of mine fixed?
There is an edit link up in the right hand corner of each of your posts (should be next to the quote link). You can use that to edit your post.

onemyndseye
02-07-2007, 08:56 AM
"......Your note about multiple X displays is useful because I run vncserver on this machine......"

Yup... thats just the application that comment was pointed at :)... Xorg puts each session on a different dispklay (as youve no doubt seen from running a vnc). the default display, and the one usually used for the console is :0 ... but I believe there can be ANY number of displays on a given machine as long as system resources can handle the load.

Was really just a after thought.... but after posting that to ya I had to go edit my own "X-unlocker-thingy" (LOL) to account for possibly having more than one display... Not that I use more than one since this is a portable USB installation.... But I like to cover my base :)

Take Care,
-Justin
One Mynds Eye

Mike Colley
02-07-2007, 10:45 AM
Common sense Tips like this are very useful and hard to come by.
I don't have the time to start a collection, but if you know of a collection like this I would like to know about it.
This knoppix/form is the closest thing I can find to a tips collection, and I do use it often.
Searching through it with Google is VERY time consuming but it is all I know.

I suppose I should post this to the tips and tricks forum. What do you think?
I don't know how to use your code to test for multiple lock files though. - Mike

onemyndseye
02-08-2007, 01:25 PM
I salute your quest for knowledge sir! :)... this involves setting a loop starting with 0, and check for the file each loop increasing the interger by 1 each cycle.

I'll comment the code for claritity...



# Start with this X display
display=0

# How many displays should we look for?
cycles=30


while [[ $display -lt $cycles ]]
do


if [ -f /tmp/.X$display-lock ]; then
echo "Removing stale X lock file: /tmp/.X$display-lock"
rm -f /tmp/.X$display-lock >/dev/null
fi
# Increase the display number by 1
display=$[display+1]
done



Now... this will check for lock files for displays 0-29 and remove if found :)


I thought you was gonna gimme something hard!!! :) LOL j/k


Take Care,
-Justin
One Mynds Eye

onemyndseye
02-08-2007, 01:30 PM
Oops.... removed the ` else ' and ` break ` statement left over from another method I tried.