ChatGPTClaudeGrok / X / CursorGemini

Unattended dsh web on CI, servers, and scripts

Install & Get StartedPublished 2026-11-02Author: DeepSeek Plugin Market
npxunattendedCIdsh webhealth check
With nobody at the terminal, version, listen address, and data directory must be fixed. Covers log capture, a port probe, exit codes, and a minimal script.

Unattended dsh web differs from a laptop start in three inputs you must fix: version, listen address, and data directory. Leave any of them open and the same script works today and fails tomorrow.

How dsh web unattended runs differ

On a laptop a person can improvise; unattended runs only have conventions. The differences concentrate in four places:

DimensionLaptop startUnattended
InteractionYou can answer prompts-y required, version pinned
BrowserOpens automatically, someone sees itNo desktop, none available
LogsScrolling terminal is enoughMust be written to disk and searchable
Failure signalA human glanceProbe plus exit code

All four belong inside the script. Skip one and you lose the evidence exactly when you need it.

Three inputs an unattended dsh web run must pin

Version, address, and data directory — pin all three or nothing is reproducible.

  1. Version: write npx -y @deepseek-ai/dsh@<version> web; never depend on latest, and use the same string in CI and production.
  2. Listen address: the launcher's --host accepts one concrete local address only. --host 0.0.0.0 is rejected as a usage error, so pick the address the client will actually reach, and keep the default loopback when only local processes connect.
  3. Data directory: set DSH_HOME through the environment and mount a persistent volume; otherwise a container rebuild erases sessions and plugins.
  4. Non-interactive: pass -y and confirm no other confirmation step remains.

You are pinning inputs, not outputs. Once the version is fixed, port behavior, log format, and plugin compatibility become comparable across runs (source).

Logging and probing a dsh web service

Probe with HTTP, not with ps. A live process with no listening socket is common.

  1. Redirect both stdout and stderr from the start command into /var/log/dsh-web.log;
  2. Loop curl -fsS -o /dev/null http://127.0.0.1:3080 every two seconds, at most fifteen times;
  3. Declare failure only after three consecutive misses, so slow starts survive;
  4. On failure print the last thirty log lines instead of a bare "startup failed";
  5. On success append a version-stamped marker line for later comparison.

The probe address must match the listen address. Probing a container IP while the service binds loopback never succeeds; probing loopback while the process listens on a different interface can fail inside a container's network namespace.

Exit codes and signals for dsh web

Graceful shutdown is a signal contract, not a kill -9.

  1. systemd: put the start command in ExecStart, set Restart=on-failure, keep KillSignal=SIGTERM, and set TimeoutStopSec;
  2. Containers: make dsh the entry process. Wrapping it in a shell that backgrounds it means PID 1 never sees the stop signal;
  3. CI: bound the job with a timeout, send SIGTERM at the end, then wait for exit;
  4. Logs: record the exit code and the last error so "failed to start" is distinguishable from "stopped from outside".

Exit code 0 does not mean the service was usable. It means the entry script ended cleanly; usability is answered by the probe.

A minimal dsh web start script

The script does four things: fix inputs, run in the foreground, write logs, fail readably.

bash
#!/usr/bin/env bash
set -euo pipefail
export DSH_HOME=/data/dsh
LOG=/var/log/dsh-web.log
npx -y @deepseek-ai/dsh@<version> web --port 3080 >>"$LOG" 2>&1 &
PID=$!
for i in $(seq 1 15); do
  if curl -fsS -o /dev/null http://127.0.0.1:3080; then
    echo "dsh web ready" >>"$LOG"; break
  fi
  sleep 2
  if [ "$i" -eq 15 ]; then
    tail -n 30 "$LOG"; kill "$PID"; exit 1
  fi
done
wait "$PID"

The value shows up on failure. It dumps the last thirty lines and removes the half-started process instead of leaving it behind.

In a container, drop the & and the probe loop. Let dsh run as PID 1 in the foreground and leave readiness to the orchestrator (source).

Unattended dsh web failures and next steps

Most unattended problems fall into four buckets.

  1. Dies on disconnect: nothing supervises it; move to systemd or a container.
  2. Never starts: latest pulled an incompatible version, or DSH_HOME is not writable; pin the version and check permissions.
  3. Process alive, page dead: the probe address and listen address differ, or the port is taken.
  4. Data gone after rebuild: DSH_HOME was not mounted, or the mount path differs from the configured one.

Check in this order: version, directory, address, logs. Rule out the inputs before studying the service.

For the cases outside these four, keep reading below. Fix the inputs before automating anything. For container ports and mounts, read installing dsh in Docker. For auth and port details, read dsh web auth and ports. For remote access, read deploying dsh remotely. To understand what npx pulls, read what npx actually does.

Sources: dsh CLI reference, dsh CLI README, DeepSeek Harness docs

ChatGPTClaudeGrok / X / CursorGemini

FAQ

Why does dsh web stop as soon as I disconnect from SSH?

Because dsh web runs in the foreground and dies with its terminal. A disconnect sends a signal that ends the process tree. Hand it to systemd, a container runtime, or a terminal multiplexer, and redirect output to a file instead of relying on nohup.

How do I know dsh web is actually usable, not just running?

Probe HTTP on the listen address of dsh web rather than checking for a process. Request the bound URL with curl and inspect the status; require several consecutive failures before declaring startup failed, so a slow start is not mistaken for a crash.

npx asks for confirmation in CI. How do I make it non-interactive?

Add -y and pin an explicit version, for example npx -y @deepseek-ai/dsh@<version> web. Also avoid relying on the browser handoff, since there is no desktop session to open it.

The container exits with code 0 but the service never comes up. What happened?

An exit code of 0 for dsh web only means the entry script ended normally. Common causes are backgrounding the process, PID 1 not being dsh, or binding an address that the outside cannot reach. Run it in the foreground and decide readiness by probing.

Related Terms

unattended start
An unattended start is a service start with nobody at the terminal, requiring non-interactive input, persistent logs, and a machine-checkable definition of success.— DeepSeek Harness docs
health check
A health check is a repeated request to the service address that decides whether the service is usable, as opposed to whether a process exists.— dsh CLI reference
PID 1
PID 1 is the first process inside a container; it must receive stop signals and forward them, or the service cannot shut down gracefully.— DeepSeek Harness docs
listen address
A listen address is the local interface a service binds; loopback accepts only local connections, while a specific interface address accepts traffic arriving on that interface.— dsh CLI reference

Sources