Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

User:Webb/Steam dedicated server: Difference between revisions

From TF2 Classified Wiki
Webb (talk | contribs)
wip
 
Webb (talk | contribs)
No edit summary
Line 158: Line 158:
<pre>
<pre>
$ mkdir ~/bin
$ mkdir ~/bin
$ nano ~/bin/update-sdk.steamcmd
$ nano ~/bin/update-classified.steamcmd
</pre>
</pre>


Line 176: Line 176:
<pre>
<pre>
$ . /etc/environment
$ . /etc/environment
$ steamcmd +runscript /home/srcds/bin/update-sdk.steamcmd
$ steamcmd +runscript /home/srcds/bin/update-classified.steamcmd
</pre>
 
Similarly, we will create one for the live TF2 server as that will need to be updated occasionally. We'll put
it at <code>/home/srcds/bin/update-tf.steamcmd</code>
 
<pre>
@ShutdownOnFailedCommand 1 //set to 0 if updating multiple servers at once
@NoPromptForPassword 1
force_install_dir /home/srcds/tf
login anonymous
app_update 232250
quit
</pre>
</pre>


Line 194: Line 206:
StandardError=journal
StandardError=journal
StandardOutput=journal
StandardOutput=journal
WorkingDirectory=/home/srcds/sdk
WorkingDirectory=/home/srcds/classified
RemainAfterExit=no
RemainAfterExit=no
ExecStartPre=/usr/games/steamcmd +runscript /home/srcds/bin/update-sdk.steamcmd # Exclude or comment this if you don't want to check for an update on each restart
ExecStartPre=/usr/games/steamcmd +runscript /home/srcds/bin/update-tf.steamcmd # Exclude or comment this and the next line if you don't want to check for an update before (re)starting
Environment="LD_LIBRARY_PATH=".:bin:$LD_LIBRARY_PATH""
ExecStartPre=/usr/games/steamcmd +runscript /home/srcds/bin/update-classified.steamcmd
ExecStart=/usr/bin/script -e -c "/home/srcds/sdk/srcds_linux +map ctf_2fort -game tf2classic +maxplayers 24" /dev/null
Environment="LD_LIBRARY_PATH=".:bin/linux64:$LD_LIBRARY_PATH""
ExecStart=/usr/bin/script -e -c "/home/srcds/classified/srcds_linux -tf_path /home/srcds/tf +map ctf_2fort +maxplayers 24" /dev/null
TimeoutStartSec=infinity
TimeoutStartSec=infinity
Restart=always
Restart=always
Line 212: Line 225:
</pre>
</pre>


You may create as many services as you have TF2C servers but remember to name the service files uniquely. When modifying service files, remember to run <code>systemctl daemon-reload</code> before restarting the service.
You may create as many services as you have TF2C servers but remember to name the service files uniquely. When modifying existing service files, remember to run <code>systemctl daemon-reload</code> before restarting the service.


=== Automatic restarts using crontab ===
=== Automatic restarts using crontab ===
Line 236: Line 249:
</pre>
</pre>


''</br>See also [[Dedicated_Linux_server_extras|Dedicated Linux Server Extras]].''
[[Category:Guides]]
[[Category:Guides]]