mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-15 03:58:27 +00:00
use ulimit -n instead of change the limits globally
This commit is contained in:
parent
0066063c2d
commit
10a6b21312
20
README.md
20
README.md
@ -10,25 +10,7 @@ We assume you have created the `steam` user to store steamcmd and your ARK serve
|
||||
|
||||
## Requirements
|
||||
|
||||
### Increase max open files
|
||||
|
||||
Edit /etc/sysctl.conf and set:
|
||||
```
|
||||
fs.file-max=100000
|
||||
```
|
||||
Edit /etc/security/limits.conf and set these limits:
|
||||
```
|
||||
* soft nofile 100000
|
||||
* hard nofile 100000
|
||||
```
|
||||
Add the following line to `/etc/pam.d/common-session` (Debian/Ubuntu) or `/etc/pam.d/system-auth` (RHEL/CentOS/Fedora):
|
||||
```
|
||||
session required pam_limits.so
|
||||
```
|
||||
|
||||
After these edits, you'll need to restart your bash session or reconnect to your SSH shell to make the changes effective.
|
||||
|
||||
### Open firewall ports
|
||||
To allow your ARK server to communicate with the outside you have to open some ports in your firewall:
|
||||
|
||||
```sh
|
||||
iptables -I INPUT -p udp --dport 27016 -j ACCEPT
|
||||
|
||||
@ -34,6 +34,7 @@ timestamp=$( date +%T )
|
||||
GREEN="\\033[1;32m"
|
||||
RED="\\033[1;31m"
|
||||
NORMAL="\\033[0;39m"
|
||||
maxOpenFiles=100000
|
||||
|
||||
arkmanagerLog="arkmanager.log" # here are logged the actions performed by arkmanager
|
||||
arkserverLog="arkserver.log" # here is logged the output of ShooterGameServer
|
||||
@ -187,6 +188,8 @@ doStart() {
|
||||
arkserveropts="${arkserveropts}?listen"
|
||||
# run the server in background
|
||||
echo "$timestamp: start" >> "$logdir/$arkserverLog"
|
||||
# set max open files limit before we start the server
|
||||
ulimit -n $maxOpenFiles
|
||||
nohup "$arkserverroot/$arkserverexec" "$arkserveropts" </dev/null >"$logdir/$arkserverLog" 2>&1 & # output of this command is logged
|
||||
echo "$timestamp: start" >> "$logdir/$arkmanagerLog"
|
||||
tput rc; tput ed;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user