Home >Operation and Maintenance >Linux Operation and Maintenance >How to restart the process in linux?
How to restart a process in Linux?
How to restart the process in Linux:
1. First, use ps -ef to find the execution statement of the process and retain it; the purpose of this is to retain the process The execution parameters remain unchanged;
For example, to restart the process of a single mongodb:
Find:
ps -ef|grep mongod
Get:
root 2928 2903 0 14:51 pts/0 00:00:00 grep /usr/local/mongodb/bin/mongod --config /etc/mongodb.cnf
2. Use kill -9 Kill the process by PID;
kill -9 2928
3. Use the reserved process statement to restart the process;
Execute:
/usr/local/mongodb/bin/mongod --config /etc/mongodb.cnf
.
The above is the detailed content of How to restart the process in linux?. For more information, please follow other related articles on the PHP Chinese website!