PuppyIP Resource Center
Network & Connection Troubleshooting 9 min Published 2026-11-17

OpenClash Says Stopped but Clash Cores Remain: KWRT Process and Port Troubleshooting

When OpenClash reports stopped but multiple Clash cores remain, match PIDs to their YAML files and listening ports before ending any process.

OpenClash KWRT Clash core YAML Port conflict OpenWrt troubleshooting

Service eligibility and regional restrictions

PuppyIP serves only compliant overseas businesses and their authorized personnel. Proxy services are not available in mainland China. The service may only be used for lawful business activities outside mainland China. Use of this service within mainland China is prohibited.

Hosting a proxy IP or server overseas does not change these restrictions. The service must not be provided to end users in mainland China through relaying, forwarding, sharing or resale. Before use, read the Terms of Service.

Key Takeaways

  • A stopped UI or init status does not prove every Clash/Mihomo child process has exited.
  • Identify duplicate instances by matching each process command line and YAML path to its listening ports; do not assume a node is bad because the dashboard is inconsistent.
  • Stop through the OpenClash service first and recheck. Only consider an interactive TERM signal for one freshly verified orphan; do not use bulk kill commands or kill -9.
  • After startup, confirm expected core count, port ownership and actual client DNS/access results.

Separate UI status, core processes and listeners

On a router, an OpenClash page showing stopped or an Already Stop message does not by itself prove that every core process has exited. If multiple Clash/Mihomo processes remain, each may have started with a different configuration file or may compete for DNS, proxy or controller ports. The result can include changing startup status, listeners that do not match the selected configuration, increased router load or intermittent failures.

The question here is which cores are running, which YAML each one uses and which process owns each target port—not whether a node is defective. If there is only one core and no DNS listener, start with dnsmasq forwarding and proxy DNS. If several cores remain or start/stop status conflicts, first inspect process and port ownership. Both faults can coexist, but evidence for one does not resolve the other.

Read-only inventory: pair each PID with its config and listeners

Run these read-only commands in the router shell. Record each core's PID, full command line and configuration-file argument, then check which PID owns the relevant listening ports. OpenClash UI status is only one piece of evidence. Confirm whether each process belongs to the active service manager, whether it uses the selected configuration and whether its ports are expected or belong to an older instance.

If the installed BusyBox tools do not show a full command line, use an existing router process viewer to complete the inventory; do not install software just for this check. Output can include subscription paths, hostnames or rule details. Remove those before sharing a ticket, keeping only versions, PIDs, ports and redacted state.

List processes and listeners

sh
ps w | grep -E '[c]lash|[o]penclash_watch|[m]ihomo'
netstat -lnp 2>/dev/null | grep -E ':(7874|7890|7891|7892|7893|9090)([[:space:]]|$)'
From the router shell, inspect Clash/OpenClash processes and listener PIDs on common ports. The port list is for comparison; every router is not expected to use all of them.

Stop through the service manager, then check for leftovers

Before stopping or starting the service, export the current YAML and necessary OpenClash settings so they can be restored. Keep a local management path available and expect transparent proxying and client DNS to pause briefly. Stop the service once in an orderly way, then inspect processes again. Do not delete YAML files, update subscriptions, switch cores and reboot the entire router in the same round.

If one process remains, do not pass every PID to a loop. Refresh the candidate PID and actual executable path; fill the command from the readlink result for /proc/PID/exe, then compare the process start time and executable path both before and immediately before signaling. Consider one TERM signal only after the service manager is stopped, that single PID remains, both identity checks match and you have manually confirmed it is an orphaned OpenClash core. Core binaries can live at different paths across releases, so do not require one fixed path or broaden the check to a bulk process-name kill.

Stop in order and inspect leftovers

sh
/etc/init.d/openclash stop
sleep 2
ps w | grep -E '[c]lash|[o]penclash_watch|[m]ihomo'
Run only with local management available, after saving the current config and accepting a brief proxy/DNS interruption. If the service will not start later, restore it through OpenClash management or run /etc/init.d/openclash start.

Send TERM to one rechecked orphan core

sh
PID='REPLACE_WITH_FRESHLY_VERIFIED_PID'
EXPECTED_EXE='REPLACE_WITH_EXACT_PATH_FROM_READLINK_PROC_PID_EXE'
case "$PID" in ''|*[!0-9]*) echo 'Set a numeric PID'; exit 1;; esac
test -r "/proc/$PID/stat" && test -e "/proc/$PID/exe" || exit 1
START_BEFORE=$(sed 's/^.*) //' "/proc/$PID/stat" | awk '{print $20}')
ACTUAL_EXE=$(readlink "/proc/$PID/exe") || exit 1
[ -n "$START_BEFORE" ] && [ "$ACTUAL_EXE" = "$EXPECTED_EXE" ] || exit 1
printf 'PID=%s executable=%s start=%s\n' "$PID" "$ACTUAL_EXE" "$START_BEFORE"
printf 'Type TERM only if this is the confirmed orphaned core: '
read -r CONFIRM
[ "$CONFIRM" = 'TERM' ] || exit 1
START_NOW=$(sed 's/^.*) //' "/proc/$PID/stat" | awk '{print $20}')
EXE_NOW=$(readlink "/proc/$PID/exe") || exit 1
[ "$START_BEFORE" = "$START_NOW" ] && [ "$ACTUAL_EXE" = "$EXE_NOW" ] || { echo 'PID identity changed; stop and recheck'; exit 1; }
kill -TERM "$PID"
Use only after the service manager is stopped and one orphan core has been rechecked. Supply the fresh numeric PID and the exact readlink path of /proc/PID/exe. The command compares that PID's start time and executable path before confirmation and again before sending TERM. It does not print command-line arguments that may contain node config; it never bulk-kills or escalates to KILL.

Before restarting, ensure only the selected YAML is loaded

Before restoring the service, identify the current OpenClash configuration file, core type and DNS/proxy port settings. Multiple similarly named, old or leftover YAML files can be loaded by different startup paths. Do not delete files while their relationship to the service manager is unclear. If cleanup is necessary, export a backup from the UI and confirm a file is not referenced by the active service, a scheduled task or a fallback setting.

Start once from the service page or its init manager command, then inspect processes after initialization settles. The intended core should point to the selected configuration, and that process should own the DNS, proxy and controller ports specified there. Do not start another core manually just to make the UI status look right; it creates an instance the service manager may not know about.

Restore the OpenClash service

sh
/etc/init.d/openclash start
sleep 3
ps w | grep -E '[c]lash|[o]penclash_watch|[m]ihomo'
netstat -lnp 2>/dev/null | grep -E ':(7874|7890|7891|7892|7893|9090)([[:space:]]|$)'
Run only after checking the selected config and preparing a rollback. Compare the final process and listener PIDs with local settings; judge these ports against your own configuration.

Verify the core, DNS and client access separately

After startup, compare process count, each command line's YAML path and port ownership. The intended DNS port should belong to the selected core, and proxy listeners should match its configuration. Do not use a single-process count as the only success criterion; some configurations also use watchdog or helper processes.

Finally, test DNS from the router or a controlled client and test an authorized destination through the client. Confirm the DNS mode and actual proxy route meet your requirements. If the core and listeners are correct but a site still fails, continue with DNS, TCP, rule matching and upstream reachability as separate layers. Do not publish YAML, subscription URLs, UUIDs, keys or full startup logs.

Stopping conditions and rollback scope

If you cannot identify which configuration a PID uses, which manager launched it or which service owns a port, stop before sending signals or deleting files. Keep a process snapshot and redacted logs. A broad command that ends everything containing clash can terminate a healthy core or watchdog; a forced KILL also skips normal cleanup and is not a general repair.

If the service will not start or client proxy access is lost, restore the saved OpenClash configuration and start it through its manager. If DNS was changed as well, roll that back from its separate backup. This procedure addresses duplicate cores and port ownership only; it does not prove node reachability, UDP service or full LAN acceptance.

Sources

Frequently Asked Questions

Why does ps show Clash after OpenClash says it stopped?

The UI or init status reflects the manager state, not necessarily every child process. Match each PID, full command line and configuration path before deciding it is an orphan.

Do multiple Clash processes always mean a fault?

No. Watchdogs and helper processes may also be present. Match PIDs and config paths to their listener ports, then handle only an instance inconsistent with the intended service.

Can I use a looped kill command to remove old cores?

Avoid it. Broad matching can terminate a healthy core or watchdog. Stop through OpenClash first, recheck one leftover PID manually, and send only TERM if it is confirmed orphaned.

Is a multi-core problem the same as a 7874 DNS timeout?

No. Multi-core troubleshooting checks processes, YAML files and port ownership. A 7874 timeout checks whether the dnsmasq forward has a listener. Both can happen and need separate verification.