LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-14-2020, 02:14 PM   #1
LordHomeboy
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Rep: Reputation: Disabled
Problem with PuTTY


Hey

I just switched from a virtual Windows to a dedicated linux Server to get more perfomance ( 64GB RAM , i7 6700, 1Gb Up/Download ). Im hosting a Teamspeak3 and a GarrysMod ( Gaming ) Server on that server. I already used Linux and thought that it would be great because of the saved CPU Power and the securtiy. Acctually the Teamspeak and the Gaming Server are working perfectly, but if im closing PuTTY, the Gaming-Server automaticly shut down but the Teamspeak-Server keeps online. So I have to lauch PeTTY all day long on my PC to keep the Gamingserver alife. Do you guys eventually know how to fix that problem?

Greets,
Chris
 
Old 03-14-2020, 02:28 PM   #2
shruggy
Member
 
Registered: Mar 2020
Posts: 66

Rep: Reputation: Disabled
End the command line with & I guess?
 
1 members found this post helpful.
Old 03-14-2020, 02:48 PM   #3
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,549

Rep: Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630Reputation: 1630
A little more information would help us help you:
What version/distro of Linux are you running?
How are you starting the Teamspeak3 server?
How are you starting the Gaming server?
 
1 members found this post helpful.
Old 03-14-2020, 02:49 PM   #4
boughtonp
Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 316

Rep: Reputation: 186Reputation: 186
Quote:
Originally Posted by shruggy View Post
End the command line with & I guess?
That'll run the specific command in the background.

The proper solution is to setup a service, which can be configured to start on boot and auto-restart on crashes.

Most server software comes with the relevant service scripts and setup instructions - if whatever version of Garry's Mod server the OP is using doesn't do that, using LinuxGSM's version as per the following pages would appear to be a solution...
https://linuxgsm.com/lgsm/gmodserver/
https://docs.linuxgsm.com/configuration/running-on-boot

 
1 members found this post helpful.
Old 03-15-2020, 06:42 AM   #5
LordHomeboy
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hey scasey,

The server runs on Ubuntu 16.04. Im starting teamspeak via the files and then "./ts3server_startscript.sh start". If I want to start the GMod-Server im going into the files and then start the server with "./srcds_run".
 
Old 03-15-2020, 06:51 AM   #6
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,234

Rep: Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398
Quote:
Originally Posted by LordHomeboy View Post
Hey scasey,

The server runs on Ubuntu 16.04. Im starting teamspeak via the files and then "./ts3server_startscript.sh start". If I want to start the GMod-Server im going into the files and then start the server with "./srcds_run".
If you do that in a putty session, most processes started during the session will end with the session. That is what you are observing, Options are to start it outside of any session (ie: as a service}, or in a way that will ignore the session hangup (nohup and background). Changing the astart from "command" to "nohup command &" starts it in the background ignoring hangup.
 
Old 03-15-2020, 07:16 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,690

Rep: Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215Reputation: 3215
The technical reason is the gmod server is attached to the putty terminal session and when you quit putty the server will quit too.

The method to automatically start the server as suggested by the gmod wiki is a cron job.
https://wiki.facepunch.com/gmod/Linu...Server_Hosting

If you don't want to start automatically you can use tmux or screen to disconnect the server from putty.

Teamspeak is configured as a service so it does not need to be disconnected from putty and how to automatically start it is provided by the links above.

Last edited by michaelk; 03-15-2020 at 07:19 AM.
 
Old 03-15-2020, 07:43 AM   #8
uteck
Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: GalliumOS on Chrombook
Posts: 388

Rep: Reputation: 86
Another option to fix this would be once you login with putty, then start a screen session and then start the applictions in that. Disconnect from the screen session and you can close putty.
Latter you can connect with putty and reattach to the screen session with "screen -r"

Last edited by uteck; 03-15-2020 at 07:46 AM. Reason: typo
 
1 members found this post helpful.
Old 03-15-2020, 08:52 AM   #9
LordHomeboy
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
If you do that in a putty session, most processes started during the session will end with the session. That is what you are observing, Options are to start it outside of any session (ie: as a service}, or in a way that will ignore the session hangup (nohup and background). Changing the astart from "command" to "nohup command &" starts it in the background ignoring hangup.
Its seems like it works! But how can I stop the server?

Last edited by LordHomeboy; 03-15-2020 at 09:09 AM. Reason: Wrong Question
 
Old 03-15-2020, 11:05 AM   #10
uteck
Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: GalliumOS on Chrombook
Posts: 388

Rep: Reputation: 86
to kill the server use the 'kill' command and the proecss name.
Code:
 kill -15 name
-15 will try to kill it gracefully, other use -9 to force kill it.
 
Old 03-15-2020, 05:35 PM   #11
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,288

Rep: Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707Reputation: 707
Quote:
Originally Posted by uteck View Post
to kill the server use the 'kill' command and the proecss name.
The default kill command will need a process ID:
Quote:
kill [-s signal|-p] [-q sigval] [-a] [--] pid...
in which pid... is a list of process id's.
Some shells have an extended, built-in version of kill, i.e. bash:
Quote:
kill [-s sigspec | -n signum | -sigspec] [pid | jobspec] ...
(from man bash), but that is an extension:
Quote:
the processes named by pid or jobspec.
(from the same man page).
 
1 members found this post helpful.
Old 03-15-2020, 06:20 PM   #12
uteck
Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: GalliumOS on Chrombook
Posts: 388

Rep: Reputation: 86
I meant to type pkill, which will take a program or presess name without having to track down the pid.
 
Old 03-26-2020, 05:01 AM   #13
Plankt0n
LQ Newbie
 
Registered: Mar 2020
Distribution: RHEL/CentOS
Posts: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by uteck View Post
Another option to fix this would be once you login with putty, then start a screen session and then start the applictions in that. Disconnect from the screen session and you can close putty.
Latter you can connect with putty and reattach to the screen session with "screen -r"
I also recommend this, I used screen extensively when I hosted different game-servers since I wanted easy access to the console live feed etc.

https://linuxize.com/post/how-to-use-linux-screen/
 
Old 03-26-2020, 08:23 AM   #14
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,234

Rep: Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398Reputation: 1398
Quote:
Originally Posted by Plankt0n View Post
I also recommend this, I used screen extensively when I hosted different game-servers since I wanted easy access to the console live feed etc.

https://linuxize.com/post/how-to-use-linux-screen/
I also use screen (and screenie, one of many screen front ends that make it "friendlier") and recommend it highly. I do not generally recommend it for starting services. While it would work, one of the other options would be lighter and more efficient. Your call, of course.

To be clear, even if you do not use screen for this specific purpose, it is something you will value once you learn to use it.
 
  


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
Putty logs me out / Putty throws me out after I log in ytd Linux - General 15 08-09-2009 03:03 AM
Problem with remote terminal (ssh and PuTTY) guardian653 *BSD 11 02-09-2005 06:16 AM
PuTTY Connection Problem mijenks Linux - Networking 14 05-04-2004 09:50 AM
Putty problem in communication dickkniep Linux - Networking 1 03-07-2004 06:58 PM
Problem with Putty...weird tarballed Linux - General 4 04-09-2003 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:57 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration