LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-17-2006, 02:36 PM   #1
stuartornum
Member
 
Registered: Feb 2006
Posts: 44

Rep: Reputation: 15
Keep running a command when disconnect from SSH


hi,

Im running a Game server on a VPS,

I need to run this command once ./cod_lnxded

But when I disconnect from the server the game server stops obviously.

I just wanted to know what I could do.

Thanks
 
Old 02-17-2006, 02:45 PM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Check into using the screen command. When you log into SSH, you start a screen and that will survive when you log out. When you log back in, you can then connect to that screen if you need to do something else.
 
Old 02-17-2006, 02:46 PM   #3
esteeven
Senior Member
 
Registered: Oct 2001
Location: Bristol UK
Distribution: Arch Slackware Ubuntu
Posts: 1,082

Rep: Reputation: 52
check out screen......I use it to log in to an account using irrsi....but on my server. When I close the client, screen keeps running on my server. I can ssh back in later and open up the "screen" (reattach the screen = screen -r) and it's all still there. I imagine you can ssh into your server, invoke screen and then run your command. Close the terminal and your command will still be running on your server. It is only as I am typing this that I realise how odd it all sounds.....
 
Old 02-17-2006, 10:19 PM   #4
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
You can also do "nohup <command> &". Can't reattach it though.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do I need ssh running? reesee Linux - Security 7 01-02-2006 10:01 PM
Running a shell script remotely via 'ssh <hostname> <command>' davee Linux - General 4 10-09-2005 01:38 AM
problem in running ssh command skvasistha Linux - General 1 11-29-2004 06:12 AM
Keeping a process running after disconnect steyr Linux - General 2 02-25-2004 06:03 AM
Running X through SSH cdakin Linux - Newbie 0 04-23-2002 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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