LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-20-2011, 08:17 AM   #1
smartnose
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
X-server crashed. Is my session still alive?


Hi all,

I'm running a huge task on a Linux server (CentOS), and the interface is displayed locally on a Windows desktop using X-Win32, which crashes after one and half day. Does this mean my task on the server is dead too? Or the server should be able to finish the task and then kill himself?

Is there anyway to detach the session from my desktop machine and just let it run on the server? For now, I have to keep my Windows Desktop running all the time just to keep the session alive.

Thank you.
 
Old 06-20-2011, 08:43 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
To determine whether the process is still running on the server you'd have to login and run "ps -ef" and look through the running processes (or grep for more specific information if you know it). Sometimes if a session gets detached from a workstation it is still alive on the server but you have no way of reconnecting (unless you set it up for that beforehand).

There ARE utilities that let you run things from one session and detach then reattach again from same workstation or even another workstation.

If what you opened was a terminal window in X so that you could run a command from command line you should use the "screen" utility. You can see a discussion of screen here:
http://en.wikipedia.org/wiki/GNU_Screen

If what you ran was an actual X application and not a terminal under X there are equivalents which are discussed in this thread:
http://superuser.com/questions/29203...screen-utility
 
1 members found this post helpful.
Old 06-20-2011, 12:49 PM   #3
scott8035
LQ Newbie
 
Registered: Nov 2010
Posts: 14

Rep: Reputation: 4
If you install vncserver and xrdp, you can connect to your server through Windows Remote Desktop Console (mstsc.exe). This allows you to disconnect and then re-connect from anywhere to pick your session back up again.
 
1 members found this post helpful.
Old 06-20-2011, 06:46 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,165

Rep: Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680Reputation: 2680
If you are running a cmd line prog on the server, the simplest way to 'detach' is
Code:
nohup /dir/myprog >myprog.log 2>&1 &
screen is handy if you actually need to re-attach to that session itself, as opposed to just letting the prog run on it's own.
 
1 members found this post helpful.
Old 06-28-2011, 07:25 AM   #5
smartnose
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you all very much

Problem solved using nohup /dir/myprog >myprog.log 2>&1 &

but I'm definitely gonna check out the other two.
 
  


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
Need help keeping program alive while killing remote session. jbo5112 Linux - Software 4 05-16-2009 06:49 AM
ardour exporting session to wave - crashed itself and most everything else greennick Linux - Software 1 09-20-2005 09:46 PM
Is my server alive? jbhanc0125 Programming 1 06-28-2005 10:03 PM
X session crashed by lopster when locking screen? ac1980 Linux - Software 0 03-03-2004 07:21 AM
check if server is alive by ping saavik Linux - Networking 1 05-06-2002 09:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:49 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
Open Source Consulting | Domain Registration