failsafe mode

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
ok followed a tutorial for setting up java last night all seemed to go well except last couple of steps...end result java did not work for me restarted last night did some other things fine. now this morning at login can only get to failsafe..it gives me some lines relating to java in /etc/profile.d/java.sh
and /etc/profile.d/krb5.sh as being the problem.

so my thought was to edit them out or comment them out justy to get into fedora but I don't seem to have vi or gedit available to me in that mode.
also it says su is invalid so only have access to home directory.

how do I edit these monkeys out?
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Whoa there!

Please tell me you were doing much more than just trying to install Java.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Whoever wrote that used an unhealthy number of wildcards, especially for a "copy and paste" type of tutorial.

When following someone's list of commands, you should remember that everyone has a different system and setup, so commands can have unforseen consequences if you don't also follow what each step accomplishes. (It also doesn't help that console and GUI filesystem manipulation are being interchanged in the tutorial you found.)

Basically, the steps should have been:
1. Download the JRE .bin file. Make it executable (user or world, it doesn't matter) (i.e., use chmod).
2. Execute the file (it is a self-extracting installer).
3. Answer the question(s) (I think it's just agreeing to a license).
3.5. Install using the RPM file, (specifically the Java one). The syntax for the most common RPM tasks (install, uninstall, reinstall, upgrade, dependency checking) is worth learning, or use a GUI frontend to it.
4. Make a symlink to the file /usr/java/plugin/i386/ns7/libjavaplugin_oji.so in whatever directory your browser stores its plugins.

If you also want to be able to run Java-based applications, then you'll need to add $JAVA_ROOT/bin to your PATH, so that any app that needs the java VM can find it. That's what the /etc/profile.d directory does; it runs every shell script in that directory at the startup of every shell ever started on your system (*.sh for Bourne shell act-alikes (includes bash), *.csh for C shell, *.ksh for Korn shell, and so on). (You remember PATH, don't you? It was in DOS too.)

So, the summary of the steps:
1. Download file.
2. Make file executable and run.
3. Install the contents of the RPM.
4. Show browser how to find the plugin.
5 (optional). Show shells how to find java application.

And BTW, blame it on Sun's license for not allowing Java to be repackaged.
 

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
thats all well and interesting but i see you have completely forgot about the main question which was getting back into the os am stuck in failsafe at the moment
 

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
Originally posted by: bersl2
What's the output of "echo $PATH"?

/usr/kerberos/bin:/usr/java/jrel.5.0_03/bin:

which would explain why its not booting into desktop what and how do I change it
path=????????

 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Originally posted by: daniel49
Originally posted by: bersl2
What's the output of "echo $PATH"?

/usr/kerberos/bin:/usr/java/jrel.5.0_03/bin:

which would explain why its not booting into desktop what and how do I change it
path=????????

OK, found your problem.

You can run vi by writing its name absolutely. /usr/bin/vi probably.

edit those two shell scripts mentioned. And when it says PATH=[stuff], replace it with PATH=$PATH:[stuff]

You needed to preserve the existing PATH. Reboot after fixing those two files, and it should work.
 

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
ok couple problems finally got editor to open by entering /usr/bin/vim
then entering vi java.sh

I added and in fact created that file java.sh) just as it said in that tutorial the (EXACT LINES TYPED ARE POSTED THERE) so that export path=$java.blah blah path$
is the one you want me to alter?

when I enter insert mode to try and edit it it edits fine but back to command mode when I enter :wq it says its read only add a ! to override so I enter:wq! and It still wont allow me to change it.

Reminder I'm at my user prompt again have not been able to get to root.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
Oh, wait, you haven't been able to get root? How does "failsafe" mode not dump you into root, even if it's that far into the boot sequence? If it's far enough to let you be a regular user, I wouldn't call that "failsafe." But that would be my problem with Fedora, not really yours.

I see no reference to Kerberos on that site you gave me the address to... wait, J comes before K, and if... OK, got it.

Something about the shell script you copied is slightly off, so that PATH is essentially being stripped of references to the main bin directories. That's why nothing seems to work. I was just going to let it fix itself after you fixed the script, but now that I see that you don't have root, I'll give you a sane PATH for this session.

Issue the following command at the prompt:
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"

(Then run "ls /usr/java" (as I assume that this is where the RPM put everything) and see if it matches up with where that script you copied thought Java would be. If it's not, see my note at the end of the post.)

This will allow you to run programs again without having to state its path explicitly. So now, call su or use sudo---however you usually issue commands as root---and run vi to open that /etc/profile.d/java.sh (or whatever you ended up calling that file). If it says something like "[readonly]" at the bottom, or if you try to save and it won't let you, you aren't running it as root.

If you are allowed write access to that file, change the second line you were told to copy to:
export PATH="$J2RE_HOME/bin:$PATH"

(The quotes will make sure that nothing stupid with spaces is going to happen. That colon is the delimiter, so make sure it's there.) Finally, insert the following line as the very first line:
#!/bin/sh

Write and quit vi.

OK, now everything should be in order. Reboot. If it's still not working, then I must be overlooking some other special thing about Fedora (like the "failsafe" thing :confused: ) or maybe just overlooking something (double :confused: ). At that point, you should attract somebody who knows Fedora a bit better than I do.

Note: OK, so Java was put somewhere. What's in /usr/java? Is it one directory, or many directories and a few files? If the former, change J2RE_HOME to reflect the different name (it should only be slightly different in that case). If the latter, then let J2RE_HOME be just /usr/java. Or does it tell you that /usr/java doesn't exist? In this case, you should run the command "find /usr -name 'java' ". Hopefully it won't come to this.
 

daniel49

Diamond Member
Jan 8, 2005
4,814
0
71
ok followed all your steps explicitly and I am now back to gui:)

the 2nd line(OF JAVA.SH) I took out that space before the last $PATH apparently even though thats what turorial had that was wrong?

changed the first line completely. saved and exited
rebooted and went right to desktop.

the other file it was also giving me error on never popped up this time the /etc/profile.d/krb5.sh
so I will assume its ok?

As far as the note at the bottom of your last post. of wheres java.
on root file system
/usr/java/jdk1.5.0_03 are about 7 folders and various other files so this is where the install went.

As far as you not knowing fedora you seemed to do better then the author of the tutorial;)

am going to sign off this comp now and go online on fedora to see if java is still broke but main issue is fixed at this point.
thanks much
dan

edit/update..Java is still broken when i initally put the symbollic link in it had me install it to the mozilla folder
i just now also tried to link it to firefox folder...it showed both as broken symbolic links.


java faq at mozilla's instructions were to open terminal
change to plugins directory and link using
ln -s /usr/java/jre1.5.0_03/plugin/i386/ns7/libjavaplugin_oji.so ./libjavaplugin_oji.so
that didn't seem to do it I noticed my path had an extra folder in it
/usr/java/jdk1.5.0_03/jre1.5.0_03/plugin/i386.........
so I added that in the path and symbolic link still shows as broken
so I think if we can figure out how to link the plugin so the browser can find it we will be set at the moment I am not sure what else to try?

 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
props to bersl2, way to help a noob linux guy out. To daniel49: keep at it, solving things like this really add to your knowledge