dsh web --stop / dsh web --restart — stop orphan dsh web processes cleanly #2933
moonquake2004
started this conversation in
Ideas
Replies: 2 comments 2 replies
|
Meet the same issue when upgrading plugins. |
0 replies
|
https://github.com/DonnieTangzhili/dsh-ops-console可以试试我这个插件,希望可以帮助到你 |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
When a terminal running
dsh webis closed, the node process listening on port 3080 survives as an orphan. There is no built-in way to stop it:dshhas nostop/restartsubcommandCtrl+Cin the original terminal only kills the foreground shell — thedsh webprocess (often backgrounded or launched via npx) keeps runninglsof -i :3080+killworks but is manual and undiscoverable for new usersdsh webagain fails with "port in use" until the user finds and kills the old processThis is the most common friction point I've seen in dsh-doctor diagnostics (#2752 white-screen bugs often coincided with orphan processes) and in community reports.
Proposal
Three additions to the
dsh webcommand:1.
dsh web --stopKill the process listening on the dsh web port (default 3080). Graceful SIGTERM with 5s timeout, then SIGKILL. Print what was killed (PID, uptime).
2.
dsh web --restartEquivalent to
--stop+ normal start. The most common intent when a user wants to "refresh" dsh.3. Auto-reclaim on
dsh webstart (optional)When
dsh webfinds port 3080 occupied by another dsh instance (same profile), log a warning and auto-stop it before starting. This turns a confusing "port in use" error into a self-healing experience. Only auto-reclaim if the occupier is a dsh process (same profile path / dsh binary signature) — never kill an unknown occupier without asking.Why this matters
lsof + kill— they just see "port in use" and restart their machinestop/restart. dsh is the only one that doesn'tCurrent workaround (what I ship in my dotfiles)
Works, but every user has to write this themselves. Upstream is the right place.
All reactions