You are not logged in.

#1 2021-01-27 23:45:08

dcraig327
Member
Registered: 2021-01-27
Posts: 6

How do I kill a suspended process?

I'm getting the Grub2 error - "Grub error: unknown filesystem for any filesystem" when running:

$grub-mkconfig -o /boot/grub.cfg

Sometimes it hangs and even Ctrl+C won't kill it. So i hit Ctrl+Z. Now I got two problems.

$sudo ps -aux |grep grub 
root        1550  0.0  0.0  15616  7220 pts/0    T    12:58   0:00 sudo grub-mkconfig -o /boot/grub.cfg
root        1551  0.0  0.0   7604  3924 pts/0    T    12:58   0:00 /bin/sh /usr/bin/grub-mkconfig -o /boot/grub.cfg
root        2522  0.0  0.0   7364  3652 pts/0    T    12:58   0:00 /bin/sh /etc/grub.d/30_os-prober
root        2523  0.0  0.0   7364  1800 pts/0    T    12:58   0:00 /bin/sh /etc/grub.d/30_os-prober
root        5175  0.0  0.0  15616  7140 pts/0    T    13:02   0:00 sudo grub-mkconfig -o /boot/grub.cfg
root        5176  0.0  0.0   7604  4148 pts/0    T    13:02   0:00 /bin/sh /usr/bin/grub-mkconfig -o /boot/grub.cfg
root        6153  0.0  0.0   7364  3632 pts/0    T    13:02   0:00 /bin/sh /etc/grub.d/30_os-prober
root        6154  0.0  0.0   7364  1736 pts/0    T    13:02   0:00 /bin/sh /etc/grub.d/30_os-prober
root       16118  0.0  0.0  15616  7172 pts/0    T    15:08   0:00 sudo grub-mkconfig -o /boot/grub.cfg
root       16119  0.0  0.0   7604  4204 pts/0    T    15:08   0:00 /bin/sh /usr/bin/grub-mkconfig -o /boot/grub.cfg
root       17094  0.0  0.0   7364  3616 pts/0    T    15:08   0:00 /bin/sh /etc/grub.d/30_os-prober
root       17095  0.0  0.0   7364  1664 pts/0    T    15:08   0:00 /bin/sh /etc/grub.d/30_os-prober

How do I kill those suspended/frozen processes?

#pkill grub-mkconfig
#kill 1550

Nothing seems to be working.
Edit: These two commands don't seem to work.

Regarding the grub error, I killed unused partitions on several drives, unplugged the drives not needed for boot and am ready to try again but feel killing those processes, then unmounting any os-prober may help

Last edited by dcraig327 (2021-01-28 00:45:45)

Offline

#2 2021-01-27 23:54:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,508
Website

Re: How do I kill a suspended process?

Did you read the man page for either pkill or kill?  You are only sending SIGTERM, so that hardly supports the claim that "nothing" is working.  No, just SIGTERM is not being responded to which is not unusual for a truly hung process.  Send SIGKILL.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2021-01-28 00:57:44

dcraig327
Member
Registered: 2021-01-27
Posts: 6

Re: How do I kill a suspended process?

Thanks Trilby. Makes sense. I read the man page for pkill recently as I just learned about it, but didn't realize what signal meant. Never seen it fail or see a program hang like that. I did correct my frustration in the op, heck somebody else is liable to see this post. Thank you.

Worked like a charm and even got some error messages from grub that might help.

Offline

#4 2021-01-28 01:16:40

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,508
Website

Re: How do I kill a suspended process?

Also note that if it is suspended by Ctrl-Z then I'm note sure if SIGTERM would be processed even under normal conditions.  So another approach (which could be considered the ideal) would be to send SIGTERM then `fg` to give the process a chance to handle the signal (or perhaps send SIGCONT, but `fg` would be easier).  If that fails, send SIGKILL as a last resort.

Allowing the process to handle SIGTERM is much more "polite" and in cases where there is data that might need to be saved, it can be important.  But if a process is already misbehaving, the end result is about the same from a successful SIGTERM or a SIGKILL.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB