Introduction¶
DSH (DeepSeek Harness) is a system based on a plugin architecture and does not natively provide process-level control capabilities. In daily operations, developers often need to manually restart the host process or automatically restore services after a server reboot. The dsh-restart-autostart plugin solves this pain point by injecting control entry points into the settings panel, providing a “Restart” button and a “Start with System” setting.
Core Features¶
- Title bar restart button: On the left side of the title bar in any settings tab, a red “Restart” button is provided, so there is no need to navigate to a specific page.
- General autostart configuration: On the “Settings → General” page, a “Start with System” checkbox is provided, supporting the creation of system autostart entries.
- Guardian and automatic recovery: A guardian daemon is provided to monitor the host status. After the host crashes, the guardian automatically starts a new process.
Installation and Enablement¶
Run the following command in the terminal to install:
dsh plugin --profile web add github:felixpu/dsh-restart-autostart
After installation, restart the host process to apply the changes.
Usage¶
Manual Restart¶
- Open the DSH settings panel (any tab is fine).
- Click the red “Restart” button on the left side of the title bar, next to the “Open Configuration File” button.
- Confirm the restart in the confirmation dialog. A progress overlay then appears below the title bar, showing the status: “Stopping old service → Starting new service → Restored”.
The frontend polls the/healthendpoint to determine service recovery, so there is no need to manually refresh the page.
Configure System Autostart¶
- Go to the “Settings → General” page.
- Check “Start with System”.
- The plugin writes the corresponding autostart entry based on the current operating system:
- macOS:launchd(Label:com.dsh.restartautostart.<port>)
- Linux:systemduser-level service (Unit:dsh-restart-autostart-<port>.service)
- Windows: System service
API Call¶
If you need to control it via a script, you can call the POST endpoint:
curl -X POST http://localhost:PORT/dsh-restart-autostart/restart
Notes¶
- Restart impact: Restarting interrupts all ongoing sessions and background tasks.
- Linux dependency: On Linux,
systemd lingermust be enabled to start the guardian when no user is logged in. It is not available on non-systemddistributions (for example, Alpine, which uses OpenRC). - Data migration: This plugin is the renamed version of the old package
dsh-restart. When upgrading from the old name, old data (directories, routes, configuration) is not automatically migrated; old entries and directories must be cleaned up manually. - Startup mutual exclusion: During the 10-second window after host restart, manual restart and the guardian process may compete for the port. The plugin uses the
logs/starting-<port>.locklock file mechanism to ensure that only one instance successfully binds the port; the other instance exits with an error.
Appendix¶
- Data persistence:
~/.dsh-restart-autostart/ - GitHub repository: https://github.com/felixpu/dsh-restart-autostart