Ramana Reddy
Ramana Reddy

Reputation: 399

How do I know a process is blocking the reboot command in linux?

I added my packages and modules into the openwrt and then reboot doesn't work at all!!. Only way to reboot is to use reboot -f or hard reset.

I tried removing all the startup scripts from /etc/init.d which are added by me. I even tried removing the contents of /etc/modules.d/.

My /etc/rc.local file has just one line exit 0.

Where should I debug to figure this out? All these package were working earlier on x86 architecture.

Iam using openwrt chaos calmer on imx6 based board.

Upvotes: 2

Views: 5154

Answers (1)

vinod maverick
vinod maverick

Reputation: 678

As far as I know reboot uses the shutdown command. So when shutting down, Linux sends SIGTERMs to its processes. But the kernel protects the processes which are in uninterruptible state to preventing data loss. This may lead to stop the rebooting.

So in your case some processes (openwrt specific) may be in uninterruptible state. You can list out the process having uninterpreted state (check the STAT of the process) through ps aux command.

Process State code

or you can directly list the uninterruptible state by ps -eo 'stat,pid,args' | grep -E 'D'

check Linux process states for more details about process in linux.

Upvotes: 3

Related Questions