Linuxgsm: details command doesn't work b/c of incorrect option for ps

Created on 4 Nov 2019  路  8Comments  路  Source: GameServerManagers/LinuxGSM

User Story

As a game admin, I want see the game server details so that I know the details.

Basic info

  • Distro: CentOS 7
  • Game: sdtd
  • Command: details

Further Information

[sdtdhost@sdtd ~]$ ./sdtdserver details
Details sdtdserver: Check IP: 172.131.2.25
error: list of session leaders OR effective group names must follow -g

Usage:
 ps [options]

 Try "ps --help <simple|list|output|threads|misc|all>";
  or "ps --help <s|l|o|t|m|a>";
 for additional help text.

For more details see ps(1).


Distro Details
============================
Distro:   CentOS Linux 7 (Core)
Arch:   x86_64
Kernel:   3.10.0-1062.1.2.el7.x86_64
Hostname:   sdtd
Uptime:   7d, 23h, 3m
tmux:   tmux 1.8
glibc:   2.17

The problem was introduced in commit: https://github.com/GameServerManagers/LinuxGSM/commit/7a3fa84fa618e7e09005ab39cc5fc09dbf9ceb65#diff-4101fe6fe2424e94b74581a82a5c6511L104

Line:

cpuused=$(ps --forest -o pcpu -g "${gameserverpid}"|awk '{s+=$1} END {print s}')

should be:

cpuused=$(ps --forest -o pcpu -p "${gameserverpid}"|awk '{s+=$1} END {print s}')

since the -g option takes a group ID as an argument and not a PID. It looks like a typo in the mentioned commit. cc @dgibbs64 @Frisasky

There is also a related issue: #2570

details pr-available priority bug

Most helpful comment

Issue-Label Bot is automatically applying the label type: bug to this issue, with a confidence of 0.68. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 8 comments

Issue-Label Bot is automatically applying the label type: bug to this issue, with a confidence of 0.68. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

pschiffe did actually find the culprit of the issue, I can confirm that replacing g with p does fix the issue!
At least with monitor command
details still spams this very same error

this will be fixed for the next release

This issue is closed including the previous one I've made, yet the issue is still not resolved

root@kiepownica:/home/kiepownica# cd /etc/
root@kiepownica:/etc# ./rc.local
[ .... ] Starting ts3server: TeamSpeak 3 Servererror: list of process IDs must follow -p

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
error: list of session leaders OR effective group names must follow -g

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
error: list of session leaders OR effective group names must follow -g

Usage:
 ps [options]

 Try 'ps --help <simple|list|output|threads|misc|all>'
  or 'ps --help <s|l|o|t|m|a>'
 for additional help text.

For more details see ps(1).
[ INFO ] Starting ts3server: TeamSpeak 3 Server is already running
root@kiepownica:/etc#

@dgibbs64

@olokos thanks for reminding me. I picked up the issue again today specifically to do with multiple instances such as mcserver and mcserver-2. I already have a fix in mind

I think my previous fix partly resolved the issue but it turns out there are other instances I didn't spot

You're very welcome, I'm glad you are taking notice of this issue.
Please do let me know when another fix to this gets pushed so I will test it ASAP.

I did ./ts3server ul
and now the ts3server doesnt start whatsoever using LGSM

ts3server@kiepownica:~$ ./ts3server start
[ .... ] Starting ts3server: TeamSpeak 3 Serverno server running on /tmp/tmux-1002/default
[ FAIL ] Starting ts3server: Unable to start TeamSpeak 3 Server

Additionally this is the output of ./ts3server m

ts3server@kiepownica:~$ ./ts3server m
[ERROR ] Monitor ts3server: Checking session: FAIL
[  OK  ] Postdetails ts3server: Posting details to hastebin.com for 30D
Please share the following url for support: https://hastebin.com/<!DOCTYPE html>
<html>
<head>
width=device-width, initial-scale=1

<title>Application Error</title>

                  html,body,iframe {
                        margin: 0;
                        padding: 0;
                  }
                  html,body {
                        height: 100%;
                        overflow: hidden;
                  }
                  iframe {
                        width: 100%;
                        height: 100%;
                        border: 0;
                  }
                </style>
</head>
<body>

</body>
</html>
[ .... ] Alert ts3server: Sending Telegram alertcurl: (3) <url> malformed
[ FAIL ] Alert ts3server: Sending Telegram alert: {"ok":false,"error_code":400,"description":"Bad Request: can't parse entities Expected end tag at byte offset 715"}
[ INFO ] Stopping ts3server: TeamSpeak 3 Server is already stopped
[ .... ] Starting ts3server: TeamSpeak 3 Serverno server running on /tmp/tmux-1002/default
[ FAIL ] Starting ts3server: Unable to start TeamSpeak 3 Server
Was this page helpful?
0 / 5 - 0 ratings

Related issues

BarbieQ1 picture BarbieQ1  路  4Comments

Audrik picture Audrik  路  3Comments

n0x-io picture n0x-io  路  3Comments

DavidRayner picture DavidRayner  路  3Comments

dgibbs64 picture dgibbs64  路  3Comments