Handling CentOS system startup hang

0 19
Have you ever encountered the following situation:When starting the CentOS syste...

Have you ever encountered the following situation:

When starting the CentOS system, there is sometimes a problem where the system hangs after loading a service.

Handling CentOS system startup hang

As shown in the figure, the system hangs after loading the DNS cache service nscd.

1682394182_64474c46350b22781eec5.png!small

The judgment should be that an abnormal service loaded after nscd appears. At this time, you can restart the cloud server to enter single-user mode, then enter the /etc/rc.d directory, the contents of which are shown in the figure:

1682394195_64474c5309534b86b7ad4.png!small

The directories from rc0.d to rc6.d correspond to the services that need to be loaded when the system starts with runtime levels 0 to 7.
The rc3.d directory contains services that need to be loaded in the normal multi-user mode, enter the rc3.d directory. Check the contents, as shown in the figure:

1682394204_64474c5c4fc3a7d74370a.png!small

Links that start with S+numbers indicate services that need to be started when the system starts, with lower-numbered links executing first, and higher-numbered links executing later. Links that start with K+numbers indicate services that need to be terminated when the system shuts down, with lower-numbered links executing first, and higher-numbered links executing later.

You can see that the service number of nscd is 30, and after loading, the next service to be loaded is the 50-numbered agentboot service. Therefore, it is possible that an exception in the agentboot service caused it to fail to load, and the system hung.

1682394218_64474c6ab155b13d6cfd5.png!small

Executing the command 'chkconfig --level 3 agentboot off' will cancel the loading of the agentboot service with the system startup under runtime level 3. After executing the command, the file S50agentboot under rc3.d will be deleted.

1682394230_64474c7653ba865388d44.png!small

Executing the command 'chkconfig' will show that the status of agentboot under runtime level 3 is off.

After exiting single-user mode, restart the cloud server, the system did not load the agentboot service after loading the nscd service, and continued to complete the startup process.
If you need to re-add a service to a specific runtime level's startup loading list, for example, to add agentboot to runtime level 3,

Executing the command 'chkconfig --level 3 agentboot on' will show that a new file S55agentboot has been added to the rc3.d directory, and at the same time, the status of agentboot under the runtime level 3 displayed by the chkconfig command has changed to on.

1682394239_64474c7fdc3c4d2ca780e.png!small

你可能想看:
最后修改时间:
admin
上一篇 2025年03月29日 12:45
下一篇 2025年03月29日 13:08

评论已关闭