[Bug]: Checks that fail before the log directory exists exit with 0

Abierto Apto para principiantes
#5,193 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
bash, linux, shell
Área
backend, cli

Línea de trabajo

Empieza con check_system_dir.sh, check_executable.sh, core_steamcmd.sh y core_exit.sh; después, sigue el orden en que check.sh ejecuta estas comprobaciones antes de que check_logs.sh cree el directorio de registros. Confirma el código de salida de cada error notificado cuando no existe el directorio de registros, incluida una consulta fallida de la IP pública o una descarga fallida del módulo. La tarea estará completa cuando las comprobaciones devuelvan el estado distinto de cero esperado independientemente de si existe el directorio de registros.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

command: start distro: Debian engine: null game: Teamspeak 3 reproducible: always severity: low type: bug
Severity

severity: low

Reproducibility

reproducible: always

Regression

regression: no

Affects latest release

latest-release: yes

User story

As a server admin who runs LinuxGSM from scripts, I want a failed check to return a non-zero exit code even when the log directory does not exist yet, so that the failure is not reported as success.

Script name

ts3server (any server is affected)

Game

Teamspeak 3

Linux distro

Debian 13

Command

command: start

Expected behavior

Cannot access .../serverfiles: No such directory and executable was not found exit with 1, as they do once the log directory exists.

Actual behavior

If the log directory does not exist (a new instance before install, a deleted log directory, or an LGSM_LOGDIR that does not exist), these checks print [ FAIL ] but exit with 0. If the public IP lookup failed, they exit with 2.

Further information

check_system_dir.sh, check_executable.sh and fn_check_steamcmd_user (core_steamcmd.sh) call fn_script_log_fail only if [ -d "${lgsmlogdir}" ], and only fn_script_log_fail sets exitcode=1. core_exit.sh then exits with whatever an earlier step left: the public IP lookup in info_game.sh (0, or 2 when it fails), or the local exitcode in fn_fetch_file (0) when the module was downloaded on this run. check.sh runs these checks before check_logs.sh, which creates the log directory. fn_script_log already skips writing when the log directory is missing, so the guard is not needed. check_root.sh has the same guard but sets exitcode=1 itself. Related: #5191.

Pre-checks
  • I ran update and validate before reporting this issue.

Not run: reproduced on a new develop instance, which has nothing to update or validate yet.

Relevant log output
# New ts3server instance from develop (eb8f34ae), Debian 13 (WSL2).
$ ./ts3server start; echo $?
[ FAIL ] Starting ts3server: Cannot access /home/borzaka/lgsm-test/.../serverfiles: No such directory
0
# Installed instance, log directory and executable removed:
$ ./ts3server start; echo $?
[ FAIL ] Starting ts3server: executable was not found
* /home/borzaka/lgsm-test/.../serverfiles/ts3server
0
Steps to reproduce
  1. Create a new instance: curl -Lo linuxgsm.sh https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/develop/linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh ts3server.
  2. Without installing, run ./ts3server start; echo $? (or stop, monitor). It prints [ FAIL ] ... Cannot access .../serverfiles and 0.
  3. On an installed instance (log directory present), move serverfiles away and run ./ts3server start; echo $?. The same error exits with 1. Move log away too and it exits with 0 again.

🤖 Generated with Claude Code

Lenguaje dominante
Shell
Estrellas
4.9k
Forks
870
Merge medio
18 h 44 min
PR fusionados (30 d)
148

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de GameServerManagers/LinuxGSM

Todos los issues de GameServerManagers/LinuxGSM

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.