add server as a service documentation
This commit is contained in:
parent
e38458576d
commit
c1c6597555
21
README.md
21
README.md
@ -60,6 +60,27 @@ Enjoy !
|
|||||||
|
|
||||||
**NOTE** : Some librairies may be missing, you need to install it one by one (test to launch ./et.x86 and see missing libs)
|
**NOTE** : Some librairies may be missing, you need to install it one by one (test to launch ./et.x86 and see missing libs)
|
||||||
|
|
||||||
|
## Create a systemd service (server creation **ONLY**)
|
||||||
|
|
||||||
|
In order to launch the server properly, a systemd service is a right solution instead of the **serverctl** sh script. Todo so :
|
||||||
|
|
||||||
|
* put the **[wolfenstein-et.service](./service/wolfenstein-et.service)** file in **/etc/systemd/system** directory (must be **root**)
|
||||||
|
* replace `<linux_user>` and `<path_to>` placeholder with your configuration
|
||||||
|
* enable the service (on reboot the service will autostart)
|
||||||
|
```bash
|
||||||
|
# as root
|
||||||
|
systemctl enable wolfenstein-et
|
||||||
|
```
|
||||||
|
* put the **[launch_server.bash](./service/launch_server.bash)** wherever you want (do not forget exec rights for your `<linux_user>`)
|
||||||
|
* start the service
|
||||||
|
```bash
|
||||||
|
service wolfenstein-et start
|
||||||
|
```
|
||||||
|
* check the service status
|
||||||
|
```bash
|
||||||
|
service wolfenstein-et status
|
||||||
|
```
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
|
|
||||||
More useful informations : https://wiki.archlinux.org/title/Wolfenstein:_Enemy_Territory
|
More useful informations : https://wiki.archlinux.org/title/Wolfenstein:_Enemy_Territory
|
||||||
|
|||||||
37
service/launch_server.bash
Normal file
37
service/launch_server.bash
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
#
|
||||||
|
# Launch Wolfenstein Enemy Territory server
|
||||||
|
# MUST be launched with systemctl (work as a service)
|
||||||
|
# helped by the `serverctl` script
|
||||||
|
#
|
||||||
|
#####################################################
|
||||||
|
|
||||||
|
ET_BASE=/usr/local/games/enemy-territory
|
||||||
|
ET_HOME=/opt/games/enemy-territory/server
|
||||||
|
ET_IP=
|
||||||
|
ET_PORT=27960
|
||||||
|
ET_INSTANCE=
|
||||||
|
|
||||||
|
SERVER_BASENAME=etded.x86
|
||||||
|
|
||||||
|
LOGFILE=${ET_HOME}/logs/et_server_$(date +"%Y-%m-%d_%H-%M-%S").log
|
||||||
|
|
||||||
|
$ET_BASE/$SERVER_BASENAME \
|
||||||
|
\
|
||||||
|
+set com_hunkmegs "128" \
|
||||||
|
+set com_zonemegs "48" \
|
||||||
|
+set dedicated "2" \
|
||||||
|
+set fs_basepath "$ET_BASE" \
|
||||||
|
+set fs_game "jaymod" \
|
||||||
|
+set fs_homepath "$ET_HOME" \
|
||||||
|
+set net_ip "$ET_IP" \
|
||||||
|
+set net_port "$ET_PORT" \
|
||||||
|
+set omnibot_enable "1" \
|
||||||
|
+set sv_punkbuster "1" \
|
||||||
|
+set ttycon "0" \
|
||||||
|
+set xx_instance "$ET_INSTANCE" \
|
||||||
|
\
|
||||||
|
+exec "server.cfg" \
|
||||||
|
> $LOGFILE 2>&1
|
||||||
10
service/wolfenstein-et.service
Normal file
10
service/wolfenstein-et.service
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Wolfentein Enemy Territory - server
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=<linux_user>
|
||||||
|
ExecStart=<path_to>/launch_server.bash
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Loading…
x
Reference in New Issue
Block a user