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

  1. 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.
  2. General autostart configuration: On the “Settings → General” page, a “Start with System” checkbox is provided, supporting the creation of system autostart entries.
  3. 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

  1. Open the DSH settings panel (any tab is fine).
  2. Click the red “Restart” button on the left side of the title bar, next to the “Open Configuration File” button.
  3. 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 /health endpoint to determine service recovery, so there is no need to manually refresh the page.

Configure System Autostart

  1. Go to the “Settings → General” page.
  2. Check “Start with System”.
  3. The plugin writes the corresponding autostart entry based on the current operating system:
    - macOS: launchd (Label: com.dsh.restartautostart.<port>)
    - Linux: systemd user-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

  1. Restart impact: Restarting interrupts all ongoing sessions and background tasks.
  2. Linux dependency: On Linux, systemd linger must be enabled to start the guardian when no user is logged in. It is not available on non-systemd distributions (for example, Alpine, which uses OpenRC).
  3. 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.
  4. 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>.lock lock 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