Raised This Month: $51 Target: $400
 12% 

cs:go Server launch on boot breaks the server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gonzo_Who
Junior Member
Join Date: Aug 2022
Old 09-17-2022 , 17:54   cs:go Server launch on boot breaks the server
Reply With Quote #1

I have this strange issue where if my servers running on custom ports launch in a tmux session on reboot they break and I'm unable to use those custom ports for the csgo servers again... 27016,27017,27026 are all blocked now. The only thing that fixes it is changing the server's port to one that has never been used before so 27027 for example. If the server reboots it will break 27027 and I will have to change it again.
Gonzo_Who is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 09-17-2022 , 18:14   Re: cs:go Server launch on boot breaks the server
Reply With Quote #2

What is your tmux commands for your session?

It sounds like you're just creating a new session and the server is still alive and using that port.

Run: netstat -tulpn | grep 2701
Maxximou5 is offline
Gonzo_Who
Junior Member
Join Date: Aug 2022
Old 09-18-2022 , 07:46   Re: cs:go Server launch on boot breaks the server
Reply With Quote #3

This is the .sh file that launches the tmux session

#!/bin/bash

# Create a new session named "newsess" and run a command inside the session
tmux new-session -d -s retakes1
tmux send-keys -t retakes1 "./retakes1.sh" Enter
# Attach to session named "newsess"
tmux attach -t retakes1

and this is the crontab command to run that command on boot.

@reboot /home/csgo/bootretakes1.sh

If I list tmux sessions it displays none are open so I'm not sure if they are running in the background somewhere. To close them I go into the servers tmux session and just type exit. Also the command you said I should try displays no information.

Last edited by Gonzo_Who; 09-18-2022 at 07:48.
Gonzo_Who is offline
luck3rhoch3
New Member
Join Date: Sep 2022
Old 09-18-2022 , 16:44   Re: cs:go Server launch on boot breaks the server
Reply With Quote #4

If you use crontab you have can't use relative pathes, so ./retakes1.sh won't work.

So putting

cd /path/to/your/scriptfolder/

at the beginning of your script should work.

Or try setting the absolute path to the script. Instead of "./retakes1.sh" "/home/csgo/retakes1.sh" should work.

also make the following addition to your crontab:

@reboot /home/csgo/bootretakes1.sh >> /home/csgo/logs/"reboot_`date +\%Y_\%m_\%d_\%H:\%M:\%S`.log" 2>&1

so you can check the log what's happening.

Also just set it to

* * * * * /home/csgo/bootretakes1.sh >> /home/csgo/logs/"reboot_`date +\%Y_\%m_\%d_\%H:\%M:\%S`.log" 2>&1

to test it, so the script runs every minute, so you don't have to reboot all the time.
luck3rhoch3 is offline
Krelle1911
Member
Join Date: Mar 2013
Location: Randers
Old 09-21-2022 , 01:17   Re: cs:go Server launch on boot breaks the server
Reply With Quote #5

You can launch on boot with crontab with this command. I use this for 15 CSGO servers.


Quote:
@reboot cd /home/csgo/ && sh bootretakes1.sh
__________________
Krelle1911 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode