LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Closing Putty but server keepts running (https://www.linuxquestions.org/questions/linux-newbie-8/closing-putty-but-server-keepts-running-772472/)

Fierce 11-30-2009 11:04 AM

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

shpenat 11-30-2009 12:01 PM

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.

Fierce 11-30-2009 12:14 PM

where and when i need to enter it?

shpenat 11-30-2009 12:27 PM

If you are connected to that server, just type halt and press enter.

Putty should provide you with terminal uppon connection.

Fierce 11-30-2009 12:32 PM

well i run the server i type halt and when i lcose the server goes offline or am i doing domething wrong?

shpenat 11-30-2009 12:39 PM

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?

Fierce 11-30-2009 12:41 PM

i want to turn off my pc and the server must still be running thats what i want

EricTRA 11-30-2009 12:44 PM

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

shpenat 11-30-2009 12:45 PM

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?

shpenat 11-30-2009 12:50 PM

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.

michaelk 11-30-2009 12:50 PM

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)

EricTRA 11-30-2009 12:53 PM

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

Good call!

Kind regards,

Eric

Fierce 11-30-2009 12:56 PM

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

Fierce 11-30-2009 01:00 PM

hmm i get this
Code:

joomlascape:~# nohup sh sh.sh
nohup: ignoring input and appending output to `nohup.out'


shpenat 11-30-2009 01:32 PM

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 &


All times are GMT -5. The time now is 11:34 PM.