Changes between Version 1 and Version 2 of SmokinGuns/Server/Dedicated


Ignore:
Timestamp:
Aug 26, 2014 7:35:03 PM (3 years ago)
Author:
barto
Comment:

Added systemd unit file explanations

Legend:

Unmodified
Added
Removed
Modified
  • SmokinGuns/Server/Dedicated

    v1 v2  
    99    * with screen 
    1010    * with an init.d daemon (if you have root) 
     11    * with a systemd unit file (if you have root) 
    1112 
    1213= Creating a new user = 
     
    108109sgserver stop 
    109110}}} 
     111 
     112=== With a systemd unit file === 
     113It is similar as the previous method, but instead of having a classic BSD-like init system (SysVinit, Upstart or OpenRC), your linux distribution comes with systemd. 
     114One big change is that now, you have the possibility to create a unit file instead of a starting shell script. 
     115 
     116For this, you can create a file into {{{/etc/systemd/system/sgserver.service}}} or {{{/usr/lib/systemd/system/sgserver.service}}} with this following content: 
     117{{{ 
     118[Unit] 
     119Description=Smokin' Guns dedicated server 
     120 
     121[Service] 
     122User=user # account we created 
     123ExecStart=/home/user/sgserver/smokinguns_dedicated +set dedicated 2 +set net_port 27960 +set com_hunkmegs 128 +exec server.cfg 
     124Restart=on-abort 
     125 
     126[Install] 
     127WantedBy=multi-user.target 
     128}}} 
     129 
     130You can now use your server with the commands provided by systemd: 
     131 
     132start: 
     133{{{ 
     134systemctl start sgserver.service 
     135}}} 
     136 
     137stop: 
     138{{{ 
     139systemctl stop sgserver.service 
     140}}} 
     141 
     142If you need more commands, you can have a look at the [https://wiki.archlinux.org/index.php/Systemd ArchLinux Wiki page].