F1bonacc1 / process-compose

Process Compose is a simple and flexible scheduler and orchestrator to manage non-containerized applications.
https://f1bonacc1.github.io/process-compose/
Apache License 2.0
1.34k stars 52 forks source link

fix: check if unix socket is in use #224

Closed mkenigs closed 3 months ago

mkenigs commented 3 months ago

Currently, if two instances of process-compose are started with the same unix socket, the first instance is orphaned without any way to shut it down:

> process-compose up -u /tmp/sock --tui=false >/dev/null 2>&1 &
[1] 52138

> process-compose up -u /tmp/sock --tui=false >/dev/null 2>&1 &
[2] 52217

> process-compose down -u /tmp/sock
[2]  + done       process-compose up -u /tmp/sock --tui=false > /dev/null 2>&1

> process-compose down -u /tmp/sock
24-08-07 11:59:19.436 FTL failed to stop project error="Post \"http://unix/project/stop/\": dial unix /tmp/sock: connect: no such file or directory"

> pgrep process-compose
52138

Instead of unconditionally removing an existing unix socket, error if it is already in use.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud