Browse Source

fix(details): bind ns2 web admin, list squad beacon and sm RCON (#5229)

* fix(details): bind ns2 web admin, list squad beacon and sm RCON

ns2 and ns2c passed -webdomain 0.0.0.0, which the engine cannot resolve, so the web admin and the ns2 mod server never started. Pass httpip from check_ip.sh instead, and -modserveraddress for the ns2 mod server.

Squad beacon (15000/udp) and Soulmask RCON (19000/tcp) were open but unlisted; set them with -beaconport and -rconport and add the rows. Drop the Soulmask Game TCP row.

Find srcds_linux, srcds_linux64 or srcds by the tmux pane's session rather than as a direct child, so the Source Steam port detection works. Same lookup for hlds.

Note on the Client row in servers.json for gmod, l4d, l4d2 and nd, which never bind it.

* fix(details): sb RCON is on by default once the stock config is kept

* fix(details): describe the Source client port as unused, not outbound
Daniel Gibbs 16 hours ago
parent
commit
be67fd6687

+ 1 - 1
lgsm/config-default/config-lgsm/ns2cserver/_default.cfg

@@ -24,7 +24,7 @@ serverpassword=""
 # -password \"${serverpassword}\"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="-name '${servername}' -port ${port} -webadmin -webdomain ${ip} -webuser ${httpuser} -webpassword '${httppassword}' -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path '${servercfgdir}' -modstorage '${modstoragedir}' -mods '${mods}'"
+startparameters="-name '${servername}' -port ${port} -webadmin -webdomain ${httpip} -webuser ${httpuser} -webpassword '${httppassword}' -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path '${servercfgdir}' -modstorage '${modstoragedir}' -mods '${mods}'"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 1 - 1
lgsm/config-default/config-lgsm/ns2server/_default.cfg

@@ -25,7 +25,7 @@ serverpassword=""
 # -password '${serverpassword}'
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="-name '${servername}' -port ${port} -webadmin -webdomain ${ip} -webuser ${httpuser} -webpassword '${httppassword}' -webport ${httpport} -startmodserver -modserverport ${modserverport} -map ${defaultmap} -limit ${maxplayers} -speclimit ${maxspectators} -config_path '${servercfgdir}' -logdir '${gamelogdir}' -modstorage '${modstoragedir}'"
+startparameters="-name '${servername}' -port ${port} -webadmin -webdomain ${httpip} -webuser ${httpuser} -webpassword '${httppassword}' -webport ${httpport} -startmodserver -modserverport ${modserverport} -modserveraddress ${httpip} -map ${defaultmap} -limit ${maxplayers} -speclimit ${maxspectators} -config_path '${servercfgdir}' -logdir '${gamelogdir}' -modstorage '${modstoragedir}'"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 2 - 1
lgsm/config-default/config-lgsm/smserver/_default.cfg

@@ -14,13 +14,14 @@ serverpassword=""
 adminpassword=""
 port="8777"
 queryport="27015"
+rconport="19000"
 telnetport="18888"
 maxplayers="50"
 backupinterval="15"  # Backup interval in minutes.
 defaultmap="Level01_Main"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
-startparameters="WS ${defaultmap} -MultiHome=${ip} -Port=${port} -EchoPort=${telnetport} -QueryPort=${queryport} -SteamServerName='${servername}' -PSW='${serverpassword}' -adminpsw='${adminpassword}' -MaxPlayers=${maxplayers} -initbackup -backupinterval=${backupinterval} -UTF8Output -forcepassthrough -log"
+startparameters="WS ${defaultmap} -MultiHome=${ip} -Port=${port} -EchoPort=${telnetport} -QueryPort=${queryport} -rconport=${rconport} -SteamServerName='${servername}' -PSW='${serverpassword}' -adminpsw='${adminpassword}' -MaxPlayers=${maxplayers} -initbackup -backupinterval=${backupinterval} -UTF8Output -forcepassthrough -log"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 2 - 1
lgsm/config-default/config-lgsm/squadserver/_default.cfg

@@ -11,10 +11,11 @@
 ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
 port="7787"
 queryport="27165"
+beaconport="15000"
 
 ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
 ## Game Server Docs | https://squad.fandom.com/wiki/Dedicated_server
-startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport}"
+startparameters="-MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -beaconport=${beaconport}"
 
 ## Extra Parameters | https://docs.linuxgsm.com/configuration/start-parameters#extra-parameters
 # Added to the end of startparameters.

+ 74 - 33
lgsm/data/servers.json

@@ -48,7 +48,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -227,7 +228,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -347,7 +349,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -407,7 +410,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -457,7 +461,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -674,7 +679,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -724,7 +730,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -784,7 +791,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -894,7 +902,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -928,7 +937,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -984,7 +994,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1046,7 +1057,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1138,7 +1150,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1172,7 +1185,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused. Garry's Mod picks a random client port and ignores this setting."
         }
       ]
     },
@@ -1216,7 +1230,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1266,7 +1281,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1365,7 +1381,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1421,7 +1438,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1455,7 +1473,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1617,7 +1636,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused. This game opens no client port."
         }
       ]
     },
@@ -1651,7 +1671,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused. This game opens no client port."
         }
       ]
     },
@@ -1741,7 +1762,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -1845,7 +1867,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused. This game opens no client port."
         }
       ]
     },
@@ -1889,7 +1912,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -2116,7 +2140,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -2469,8 +2494,7 @@
           "label": "RCON",
           "variable": "rconport",
           "default": 21026,
-          "protocols": ["tcp"],
-          "note": "Off by default. Set runRconServer to true and an rconServerPassword in starbound_server.config to open it."
+          "protocols": ["tcp"]
         }
       ]
     },
@@ -2548,7 +2572,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -2580,7 +2605,7 @@
           "label": "Game",
           "variable": "port",
           "default": 8777,
-          "protocols": ["udp", "tcp"]
+          "protocols": ["udp"]
         },
         {
           "label": "Query",
@@ -2588,6 +2613,12 @@
           "default": 27015,
           "protocols": ["udp"]
         },
+        {
+          "label": "RCON",
+          "variable": "rconport",
+          "default": 19000,
+          "protocols": ["tcp"]
+        },
         {
           "label": "Telnet",
           "variable": "telnetport",
@@ -2665,6 +2696,12 @@
           "default": 27165,
           "protocols": ["udp"]
         },
+        {
+          "label": "Beacon",
+          "variable": "beaconport",
+          "default": 15000,
+          "protocols": ["udp"]
+        },
         {
           "label": "RCON",
           "variable": "rconport",
@@ -2767,7 +2804,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -2801,7 +2839,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -3295,7 +3334,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     },
@@ -3329,7 +3369,8 @@
           "label": "Client",
           "variable": "clientport",
           "default": 27005,
-          "protocols": ["udp"]
+          "protocols": ["udp"],
+          "note": "Unused by the server and needs no port forward. Give each server on the same host its own value, as -strictportbind stops a second server that finds it taken."
         }
       ]
     }

+ 3 - 3
lgsm/modules/info_distro.sh

@@ -13,11 +13,11 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 if [ "${status}" == "1" ]; then
 	gameserverpid="$(TERM=screen tmux -L "${socketname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')"
 	if [ "${engine}" == "source" ]; then
-		srcdslinuxpid="$(pgrep -P "${gameserverpid}" -x srcds_linux 2> /dev/null | head -n 1)"
+		srcdslinuxpid="$(pgrep -s "${gameserverpid}" -x 'srcds_linux|srcds_linux64|srcds' 2> /dev/null | head -n 1)"
 	elif [ "${querytype}" == "protocol-valve-won" ]; then
-		hldslinuxpid="$(pgrep -P "${gameserverpid}" -x hlds_i686 2> /dev/null | head -n 1)"
+		hldslinuxpid="$(pgrep -s "${gameserverpid}" -x hlds_i686 2> /dev/null | head -n 1)"
 	elif [ "${engine}" == "goldsrc" ]; then
-		hldslinuxpid="$(pgrep -P "${gameserverpid}" -x hlds_linux 2> /dev/null | head -n 1)"
+		hldslinuxpid="$(pgrep -s "${gameserverpid}" -x hlds_linux 2> /dev/null | head -n 1)"
 	fi
 fi
 ### Distro information

+ 2 - 0
lgsm/modules/info_game.sh

@@ -2147,6 +2147,7 @@ fn_info_game_sm() {
 	adminpassword="${adminpassword:-"NOT SET"}"
 	port="${port:-"0"}"
 	queryport="${queryport:-"0"}"
+	rconport="${rconport:-"0"}"
 	maxplayers="${maxplayers:-"0"}"
 	# telnet config
 	telnetenabled=true
@@ -2253,6 +2254,7 @@ fn_info_game_squad() {
 	maxplayers="${maxplayers:-"0"}"
 	port="${port:-"0"}"
 	queryport="${queryport:-"0"}"
+	beaconport="${beaconport:-"0"}"
 	rconport="${rconport:-"0"}"
 	servername="${servername:-"NOT SET"}"
 	if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then

+ 2 - 1
lgsm/modules/info_messages.sh

@@ -1645,8 +1645,8 @@ fn_info_messages_sm() {
 	{
 		fn_port "header"
 		fn_port "Game" port udp
-		fn_port "Game" port tcp
 		fn_port "Query" queryport udp
+		fn_port "RCON" rconport tcp
 		fn_port "Telnet" telnetport tcp
 	} | column -s $'\t' -t
 	echo -e ""
@@ -1722,6 +1722,7 @@ fn_info_messages_squad() {
 		fn_port "header"
 		fn_port "Game" port udp
 		fn_port "Query" queryport udp
+		fn_port "Beacon" beaconport udp
 		fn_port "RCON" rconport tcp
 	} | column -s $'\t' -t
 }