Method: 1. Use "/etc/init.d/dhcpd status", this statement can check the service status of dhcp; 2. Use the "ps aux" command, this command can check the process information in the system , the syntax is "ps aux | grep dhcp | grep -v grep".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Check the service status
/etc/init.d/dhcpd status
Check whether the dhcp service is running :
ps aux | grep dhcp |grep -v grep
ps aux command
The process on Linux has 5 states:
1. Running (running or waiting in the run queue)
2. Interrupted (sleeping, blocked, waiting for a certain condition to form or receiving a signal)
3. Uninterruptible (does not wake up and cannot run when receiving a signal, the process must wait until there is an interrupt) Occurrence)
4. Zombie (the process has terminated, but the process descriptor exists until the parent process calls the wait4() system call and is released)
5. Stop (the process receives SIGSTOP, SIGSTP , SIGTIN, SIGTOU signals to stop running)
Extended knowledge:
1. Check whether the startup setting is set
chkconfig --list | grep dhcpd
2. Check whether the port is open
netstat -anulp | grep :67
3: Close dhcpd
/etc/init.d/dhcpd stop
4: Enable hdcpd
/etc/init.d/dhcpd start
Recommended learning: Linux video tutorial
The above is the detailed content of How to check if dhcp is closed in linux. For more information, please follow other related articles on the PHP Chinese website!