[Techtalk] I've lost my prompt

Telsa Gwynne hobbit at aloss.ukuu.org.uk
Sun Jul 8 20:48:27 EST 2001


On Mon, Jul 09, 2001 at 02:53:39AM +0800 or thereabouts, Malcolm Tredinnick wrote:
> On Sun, Jul 08, 2001 at 01:30:30PM -0400, Glen Strom wrote:
> > I have SuSE 7.1 on my machine. I wanted to add some aliases so, 
> > being used to Red Hat, I looked for /etc/bashrc. There is none. It 
> > seems that SuSE uses /etc/profile for aliases.
> > 
> > The file says not to put changes in it since you'll lose them during 
> > an upgrade. It says create /etc/profile.local. I do that. I add my 
> > aliases.
> > 
> > Now, to active the aliases, I reboot (I don't know how to do it the 
> > right way). Kdm starts up. I type in my password.
> > 
> > Nothing happens. X has hung. I open a console and try to log in as 
> > root. There's no prompt. I can type in commands, but nothing 
> > happens.
> > 
> > Where did my prompt go? I don't remember doing anything before 
> > creating /etc/profile.local that caused a problem. Does anyone 
> > running SuSE have any ideas?
> 
> I don't run SuSE, but the "X has hung" bit suggests it's a bit more
> serious than just altering your prompt. :(

I was just wondering about "I reboot (I don't know how to do it the
right way)" and how Glen rebooted, but then, kdm did manage to start.

For reference, the ways I know to reboot linux boxes the "right"
way are here. Do try to be at the console for these. Some won't
work if you're not on the console, but some may. (When you have 
lots of windows open and you type it into the one that's open
to the machine in the locked room and the person with the key is
on holiday, you come to curse that fact.) 

(a) Gnome has a logout box which lets you choose whether to log
your user out of Gnome, whether to shut the box down, or whether
to reboot it (nicely). I would be surprised if KDE doesn't have
something similar. 

(b) control-alt-delete will send a "reboot" message to the box. 
However, if you're in X, this may be switched off. (You can do
control-alt-F1 to get to a virtual console and then control-alt-delete,
of course :)). 

(c) run the "shutdown" command as root. 
	You have to give it a time. (Generally it's "shutdown now")
	shutdown -r means reboot afterwards
	shutdown -h means halt afterwards (ie, don't reboot). 

There are other ways (there's the halt, reboot and poweroff commands,
all of which have manual pages). The key thing to remember is that
any and all of them are better than hitting the big red power button. 

All the commands above tell the machine "you are shutting down soon, 
so get all the data to disk" unless you specifically tell them not to 
say that. 

If you edited a file and then hit the power button, the machine
may not have written the changes to disk anyway. (I suspect it did,
but it's worth remembering.) It may also be in the middle of writing 
stuff to disk and get itself very confused. 

> To make a start on debugging this:

Much useful information snipped: 

> To test your changes in future in a slightly less destructive way: just
> source /etc/profile.local in a shell to make sure it does what you
> expect. That should at least reveal any oddities like if you accidently
> make your prompt the same colour as your background.

Or make these changes for a test user in its .bash_profile. Test
that, _then_ edit /etc/whatever. /etc changes affect all users.

I am really curious what changes you made in this file, btw. I want
to avoid them myself :) 

Telsa




More information about the Techtalk mailing list