codex remote-control start fails on Alpine Linux 3.23.3 with pid-managed app server start-time error

Open 💬 0 comments Opened Jun 20, 2026 by Boilerplate4u

Summary

codex remote-control works in foreground mode, but codex remote-control start fails when starting the daemon-managed app-server on Alpine Linux 3.23.3.

This looks like a bug in the daemon / pid-managed app-server startup path, not in remote-control itself, because the foreground path works.

Environment

  • OS: Alpine Linux 3.23.3
  • Codex CLI: codex-cli 0.141.0
  • Binary:
  • /root/.local/bin/codex
  • resolves to: /root/.codex/packages/standalone/releases/0.141.0-x86_64-unknown-linux-musl/bin/codex
  • Platform/build: 0.141.0-x86_64-unknown-linux-musl
  • User: root

codex doctor --summary --ascii --no-color reports:

  • install: ok
  • auth: ok
  • websocket: ok
  • reachability: ok
  • app-server: not running in persistent mode
  • no fail, only one optional MCP warning

What works

Foreground remote-control works:

codex remote-control

Output:

Starting app-server with remote control enabled...
This machine is available for remote control as sdwan.
Press Ctrl-C to stop.

What fails

Daemon-managed remote-control fails:

codex remote-control start

Output:

Starting app-server daemon with remote control enabled...
Error: failed to record pid-managed app-server process 7932 startup

Caused by:
    failed to read start time for pid-managed app server 7932

The same failure also happened with other PIDs, for example 7111, 7170, 7243, and 7462.

Reproduction steps

codex --version
codex doctor --summary --ascii --no-color
codex remote-control

Foreground mode works.

Then stop it with Ctrl-C and run:

codex remote-control start

Daemon mode fails with:

failed to record pid-managed app-server process <pid> startup
failed to read start time for pid-managed app server <pid>

Additional checks performed

/proc is mounted and readable:

mount | grep ' /proc '

Output:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)

/proc/self/stat is readable:

cat /proc/self/stat | cut -d' ' -f1-5

Example output:

7203 (cat) R 7076 7203

The failed PID does not exist after the error:

ls -ld /proc/7111

Output:

ls: /proc/7111: No such file or directory

This suggests the app-server process exits before the daemon manager can record/read its start time.

App-server daemon state/logs

Found daemon state:

/root/.codex/app-server-daemon
/root/.codex/app-server-daemon/daemon.lock
/root/.codex/app-server-daemon/app-server.pid.lock
/root/.codex/app-server-daemon/app-server.stderr.log
/root/.codex/app-server-daemon/app-server-updater.pid.lock
/root/.codex/app-server-control
/root/.codex/app-server-control/app-server-startup.lock

app-server.stderr.log was empty.

settings.json contained:

{
  "remoteControlEnabled": true
}

Direct app-server foreground test

This command exits immediately with rc=0 and does not appear to leave a socket:

rm -f /tmp/codex-appserver-test.sock /tmp/codex-appserver.out /tmp/codex-appserver.err
timeout 2s codex app-server --listen unix:///tmp/codex-appserver-test.sock >/tmp/codex-appserver.out 2>/tmp/codex-appserver.err
echo "rc=$?"
ls -l /tmp/codex-appserver-test.sock 2>/dev/null || true
cat /tmp/codex-appserver.out
cat /tmp/codex-appserver.err

Output:

rc=0

No stdout/stderr was produced.

Expected behavior

codex remote-control start should start the remote-control app-server daemon successfully on Alpine Linux 3.23.3, or at least report the underlying app-server startup failure.

Actual behavior

codex remote-control start fails while trying to record the pid-managed app-server startup:

failed to record pid-managed app-server process <pid> startup
failed to read start time for pid-managed app server <pid>

No useful stderr is written to:

/root/.codex/app-server-daemon/app-server.stderr.log

Working workaround

Use foreground mode:

codex remote-control

Do not use daemon mode:

codex remote-control start

Suspected issue

The daemon/pid-managed startup path appears to assume that the spawned app-server process remains alive long enough for /proc/<pid>/stat to be read. On Alpine Linux 3.23.3 with the musl standalone Codex build, the child process exits before that happens, producing a misleading PID start-time error instead of exposing the real startup/daemonization problem.

View original on GitHub ↗