Synopsis

openclaw stop [OPTIONS] [JOB_ID]

When called without arguments, openclaw stop gracefully shuts down the running OpenClaw service started with openclaw start. Optionally provide a JOB_ID to stop only a specific job while leaving the service running.

Options & Flags

FlagTypeDefaultDescription
--forceflagfalseImmediately kill the process without waiting for graceful shutdown
--timeoutint30Seconds to wait for graceful shutdown before forcing
--allflagfalseStop all running jobs without stopping the service

Graceful vs Force Shutdown

OpenClaw distinguishes between two types of shutdown:

Graceful Shutdown (default)

Sends a SIGTERM signal to the running process. OpenClaw will:

  1. Stop accepting new tasks
  2. Wait for in-progress jobs to save their partial results
  3. Flush logs to disk
  4. Release file handles and connections
  5. Exit cleanly
openclaw stop
# Graceful shutdown initiated. Waiting up to 30s...

Force Kill

Use --force to immediately terminate. Running tasks will be aborted without saving partial results:

openclaw stop --force
# Process killed immediately (SIGKILL)
⚠️
Data Safety

Force killing with --force may leave temporary files or incomplete outputs. Always prefer graceful shutdown unless the process is unresponsive.

Stopping Specific Jobs

When the service is running, you can stop individual jobs without shutting down the whole service:

# List running jobs
openclaw status

# Output:
# JOB_ID          STATUS    STARTED     TASK
# job_a1b2c3d4    running   08:00:05    Analyze codebase...
# job_e5f6g7h8    running   08:01:22    Generate report...

# Stop one specific job
openclaw stop job_a1b2c3d4

# Stop all jobs but keep service alive
openclaw stop --all
📝
Job IDs

Job IDs are returned when submitting tasks via the REST API or displayed in verbose mode. You can also retrieve them with openclaw status.

Shutdown Timeout

By default, graceful shutdown waits 30 seconds for running jobs to complete. Customize this:

# Wait up to 60 seconds for graceful shutdown
openclaw stop --timeout 60

# Give only 5 seconds before forcing
openclaw stop --timeout 5

If the timeout expires and the process is still running, OpenClaw automatically escalates to a force kill.

💡
See Also

Signal Reference

OpenClaw handles OS signals for graceful shutdown:

SignalEquivalent CommandBehavior
SIGINT (Ctrl+C)openclaw stopGraceful: finish current step, save state, exit cleanly
SIGTERMopenclaw stop --gracefulGraceful: same as SIGINT, used by systemd and Docker stop
SIGKILL (kill -9)openclaw stop --forceImmediate: no cleanup, in-progress work may be lost
SIGUSR1n/aPause execution (continue with openclaw run --resume)

Stop via Process Management

# Find and stop OpenClaw processes by PID
OPENCLAW_PID=$(pgrep -f "openclaw")
echo "OpenClaw PID: $OPENCLAW_PID"

# Graceful stop
kill -SIGTERM $OPENCLAW_PID

# Force stop (if graceful fails)
kill -9 $OPENCLAW_PID

Stop in Systemd

# systemd handles SIGTERM automatically on service stop
sudo systemctl stop openclaw

# Check if stopped successfully
sudo systemctl status openclaw
# Loaded: loaded (/etc/systemd/system/openclaw.service)
# Active: inactive (dead)

Process Management Scripts

Stop with Cleanup Check

#!/usr/bin/env bash
# stop-and-verify.sh
openclaw stop --graceful

# Wait for clean exit
for i in $(seq 1 10); do
  if ! pgrep -f "openclaw" > /dev/null; then
    echo "OpenClaw stopped cleanly after ${i}s"
    exit 0
  fi
  sleep 1
done
echo "Graceful stop timeout — forcing" && openclaw stop --force

Exit Codes

Exit CodeMeaning
0Process stopped successfully
1No running OpenClaw process found
2Graceful timeout — use --force

Verifying a Clean Stop

After running openclaw stop, confirm no orphaned processes remain:

# Linux/macOS: check for lingering processes
pgrep -af openclaw || echo "No openclaw processes running"

# Confirm PID file is removed
ls ~/.openclaw/openclaw.pid 2>/dev/null && echo "WARNING: PID file still exists" || echo "PID file cleaned up"

# Windows PowerShell
Get-Process -Name "openclaw" -ErrorAction SilentlyContinue | Out-Null
if ($?) { Write-Warning "Process still running" } else { Write-Host "Clean stop confirmed" }

If openclaw stop doesn't work (e.g. the process is frozen), follow the force-kill procedure in the Graceful vs Force Stop section above. For daemon mode specifics, see openclaw start — Process Management.