LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 09-04-2012, 01:26 AM   #1
ronss
Member
 
Registered: Mar 2002
Location: phoenix,az
Distribution: red hat linux enterprise-centos
Posts: 766

Rep: Reputation: 31
kill command, fed 17


wanted to kill the gnome terminal i was on...i decided to use the kill command from the terminal, and i used the pid number for my gnome terminal, got it from the top command.., and priority 1 , and used the -s option,....kill -s......it killed the gnome terminal i was using, but it also eliminated my tabs ontop of the desktop, so i could not get into the terminal again....when i rebooted, it complete changed the gnome desktop, back to where the menu was years ago...i was using fed 17.....what happen, and how do i get fed 17 back to default dektop...

Last edited by ronss; 09-04-2012 at 01:27 AM.
 
Old 09-04-2012, 11:38 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Killing huge applications (like GNOME or KDE) can be a tricky proposition; they launch any number of child processes and plain old programs when running.

You can try the old-fashioned kill the window manage:
Code:
ctrl-alt-shift-backsapce
and you might get lucky.

Using kill -s TERM PID will generally terminate parent and child processes -- but not always (as you have found). This is simply because the window manager has launched so many applications.

Something you can do is use the ps utility to find all the PIDS your user id has running; e.g.,
Code:
ps -ef | grep userid
Those PIDs will the the ones you want to terminate (although you're probably going to get to a black-screen console when you do). And, you want to terminate them in reverse order. So you could do something like this:
Code:
ps -ef | grep userid | sort -r
That give you a list in reverse order, which is pretty useless, so you would want to do something like this
Code:
for pid in $(ps -ef | fgrep userid | sort -r | awk '{ print $2 }')
do
     kill -s TERM ${pid}
done
That will be messy, but you're only going to terminate the PIDs you own, not the system-launched ones (so, you know, don't do this as root). And, if the thing is so screwed up that you can not exit from GNOME to begin with you may be stuck with hitting the power button.

Another way, if you've completely lost control of the window manager and can't terminate it but can get a terminal window open is to
Code:
su - (or sudo)
init 1
That will put the system (gently) into single user mode from which you can reboot cleanly with
Code:
log out and back in as root, use su - or sudo
init 6
You could also do init 6 rather than going into single user first.

How to get back the default desktop in GNOME, I don't know (never have and do not now use it). It it were KDE, there are a couple of .kde* directories in your home directory; you simply delete them, log out or restart X and you'll have the default KDE display back (then, you get to completely re customize it, oh, joy). There's probably the same thing in GNOME, just do an ls -al in your home directory and see what you've got. In either case, when you restart or log out and back in again the window manager will not find those directories and should prompt you though initial set up.

This is where it's a good idea to keep a copy of those configuration directories off somewhere or other so you can recover your configuration is Something Bad Happens -- some directory (not your home), a flash drive, a CD-ROM, whatever.

Anyway, this is going to be messy so don't be in a big hurry to fix it, stop and think before you do something, eh?

Hope this helps some.

Last edited by tronayne; 09-04-2012 at 11:43 AM.
 
  


Reply



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
[SOLVED] using the kill command Chupakabra Linux - Newbie 1 07-28-2011 07:28 PM
how to fed command to shell through programm vikas_choudharyy Linux - General 1 07-13-2011 07:10 AM
why we cannot kill process id 1 with command "kill -9 1" satyaredhat Linux - Newbie 7 03-11-2009 12:48 PM
Upgrade Fed 6 to Fed 8 using only the *.iso ericcarlson Fedora 1 11-18-2007 02:25 AM
Kill command could not kill Kanaflloric Linux - General 11 08-22-2005 07:18 AM

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

All times are GMT -5. The time now is 02:46 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