LinuxQuestions.org
Review your favorite Linux distribution.
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 11-30-2009, 12:04 PM   #1
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Rep: Reputation: 0
Closing Putty but server keepts running


hello i'm running my moparscape server now on putty with gives me SSH connection and i'm wondering if there is a way that i could turn off my pc but the server would stil be running i can use logout command that doesnt work
 
Old 11-30-2009, 01:01 PM   #2
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
If I understand it correctly, you have moparscape server machine to which you are connected via SSH protocol using putty client. And you want remotely shut this machine down. To do so, issue
Code:
halt
. Note: you need to be root to run this command.
 
Old 11-30-2009, 01:14 PM   #3
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
where and when i need to enter it?
 
Old 11-30-2009, 01:27 PM   #4
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
If you are connected to that server, just type halt and press enter.

Putty should provide you with terminal uppon connection.
 
Old 11-30-2009, 01:32 PM   #5
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
well i run the server i type halt and when i lcose the server goes offline or am i doing domething wrong?
 
Old 11-30-2009, 01:39 PM   #6
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
Well, maybe I didnt understand what you want. I thought you want to swith the server (= moparscape machine) off. But by your confusion I see that is not the case. So can you be more specific what exactlu you want to turn off?
 
Old 11-30-2009, 01:41 PM   #7
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
i want to turn off my pc and the server must still be running thats what i want
 
Old 11-30-2009, 01:44 PM   #8
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Just type
Code:
exit
when logged in with Putty and close Putty. The server will still be running and you'll be able to connect whenever you want.

Kind regards,

Eric
 
Old 11-30-2009, 01:45 PM   #9
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
Then I dont understand the problem. Server should be running regardless, whether you are connected via putty or not. What happens, when you log off of the server?

Or do you want to run some task on the server and keep it running even when logging off?
 
Old 11-30-2009, 01:50 PM   #10
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
Well, my error. I though that moparscape is some Linux distro, unknown to me. Shame on me.

Use
Code:
nohup
to run it. Full recomended command is
Code:
nohup your_program > file.out 2> err.out < /dev/null &
so that way you can be sure that you do not lose all outputs and nothing will disturbe your server.
 
Old 11-30-2009, 01:50 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 15,260

Rep: Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624Reputation: 1624
Your question is somewhat vague but I assume you are starting the server via Putty and because you close the session moparscape quits running too. You can use nohup to keep an application from closing i.e.

nohup moparscape & (replace moparscape with the exact command used to start the server)
 
Old 11-30-2009, 01:53 PM   #12
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Don't be ashamed, I was mislead by the OP's unclear description too.

Good call!

Kind regards,

Eric
 
Old 11-30-2009, 01:56 PM   #13
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
with that command the server doesnd even start

i'm using command sh sh.sh

here's the inside of the sh file:
Code:
#!/bin/sh
java -Xmx512m server
maby this will help you
 
Old 11-30-2009, 02:00 PM   #14
Fierce
LQ Newbie
 
Registered: Nov 2009
Posts: 13

Original Poster
Rep: Reputation: 0
hmm i get this
Code:
joomlascape:~# nohup sh sh.sh
nohup: ignoring input and appending output to `nohup.out'
 
Old 11-30-2009, 02:32 PM   #15
shpenat
Member
 
Registered: Dec 2008
Distribution: LFS
Posts: 95

Rep: Reputation: 21
The problem is, that you want to run
Code:
sh sh.sh
but nohup treats the second parametr as input parameter of nohup. So in your case it only starts
Code:
sh
Make that sh.sh executable by running
Code:
chmod +x sh.sh
and you can run it by
Code:
nohup sh.sh &
 
  


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
how to keep program running after closing ssh session fakie_flip Linux - Software 10 11-03-2011 09:33 AM
Keep snoop running even after closing terminal the_imax Solaris / OpenSolaris 3 11-14-2009 06:19 AM
running remote X applications via Putty from a Windows XP system John Sorkin Linux - Newbie 1 08-23-2008 11:19 PM
Closing ports 25 + 631 still running smtp and CUPS JZL240I-U Linux - Security 17 04-02-2007 07:07 AM
Will script continue to run even after closing putty for remote access anjanesh Linux - Newbie 11 08-07-2006 04:05 AM


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