User:Webb/Steam dedicated server: Difference between revisions
From TF2 Classified Wiki
More actions
wip |
No edit summary |
||
| Line 158: | Line 158: | ||
<pre> | <pre> | ||
$ mkdir ~/bin | $ mkdir ~/bin | ||
$ nano ~/bin/update- | $ nano ~/bin/update-classified.steamcmd | ||
</pre> | </pre> | ||
| Line 176: | Line 176: | ||
<pre> | <pre> | ||
$ . /etc/environment | $ . /etc/environment | ||
$ steamcmd +runscript /home/srcds/bin/update- | $ 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/ | WorkingDirectory=/home/srcds/classified | ||
RemainAfterExit=no | RemainAfterExit=no | ||
ExecStartPre=/usr/games/steamcmd +runscript /home/srcds/bin/update- | 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/ | 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> | ||
[[Category:Guides]] | [[Category:Guides]] | ||