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:
- Detect the OS: Identify the current platform (macOS, Linux, or Windows).
- Graceful Stop: Send a signal to the running daemon to shut down cleanly if possible, or use the OS service manager
to stop it.
- Start: Use the OS service manager to start the daemon again.
- 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.
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:
to stop it.
Use Cases
service.
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