LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2013, 07:19 PM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Rep: Reputation: 51
Reasoning behind console limitations


Why is it that I can kill or start some applications from the console but not others like gnome-sessions Which necessitate a reboot? I can kill a browser from the console but I can't open one.

Thanks in advance!
 
Old 12-07-2013, 08:54 PM   #2
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 656

Rep: Reputation: 121Reputation: 121
I am not intimately familiar with gnome, never liked it much, but what you are describing does not sound like a limitation of the console.

It is more likely that the gnome processes that you try to kill are respawned by other gnome related processes.

Add the "-9" option to kill or kill the whole process tree. If for a certain task you don't want gnome to run, consider dropping to runlevel 3. That should close all x related services.

Last edited by ericson007; 12-07-2013 at 08:55 PM.
 
Old 12-07-2013, 09:40 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,117

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Quote:
Originally Posted by theKbStockpiler View Post
Why is it that I can kill or start some applications from the console but not others like gnome-sessions Which necessitate a reboot?
One: Are you trying to kill these as userid 'root'?
Two: Are you trying to kill these with the -9 option?

There should be very few processes that you cannot kill this way. I've seen it happen occassionally when processes are deeply into some very low level database or network stuff. Still, it's rare even then. Are you perhaps talking about [defunct] processes? Those aren't actually processes, they are just an entry in the process table that has not been cleaned up yet. The parent process of the dead child must either wait() on that dead child or die itself (the parent) to clean up the process table.

Gnome should be easily kill-able. Show us the output of "ps -ef | grep gnome", your effective userid, the exact kill command you are running, the output of that kill command, and then the "ps -ef | grep gnome" output after you attempt the kill.

Quote:
I can kill a browser from the console but I can't open one.
You should be able to open a browser from the command line. Easy. But of course you first have to have X running. You're not going to be able to successfully start any GUI-based app without a window manager. Are you perhaps running a Gnome desktop as userid "xyz" and then trying to start a browser as root? It wouldn't know what :display to send output to in that case (unless you manually told it that info).

Last edited by haertig; 12-07-2013 at 09:41 PM.
 
Old 12-08-2013, 08:20 AM   #4
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Original Poster
Rep: Reputation: 51
thanks for the replies!

I'm actually looking at the console Alt>f2 as a remote method to fix problems in the GUI that is running X. If My desktop freezes , the first thing I do is open a non x console and (Killall BrowserName). It seems I can kill any application but not restart it from a non x console which leaves the problem if the desktop crashes someway I have no GUI way to fix it. Why is it a one-way street sort of thing?
 
Old 12-08-2013, 08:31 AM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,020

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
You can only run an X11 based application by passing it a DISPLAY variable that's valid. If you want to run Firefox from one of the TTYs then just use:
Code:
export DISPLAY=:0 ; firefox &
Assuming you only have one monitor/x session and you want to put the application into the background and do something else.
 
1 members found this post helpful.
Old 12-08-2013, 08:57 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531
Quote:
Originally Posted by theKbStockpiler View Post
I'm actually looking at the console Alt>f2 as a remote method to fix problems in the GUI that is running X. If My desktop freezes , the first thing I do is
...try to find out the reasons why instead, for example from your ~/.xsession-errors*, /var/log/Xorg* and related log files. (Unless you run unstable software or mix packages from untrusted or unsupported sources. Then as far as I'm concerned you're SOL.)


And indeed most of the time it's about the display envvar. Note you don't need to background FF from the CLI, this should do:
Code:
env DISPLAY=":0.0" firefox
 
Old 12-08-2013, 09:04 AM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,020

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
Quote:
Originally Posted by unSpawn View Post
Note you don't need to background FF from the CLI, this should do:
Code:
env DISPLAY=":0.0" firefox
That doesn't work for me -- it behaves as it would if I opened it in an xterm leaving the terminal "tied up" until Firefox is killed, which <ctrl>+C does as usual.
 
Old 12-08-2013, 10:25 AM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by theKbStockpiler View Post
I'm actually looking at the console Alt>f2 as a remote method to fix problems in the GUI that is running X. If My desktop freezes , the first thing I do is open a non x console and (Killall BrowserName). It seems I can kill any application but not restart it from a non x console which leaves the problem if the desktop crashes someway I have no GUI way to fix it. Why is it a one-way street sort of thing?
If your desktop freezes, kill the X server. A number of problems with desktops are caused by the window manager itself freezing, but trying to FIND it can be tricky (especially with gnome3) because a number of its elements run independently and will restart other elements. Killing the X server will cut off all of the processes, and cause the GUI login process to restart it, prompting for a login.

The user processes don't always die (usually do, though it sometimes takes a minute or two). I periodically logout, then log in on console terminal (f2) as root and look to see if something is still running... Then I do a killall -9 <username>... and look again. That should take care of it.
 
Old 12-08-2013, 10:30 AM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,020

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
When I want to restart X from one of the TTYs you can probably run "service gdm3 restart" or "service kdm restart" (or whatever your display manager is called) and that should do it for you. For example when installing NVIDIA's binary drivers I'd run "service gdm3 stop" install the driver etc. then "service gdm3 start" and things would be up and running again.
 
Old 12-08-2013, 10:46 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by 273 View Post
When I want to restart X from one of the TTYs you can probably run "service gdm3 restart" or "service kdm restart" (or whatever your display manager is called) and that should do it for you. For example when installing NVIDIA's binary drivers I'd run "service gdm3 stop" install the driver etc. then "service gdm3 start" and things would be up and running again.
That usually works... but doesn't clean up the user processes that don't terminate like they should. (sometimes they just suck up CPU time). I keep finding nepomuk running forever unless I kill them manually (they just accumulate until memory gets exhausted).
 
Old 12-08-2013, 06:25 PM   #11
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Original Poster
Rep: Reputation: 51
thanks for the replies!

I'm interested in the connection between virtual consoles and not actually trying to fix a version of Mandriva 2010 that was a mess and has never been updated because 1/2 the code of the entire O.S would have to have been replaced. env DISPLAY=":0.0" firefox
and export DISPLAY=:0 ; firefox & give messages or Protocol Not specified , Can't open display :0 . and [1] + ext 1 firefox I think. The out come does not really matter.

I guess I will try to find more info on virtual consoles.
 
Old 12-08-2013, 06:35 PM   #12
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,020

Rep: Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622Reputation: 1622
I think unSpawn and I both made small mistakes with what we posted, you could try:
Code:
export DISPLAY=":0.0" firefox
with a '&' on the end if you want. I think unSpawn mean to type "export" and I was guessing at setting DISPLAY to ":0" because I have two displays and I use ":0.0" or "0.1" but I think if you have one display it may still be ":0.0".
 
Old 12-08-2013, 07:00 PM   #13
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: Fedora14,Scientific 6.1?, Mandriva 2010 ;GO MAGEIA!!!Next up Gentoo
Posts: 838

Original Poster
Rep: Reputation: 51
If I run echo $Display I get (0 Still,what is the connection between terminals in a logical sense? Why is it that in console 1 (Alt >f1) I can kill a program in x or console 7 and console 1 knows where it is? Why/how can I effect different terminals from the one I'm using? There is obviously a bias towards console 7 by the other consoles. It's like they are all sharing the X console.

Last edited by theKbStockpiler; 12-08-2013 at 07:57 PM.
 
Old 12-08-2013, 07:19 PM   #14
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,887
Blog Entries: 1

Rep: Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006Reputation: 2006
Quote:
Originally Posted by theKbStockpiler View Post
If I run echo $Display I get (0 Still,what is the connection between terminals in a logical sense? Why is it that in console 1 (Alt >f1) I can kill a program in x or console 7 and console 1 knows where it is? Why/how can I effect different terminals from the one I'm using? There is obviously a bias towards console 7 by the other consoles. It's like they are all sharing the X console.
The system is the connection, otherwise each virtual terminal is a separate login shell and there is no "connection" with other terminals other than the underlying kernel/processes/filesystem (i.e., the system).

You can kill a process that was started in another terminal, assuming proper permissions, because it is running on the system under control of the kernel.

You cannot start a new process "in" another terminal because you are not a child of that other terminal nor running within the context of that other terminal.

Last edited by astrogeek; 12-08-2013 at 07:23 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
C language: fast code for Reasoning - Artificial Intelligence? Xeratul Programming 8 07-09-2013 12:29 PM
Limitations for slackbuilds igadoter Slackware 6 06-11-2013 05:05 AM
Not seeing strong connection to MAC/Physical Addressing and reasoning. theKbStockpiler Linux - Networking 5 07-26-2011 04:37 PM
My reasoning! And why Slackware. onebuck Slackware 12 04-03-2006 10:06 AM
fedora limitations jdlin Fedora 5 03-22-2004 04:58 PM


All times are GMT -5. The time now is 03:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration