fix(mux): delete server.lock before starting server (#591)

## Summary

Remove stale `~/.mux/server.lock` file before starting the mux server to
prevent startup failures when a previous server didn't clean up
properly.

## Changes

- Added `rm -f "${HOME}/.mux/server.lock"` at the start of the `run_mux`
function
- Bumped version to 1.0.5

## Testing

- All Terraform tests pass
- Shellcheck passes with only style warnings (unrelated to this change)

---------

Co-authored-by: Atif Ali <atif@coder.com>
This commit is contained in:
Michael Suchacz
2025-12-09 17:33:01 +01:00
committed by GitHub
parent d745117782
commit 758aba4c2a
2 changed files with 9 additions and 6 deletions
+6 -6
View File
@@ -14,7 +14,7 @@ Automatically install and run [mux](https://github.com/coder/mux) in a Coder wor
module "mux" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/mux/coder"
version = "1.0.4"
version = "1.0.5"
agent_id = coder_agent.main.id
}
```
@@ -37,7 +37,7 @@ module "mux" {
module "mux" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/mux/coder"
version = "1.0.4"
version = "1.0.5"
agent_id = coder_agent.main.id
}
```
@@ -48,7 +48,7 @@ module "mux" {
module "mux" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/mux/coder"
version = "1.0.4"
version = "1.0.5"
agent_id = coder_agent.main.id
# Default is "latest"; set to a specific version to pin
install_version = "0.4.0"
@@ -61,7 +61,7 @@ module "mux" {
module "mux" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/mux/coder"
version = "1.0.4"
version = "1.0.5"
agent_id = coder_agent.main.id
port = 8080
}
@@ -75,7 +75,7 @@ Run an existing copy of mux if found, otherwise install from npm:
module "mux" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/mux/coder"
version = "1.0.3"
version = "1.0.5"
agent_id = coder_agent.main.id
use_cached = true
}
@@ -89,7 +89,7 @@ Run without installing from the network (requires mux to be pre-installed):
module "mux" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/mux/coder"
version = "1.0.4"
version = "1.0.5"
agent_id = coder_agent.main.id
install = false
}
+3
View File
@@ -5,6 +5,9 @@ RESET='\033[0m'
MUX_BINARY="${INSTALL_PREFIX}/mux"
function run_mux() {
# Remove stale server lock if present
rm -f "$HOME/.mux/server.lock"
local port_value
port_value="${PORT}"
if [ -z "$port_value" ]; then