How to forcefully stop the AnQiCMS process when it is unresponsive on Linux?

Calendar 👁️ 55

When our AnQiCMS website is running on a Linux server, it may occasionally encounter a situation where the program does not respond, causing the website to be unable to access normally.This is like a car suddenly cutting out on the highway, causing anxiety.As website operation experts, we know how important the stable operation of the website is.AnQiCMS is a content management system developed based on the Go language, with high performance and stability as its features. Although designed to be robust, any software may encounter a deadlock due to resource exhaustion, code deadlock, or external dependency issues under certain conditions.To face such situations, learning how to forcibly stop the process in a Linux system is a key skill to ensure the rapid restoration of website access.

In general, when the AnQiCMS program becomes unresponsive, our preferred method is to attempt a 'gentle' shutdown. If AnQiCMS is accessed through the Go project feature of Baota panel, or directly through a command line script (such asstart.shandstop.shDeployed, there is likely a specialstop.shThe script is responsible for the normal shutdown of the program. This script will send a termination signal to the AnQiCMS process, allowing it to complete some cleanup work, such as saving data or closing connections, and then exit.You can find and run this script in the installation directory of the program, for example:

./stop.sh

However, if the program is completely frozen, it does not respond to normal termination signals, orstop.shThe script did not work either, and we need to take more 'tough' measures, that is, force stop the process.This is like directly pulling the plug, the program will immediately terminate without any cleanup, so this is usually the last resort.

To forcibly stop an unresponsive AnQiCMS process, we first need to find its process ID (PID).In Linux systems, each running program has a unique PID.We can usepsandgrepThese commands are used to search. Because the executable files of AnQiCMS are usually named asanqicmsWe can search like this:

ps aux | grep anqicms

After executing this command, you will see an output similar to this:

user     12345  0.5  1.2 123456 45678 ?        Sl   Jan01   5:30 /path/to/your/anqicms/anqicms
user     67890  0.0  0.0   6020  1080 pts/0    S+   10:00   0:00 grep --color=auto anqicms

In the above output, the first line is the actual running process of AnQiCMS, its PID is12345. The second line isgrepCommand its own process, this can be ignored. Make sure to identify carefully and ensure that you find the PID of the main AnQiCMS program.

Sometimes a program may fail to start or respond because the port is occupied, other than searching by process name. In this case, if you know the port that AnQiCMS is listening on (usually it is default8001), can also be accessed throughlsofCommand to find the process occupying the port:

lsof -i:8001

This command will display the occupation8001Port process information, which includes PID. After finding the correct PID, we can usekill -9the command to forcibly terminate it:

kill -9 12345

to12345Replace with the actual process ID of the AnQiCMS you find.This command will immediately kill the AnQiCMS process.To confirm that the process has stopped, you can run it againps aux | grep anqicmsCommand. If there is no process information for AnQiCMS left (exceptgrepits own process), it means the program has stopped successfully.

If your AnQiCMS is deployed in a Docker container, the way to manage the process will be different, you need to operate the container through Docker commands. First, you need to find the Docker container ID or name running AnQiCMS:

docker ps

This command lists all running Docker containers. After finding the container corresponding to AnQiCMS, you can first try to stop it gently:

docker stop [容器ID或名称]

If the container has not stopped for a long time, or needs to be terminated immediately, you can use:

docker kill [容器ID或名称]

After stopping the container forcibly, you may need to decide according to Docker's configuration whether to restart the stopped container (docker start [容器ID或名称]), or deploy a new container.

After forcing the AnQiCMS process to stop, the most critical step isrestartit. For those who usestart.shscript deployment, execute./start.shAs soon as it is possible; for Docker deployments, they can be automatically restarted according to their startup strategy, or manuallydocker start. Also, it is recommended to check the AnQiCMS runtime logs (for example, in the installation directory below)running.logorcheck.logTo understand the possible causes of program crashes and find solutions to avoid similar problems from recurring.

Forcibly stopping a process is an effective means of solving unresponsive problems, but it is not a fundamental solution.A healthy website operation strategy should include regular monitoring of system resources, checking program logs, timely updating AnQiCMS versions, and optimizing configurations to minimize the occurrence of program unresponsiveness.

Frequently Asked Questions (FAQ)

Q1: Usekillandkill -9What are the differences? Why is it recommended to use.kill -9to perform a forced stop?

A1:killThe command sends by default isTERMThe signal (Terminate, stop), it tells the program to close normally, giving it a chance to save data and release resources.If the program can respond, this is the smoothest way to exit. Andkill -9The one sent isKILLA signal, this is an uncatchable, non-ignorable signal, the system will immediately force terminate the process, without giving the program any processing time. When the program is unresponsive, it means it cannot handle itTERMThe signal, at this timekill -9has become the only choice, because it can ensure that the process is killed immediately.

Q2: What should I do if the website is still inaccessible after forcibly stopping AnQiCMS?

A2: After forcing the AnQiCMS process to stop and restart, if the website still cannot be accessed, the first thing to confirm is whether the program has really started successfully. You can check byps aux | grep anqicmsCommand to check again, or view the program's startup log (for examplerunning.log). If the program is indeed running, but the website is still inaccessible, it may be due to other reasons, such as: incorrect configuration or restart of Nginx/Apache reverse proxy services;The firewall blocked access to the AnQiCMS port; the database service connected to AnQiCMS is abnormal;Or AnQiCMS encountered a new error during startup, causing it to crash again.Need to investigate these possibilities one by one.

Q3: How do I know which port AnQiCMS is listening on? I didn't find a clear port number in the configuration.

A3: The default port listened by AnQiCMS is usually8001. If you deploy through the "Go Project" or "Other Project" feature of Baota Panel, the project port will be explicitly specified when adding the project.If manually deployed, this port number is usually in the project'sconfig.jsondefined in the configuration file. If the above methods cannot determine, you can try usingnetstat -tulnp | grep anqicmsorlsof -i -P -n | grep LISTEN | grep anqicmsCommand to view the actual network port that AnQiCMS process is listening on.

Related articles

How to troubleshoot if the `stop.sh` script of the AnQiCMS project fails in the command line?

In the daily operation and maintenance of AnQiCMS, the `stop.sh` script is a key link in managing the service lifecycle.It allows us to gracefully stop the AnQiCMS service for maintenance, upgrades, or troubleshooting.However, when this seemingly simple script fails to stop the service as expected, it often confuses us.

2025-11-06

How to configure and execute the stop script (stop.sh) for AnQiCMS in the Baota panel?

As an experienced website operation expert, I deeply understand the importance of an efficient and stable content management system (CMS) for corporate online business.AnQiCMS, with its high-performance and concise and efficient architecture based on Go language, has become an ideal choice for many small and medium-sized enterprises and content operation teams.However, even the most excellent system cannot do without fine-grained O&M management, which includes how to safely and effectively stop its running process.

2025-11-06

How to gracefully stop the AnQiCMS project instead of forcing it to close?

In website operation, service stability and data integrity are core elements.For a high-performance content management system like AnQiCMS, which is developed based on the Go language, it is particularly important to 'gracefully shut down' instead of 'forcefully close'.This not only concerns the normativity of technology, but also directly affects the normal operation of the website, user experience, and the security of critical data. ## Graceful Termination: Why Is It Important?Imagine that you are busy editing an important article, or the user is browsing your product page.

2025-11-06

How to create and manage different website navigation categories and links in the AnQiCMS backend?

AnQi CMS is an efficient enterprise-level content management system, and its flexible and convenient backend operation is an important reason why many users choose it.In website operation, the navigation system is undoubtedly a core element of user experience and search engine optimization.A clear and explicit navigation not only helps users quickly find the information they need, but also guides search engine spiders to effectively crawl the website content.Today, let's delve into how to create and manage different website navigation categories and links in the AnQiCMS backend.

2025-11-06

How to correctly close the AnQiCMS background process through Task Manager in Windows environment?

How to correctly close the AnQiCMS background process through Task Manager in Windows environment?As an enterprise-level content management system developed based on the Go language, AnQiCMS has won the favor of many users with its high efficiency, compactness, and excellent running speed.In the operation and maintenance of daily websites, we sometimes need to suspend or completely shut down their background services, whether it is for system maintenance, configuration adjustment, or simple fault troubleshooting, properly terminating the operation of AnQiCMS is a fundamental and important operation.

2025-11-06

Does stopping one site in the AnQiCMS multi-site mode affect other sites?

AnQi CMS as an efficient enterprise-level content management system, its powerful multi-site management function undoubtedly brings convenience to many operators.It allows us to easily manage multiple independent content platforms from a unified backend.However, many users who are new to the multi-site model often have a question: If we need to stop or maintain one of the sites in an AnQiCMS instance, will it affect the other sites that are running normally?Today, let's delve into this issue and share some practical operational suggestions.--- ###

2025-11-06

What is the difference between AnQiCMS' 'shutdown prompt' feature and completely stopping the project?

As an experienced website operations expert, I am well aware that it is crucial to manage the website status efficiently at different stages of its lifecycle.AnQiCMS (AnQiCMS) is a content management system known for its efficiency and ease of use, naturally providing operators with tools to deal with various scenarios.Among them, the "shutdown prompt" function and the "complete shutdown project" are two completely different, but very practical ways to manage website status.

2025-11-06

What is the impact on website access after configuring reverse proxy and stopping the AnQiCMS project?

What is the impact on website access after configuring reverse proxy and stopping the AnQiCMS project?Read and understand the mechanism and consequencesWhen deploying AnQiCMS and similar content management systems, we often use a reverse proxy architecture.This deployment method can not only improve website performance but also enhance security, and it is a wise choice for many small and medium-sized enterprises and self-media operators.

2025-11-06