Run multiple instances HLDS at startup (Ubuntu 12)

GilmourD

[H]F Junkie
Joined
Jun 17, 2004
Messages
11,185
OK, so I'm somewhat of a Linux noob. I've had three instances of HLDS running consistently of my Ubuntu box for a couple months and I've surprisingly not had any power outages during hurricane Sandy or the snow storm, so I haven't worried about it.

However, I do want to get it set up to run the three servers and my DynDNS IP updater at startup, but I honestly haven't found much of a straightforward answer on how that works.

Basically, I've got three instances of HLDS running through Screen (I SSH in sometimes from various locations to check on things) and the DynDNS IP updater. Do I need to write a script? What do?
 
The easiest way is using a cronjob. What's the commands you are wanting to run on start up?
 
The easiest way is using a cronjob. What's the commands you are wanting to run on start up?

Everything I need to run is:
Code:
screen -m -S tf2-1 ./srcds_run -game tf -autoupdate -steambin /home/tf2server/hlds/steam +exec server1.cfg -maxplayers 24 +map cp_dustbowl -ip 192.168.1.2 -port 27015 

screen -m -S tf2-2 ./srcds_run -game tf -autoupdate -steambin /home/tf2server/hlds/steam +exec server2.cfg -maxplayers 24 +map pl_badwater -ip 192.168.1.2 -port 27016

screen -m -S tf2-3 ./srcds_run -game tf -autoupdate -steambin /home/tf2server/hlds/steam +exec server3.cfg -maxplayers 24 +map ctf_2fort -ip 192.168.1.2 -port 27017

sudo /usr/sbin/ddclient
I would've posted that before but I was at work on my phone. :)
 
Are you familiar with cronjob?

Run this in your crontab for each user that has to execute the commands you typed above.
@reboot /path/to/command
 
Are you familiar with cronjob?

Run this in your crontab for each user that has to execute the commands you typed above.
@reboot /path/to/command

Nope, not YET. I'll get there, which is why I'm asking.

So, that would apply to every reboot or would it need to be reapplied every time?
 
Once you save your users cronjobs, it's saved all the time. Placing the @reboot in the crontab will issue the command every time the server is rebooted.

Look up how to edit your users crontab. I usually create a file for my users cron jobs that I edit, then execute it with crontab as the user.
 
Back
Top