Raised This Month: $51 Target: $400
 12% 

Switching Windows to Linux


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-08-2013 , 13:34   Switching Windows to Linux
Reply With Quote #1

My community has always been ran on windows however we wanted to start learning how to do things on linux also in case we ever decide to switch.

So Here are my questions
  1. Which Distro would be best? (was told ubuntu for beginers)
  2. Is there a script/program that will monitor and restart my server per crash
  3. Does '-autoupdate' actually restart the server when the screen is closed?
  4. If i use ubuntu there are two options 12.10 support for 5 months... 12.04 LTS support for about 4 more years. Which would you recommend.. they say the LTS builds might have hardware compatibility for a while until they update.
Doc-Holiday is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-08-2013 , 14:16   Re: Switching Windows to Linux
Reply With Quote #2

1. Ubuntu and CentOS seem to be the popular server distros. Having said that, CentOS requires some additional steps due to having SELinux installed by default; it prevents srcds from running if you don't install .
2. srcds_run will auto-restart a server if its just crashed. However, if the server hangs instead of crashing, it won't do anything. Maybe someone else has another program they'd recommend.
3. "screen" is the magic word. There is a program named screen that allows you to keep a program running in a virtual terminal even if you're not logged in. -autoupdate will restart a server as long as the server has users on it when the update is pushed. There's a tool named nemrun for Linux servers that will auto-update a server whenever a server update happens regardless of the player count. I usually use its option to install the update before rebooting the server as Linux doesn't lock open files.
4. I tend to stick with the LTS releases (which come out every 2 years). 12.04 is the current LTS release.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-08-2013 , 14:24   Re: Switching Windows to Linux
Reply With Quote #3

Thanks yeah I saw some shell scripts that say if the "screen" stops running it will restart it.. Im assuming each server instance i run needs its own terminal window?
Doc-Holiday is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-08-2013 , 15:15   Re: Switching Windows to Linux
Reply With Quote #4

Quote:
Originally Posted by Powerlord View Post
1. Ubuntu and CentOS seem to be the popular server distros. Having said that, CentOS requires some additional steps due to having SELinux installed by default; it prevents srcds from running if you don't install .
Latest versions of Ubuntu have the same issue.
__________________
asherkin is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-08-2013 , 15:19   Re: Re: Switching Windows to Linux
Reply With Quote #5

Quote:
Originally Posted by asherkin View Post
Latest versions of Ubuntu have the same issue.
Thanks I think we will be doing 12.o4.

Now to learn how to use the shell scripts lol and what not research research research. Lol. I've been spoiled with windows .exe's for 15 years makes me 7 lol
Doc-Holiday is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-08-2013 , 15:21   Re: Switching Windows to Linux
Reply With Quote #6

Quote:
Originally Posted by Doc-Holiday View Post
Thanks yeah I saw some shell scripts that say if the "screen" stops running it will restart it.. Im assuming each server instance i run needs its own terminal window?
You can use screen to multiplex multiple terminals into one window. Once you have screen running, Ctrl-A, C creates a second window that you can then switch between with Ctrl-A, N (for next) and Ctrl-A, P (for previous).

On a side note, you need to detach from screen to keep it running in the the background. This is done via Ctrl-A, D.

If you ever forget, all commands in screen are prefixed with Ctrl-A. I assume this is because no common Linux programs used Ctrl-A when screen was written.

It's also possible to start a second window in an existing screen via the command line, but I don't remember what it is. I tend to run my servers in separate named screen sessions and connect to them via screen -rx tf2-1 and screen -rx tf2-2
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 02-08-2013 at 15:22.
Powerlord is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-08-2013 , 16:16   Re: Re: Switching Windows to Linux
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
You can use screen to multiplex multiple terminals into one window. Once you have screen running, Ctrl-A, C creates a second window that you can then switch between with Ctrl-A, N (for next) and Ctrl-A, P (for previous).

On a side note, you need to detach from screen to keep it running in the the background. This is done via Ctrl-A, D.

If you ever forget, all commands in screen are prefixed with Ctrl-A. I assume this is because no common Linux programs used Ctrl-A when screen was written.

It's also possible to start a second window in an existing screen via the command line, but I don't remember what it is. I tend to run my servers in separate named screen sessions and connect to them via screen -rx tf2-1 and screen -rx tf2-2
Ok thanks. More to look at.
Doc-Holiday is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-10-2013 , 08:09   Re: Switching Windows to Linux
Reply With Quote #8

ok so going GUI i didnt need to use screen.

I wrote a script that names and starts all of my servers ( in their own named terminal window. And wrote a script that kills the processs lol in turn closing the servers..

now just need a way of automating the start script on boot.. tried cron and the built in start applications and neither worked. Cron added it in to

/etc/crontab <-- sudo gedit /etc/crontab

@reboot username /home/username/start_all_servers.sh

on reboot doesnt do jack shit
Doc-Holiday is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 02-10-2013 , 08:51   Re: Switching Windows to Linux
Reply With Quote #9

Are you actually running cron? What happens if you type /home/username/start_all_servers.sh in a terminal as 'username' ?
hamilton5 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-10-2013 , 14:32   Re: Re: Switching Windows to Linux
Reply With Quote #10

Quote:
Originally Posted by hamilton5 View Post
Are you actually running cron? What happens if you type /home/username/start_all_servers.sh in a terminal as 'username' ?
It runs. Is as if cron isn't on
Doc-Holiday is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 16:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode