Click to See Complete Forum and Search --> : fix the profile problem


zhebincong
06-11-2004, 01:55 AM
hello
i modify the "etc/profile" to set up the path variable,but i foget to include the "$PATH" in it,so that after i reboot the linux,most of the commands become invalid,i only can use the "cd" command,who can tell me how i can recover the profile file to fix such a problem?


thank you!!

fatTrav
06-11-2004, 02:11 AM
cd is a command built into the shell. i don't think you can recover the file, but you can edit it to fix it.

what editor did you use? if you used vi, then the command/bin/vi /etc/profile will open that file for editing. since your path is screwed up you will have to use absolute paths to the commands. also you will need to be root to modify this file. My /etc/profile is here (http://students.millikin.edu/~tmeisenheimer/passions/profile) . It might be some help for the $ problem. I use Fedora Core 1, btw.

I don't know how to help you other than these steps.

Travis

serz
06-11-2004, 02:12 AM
Welcome to JustLinux, zhebincong. Please do not crosspost next time. Thank you.

First, let's fix your PATH.

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"

After this, you can go ahead and edit back /etc/profile.

This is what I have in mine (PATH part):

# Set the default system $PATH:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games"

# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
# the $PATH. Some means of connection don't add these by default (sshd comes
# to mind).
if [ "`id -u`" = "0" ]; then
echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
if [ ! $? = 0 ]; then
PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
fi
fi

zhebincong
06-11-2004, 03:09 AM
thanks for all of your helps!!

zhebincong
06-11-2004, 03:30 AM
sorry another question:
i install jboss3.2 in my redhat8,i go to the bin directory of jboss,the type "run -c all" command,the jboss start,but after it finish the starting,i find that the jboss run in "preemptive" mode,i can't do any other thing,if i press "ctr+c" the jboss stop.
how can i start the jboss in background,then i can do the other job such as copy file........... in the frontground?

the next question is how can i config the linux(red hat) to start the jboss during the booting procedure,i mean which file i should modify to implement such fuction?

thank you!

mdwatts
06-11-2004, 11:47 AM
Originally posted by zhebincong
sorry another question:
i install jboss3.2 in my redhat8,i go to the bin directory of jboss,the type "run -c all" command,the jboss start,but after it finish the starting,i find that the jboss run in "preemptive" mode,i can't do any other thing,if i press "ctr+c" the jboss stop.
how can i start the jboss in background,then i can do the other job such as copy file........... in the frontground?

the next question is how can i config the linux(red hat) to start the jboss during the booting procedure,i mean which file i should modify to implement such fuction?


Since you now have a new question that does not relate to the subject of this thread, I would suggest you post a new thread with a proper subject that describes the problem and only once in the most appropriate forum.