Fix: start.sh Service-Detection - rcctl/systemd hängt bei Start #99

Closed
opened 2025-09-01 21:19:56 +02:00 by michael · 0 comments
Owner

Problem

Das start.sh Script hängt bei Service-Start über rcctl/systemd, weil es keine Service-Detection hat.

Symptom:

  • doas rcctl start furt hängt (timeout)
  • Script läuft im Foreground statt Background
  • rcctl wartet endlos auf Rückkehr

Root-Cause:

# Aktueller Code (scripts/start.sh Zeile 63)
exec "$LUA_COMMAND" src/main.lua

Problem: exec läuft im Foreground - Service-Manager wartet endlos.

Lösung

Service-Detection hinzufügen (POSIX-kompatibel):

# Service vs Interactive Detection
if [ ! -t 0 ] || [ ! -t 1 ]; then
    # Service mode - Background
    "$LUA_COMMAND" src/main.lua &
else
    # Interactive mode - Foreground  
    exec "$LUA_COMMAND" src/main.lua
fi

Technische Details

Service-Detection Logic:

  • [ ! -t 0 ] - kein stdin TTY (Service-Context)
  • [ ! -t 1 ] - kein stdout TTY (Service-Context)
  • Background-Start mit & für Services
  • Foreground-Start für manuelle Nutzung

Betriebssystem-Kompatibilität:

  • OpenBSD rcctl ✓
  • Linux systemd ✓
  • FreeBSD rc.d ✓
  • Standard POSIX sh

Testing

Vor Fix:

doas rcctl start furt  # hängt (timeout)

Nach Fix:

doas rcctl start furt  # startet erfolgreich
doas rcctl check furt  # zeigt (ok)

Betroffene Dateien

  • scripts/start.sh Zeile 63

Priorität: High - blockiert Service-Installation

## Problem Das start.sh Script hängt bei Service-Start über rcctl/systemd, weil es keine Service-Detection hat. **Symptom:** - `doas rcctl start furt` hängt (timeout) - Script läuft im Foreground statt Background - rcctl wartet endlos auf Rückkehr **Root-Cause:** ```bash # Aktueller Code (scripts/start.sh Zeile 63) exec "$LUA_COMMAND" src/main.lua ``` **Problem:** `exec` läuft im Foreground - Service-Manager wartet endlos. ## Lösung Service-Detection hinzufügen (POSIX-kompatibel): ```bash # Service vs Interactive Detection if [ ! -t 0 ] || [ ! -t 1 ]; then # Service mode - Background "$LUA_COMMAND" src/main.lua & else # Interactive mode - Foreground exec "$LUA_COMMAND" src/main.lua fi ``` ## Technische Details **Service-Detection Logic:** - `[ ! -t 0 ]` - kein stdin TTY (Service-Context) - `[ ! -t 1 ]` - kein stdout TTY (Service-Context) - Background-Start mit `&` für Services - Foreground-Start für manuelle Nutzung **Betriebssystem-Kompatibilität:** - OpenBSD rcctl ✓ - Linux systemd ✓ - FreeBSD rc.d ✓ - Standard POSIX sh ## Testing **Vor Fix:** ```bash doas rcctl start furt # hängt (timeout) ``` **Nach Fix:** ```bash doas rcctl start furt # startet erfolgreich doas rcctl check furt # zeigt (ok) ``` ## Betroffene Dateien - `scripts/start.sh` Zeile 63 **Priorität:** High - blockiert Service-Installation
michael added the
effort
small
priority
high
status
to-go
type
bug
labels 2025-09-01 21:19:56 +02:00
michael added this to the v0.1.2 - Gateway Basics milestone 2025-09-02 18:38:18 +02:00
michael 2025-09-02 18:41:46 +02:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DAW/furt#99
No description provided.