Installing KF 2 Server on Linux with WINE

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Mr.OneTwo

FNG / Fresh Meat
May 16, 2017
2
0
0
35
Who can help?

1 Question:
How to add screen + wine to autostart?

I mean that after every server reboot, KF2 server starts automaticly? Where to add this?

Now am starting my KF2 Server so:

screen wine /root/.steam/steamcmd/kf2server/Binaries/Win64/KFserver kf-bioticslab?difficulty=0 -port=7777

2nd Question:

I have copied "Find&Stop" and "Update Script" from main page.

Edited and pasted to /home/kf2scripts/

But after: sh /home/kf2scripts/updatekf2serv.sh

Code:
/home/kf2scripts/updatekf2serv.sh: 6: kill: Illegal number: 
/home/kf2scripts/updatekf2serv.sh: 8: cd: can't cd to /root/.steam/steamcmd/
/home/kf2scripts/updatekf2serv.sh: 9: /home/kf2scripts/updatekf2serv.sh: ./steamcmd: Permission denied

And
after: sh /home/kf2scripts/findkill.sh
Code:
root@*****:~# sh /home/kf2scripts/findkill.sh
/home/kf2scripts/findkill.sh: 6: kill: Illegal number:

And than server will not be killed. He Starts....(((

Scripts looks like:

Find&Kill
Code:
#!/bin/bash
#  
# find PID of running KFServer process on 7777 port
PIDKF2=`ps -ef | grep KFServer | grep 7777 | awk '{print $2}'`
# and kill the server before starting it again to avoid starting multiple servers on the same port
kill $PIDKF2
# then start the server on port 7777
WINEDEBUG="fixme-all" wine /root/.steam/steamcmd/kf2server/Binaries/Win64/KFServer kf-bioticslab?difficulty=0 -port=7777 &

Updatekf2serv

Code:
#!/bin/bash
# 
# find PID of running KFServer process on 7777 port
PIDKF2=`ps -ef | grep KFServer | grep 7777 | awk '{print $2}'`
# and kill the server
kill $PIDKF2
# start the update on the server
cd /root/.steam/steamcmd/
./steamcmd +@sSteamCmdForcePlatformType windows +login anonymous +force_install_dir ./kf2server +app_update 232130 +quit
echo Update job finished!

Hope someone can help me. Thank you very much and sorry for my English
 
Jul 8, 2013
665
2
18
You shouldn't be running any KF servers as root. It's a security risk.

If you want the server to start when your computer start, that's the init system's job. You need to look at the documentation for your init system and see how to do it. Chances are you can google it and that'll get you 95% of the way there.