As an experienced website operation expert, I am well aware that AnQiCMS is widely popular among small and medium-sized enterprises and content operation teams due to its efficient features in the Go language.However, even the most efficient systems may encounter some 'little incidents' in specific operating environments.Today, let's talk about a seemingly mysterious yet often perplexing issue for technical maintenance personnel - when the AnQiCMS service appears to have stopped, there are still 'zombie processes' lingering. What on earth is going on?How should we diagnose and solve it?

AnQiCMS “Zombie Process” Diagnosis and Response: In-depth Analysis of the Hidden Corners of Remaining Processes After Shutdown

In the daily operation and maintenance of AnQiCMS, we occasionally encounter such situations: even though the stop command has been executed and the server has been restarted, the AnQiCMS service seems to be completely 'offline', manifested as the port is still occupied, or the background management interface cannot be started normally.This often means there is a 'zombie process' at work in the shadows.The 'zombie process' here is not the traditional child process waiting for its parent process to reclaim it, but rather those process instances that should have exited but failed to release resources completely. They linger in the system resources like ghosts, affecting the normal startup of services.

AnQiCMS is developed in Go language, its high performance and concurrent processing capabilities make it usually very robust in process management.The exit mechanism of Go programs is relatively direct, and the probability of traditional zombie processes in native Go applications is relatively low.Therefore, the more we encounter are service residue issues caused by external environment, script execution, or forced interruption.

Step 1: Confirm the “Actual Status” of AnQiCMS

When encountering such problems, the first thing we should not do is rush to act, but rather remain calm and carefully confirm the actual running status of AnQiCMS.

  1. Website Access CheckAttempt to access your AnQiCMS website address and admin management address through the browser (for example,http://yourdomain.com/system/If the website cannot be accessed or shows a connection timeout, this is an initial indication that the service may have stopped.
  2. Service Status CheckIf you have configured AnQiCMS as a Systemd service (common on Linux) or run it through management tools like Baota Panel, please check the current status of its service. For example, you can try running it in the Linux command line.systemctl status AnQiCMS(If your service name is AnQiCMS). Check the output information to confirm whether the service is in the "inactive (dead)" state.
  3. Review Start/Stop Script Log:The deployment document of AnQiCMS mentions that we usually usestart.shandstop.shscripts to manage services. Please check the log files generated by these scripts (e.g.)running.logandcheck.logIt is usually located in the root directory of AnQiCMS.These logs record the execution process of the script and the start/stop status of the AnQiCMS process, which may contain useful error information.

Second step: Deep dive into the process list, identify 'zombie' traces

After confirming that the service may have stopped but there are still exceptions, the next step is to delve into the operating system level to find those stubborn residual processes.

  1. UsepsCommand to find processesIn Linux or macOS systems,psis a powerful tool for finding processes. You can use the following command to list all processes related to AnQiCMS:
    
    ps -ef | grep anqicms | grep -v grep
    
    This command lists all processes containing the keyword "anqicms",.grep -v grepIt filters out.grepThe process of the command itself, making the results clearer. Observe carefully.STATThe column of status. If you see the process status asZ[Zombie, zombie], it means that there is indeed a traditional zombie process. But more commonly, you will see some processes that do not haveZstatus, but still show asanqicmsThis might be what we call 'fake zombies' — they may have stopped running, but the PID (Process ID) is still held by the system, or resources have not been fully released.
  2. UselsofCommand port checkAnQiCMS runs on port 8001 by default (unless you manually modify it). A common error when the service cannot start is that the port is occupied.lsofThe command helps us find which process is listening on the port:
    
    lsof -i:8001
    
    If this command returns a result, which shows the PID of the AnQiCMS process, then congratulations, you have found the culprit! Even if the process is inpsThe list seems to have stopped, but the fact that the port is occupied indicates that it has not completely exited.

Step 3: Investigate the cause of the 'zombie process' in AnQiCMS

After understanding the phenomenon, we need to explore the underlying reasons more, which helps us solve the problem fundamentally.

  1. stop.shscript, make sure it points to the correct directory of the AnQiCMS executable file, and that the directory containskill -9According to AnQiCMS'sinstall.mdandstart.mddocument,stop.shThe script usually uses it when terminating a process.kill -9 $exists.kill -9is a forced termination signal, which will directly kill the process without giving the process any opportunity to clean up resources.Although this 'immediate execution' method can ensure that the process stops immediately, it may also cause some resources (such as file locks, memory pages, etc.) to not be **recycled by the system in time, especially in cases of sudden crashes or when the process is forcibly killed during cleanup.This might be the cause of 'false zombie' or resource residue.
  2. Characteristics of Go language processes:The Go language runtime manages its goroutines and memory, and Go programs typically clean up resources properly upon exit. Therefore, in the traditional sense