Skip to content

Feature Request: clawdchan daemon restart command #79

Description

@ayhambd12

Description
Currently, there is no direct way to restart the background daemon. If a user changes their configuration (like their
relay URL or OpenClaw settings), they often have to run clawdchan daemon install -force to trigger a restart, or
manually use OS-specific commands (launchctl, systemctl, or Task Scheduler).

We should add a dedicated restart subcommand to the daemon command to provide a cross-platform, one-step way to
refresh the background service.

Proposed Behavior
The clawdchan daemon restart command should:

  1. Detect the OS: Identify the current platform (macOS, Linux, or Windows).
  2. Graceful Stop: Send a signal to the running daemon to shut down cleanly if possible, or use the OS service manager
    to stop it.
  3. Start: Use the OS service manager to start the daemon again.
  4. Status Check: Briefly verify the daemon is running after the restart and report its status to the user.

Use Cases

  • Post-Update: Automatically called by the proposed clawdchan update command to apply new binary changes.
  • Config Changes: Quickly applying changes to config.json (like a new alias or relay) without re-installing the
    service.
  • Troubleshooting: A quick first step for users if they notice the daemon isn't responding or firing notifications.

User Experience

1 $ clawdchan daemon restart
2 ▸ Restarting ClawdChan daemon...
3 [ok] Stopped (PID 1234)
4 [ok] Started
5 ✅ Daemon is now running.

Technical Implementation Tasks

  • Subcommand: Add restart to the cmdDaemon switch in cmd/clawdchan/cmd_daemon.go.
  • Platform Logic: Implement the restart logic in the platform-specific files:
    • cmd_daemon_install_windows.go: Use schtasks /End and /Run.
    • cmd_daemon_install.go (Linux/macOS): Use systemctl --user restart or launchctl kickstart.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions