# HTOP



## akshin (May 1, 2020)

Hi!
Htop shows me about 500 such lines. But this command shows me

```
akshin@main:/pool/_sync# ps -aux | grep rsync
root    61737    0.0  0.0    11260     2676  8  S+   00:59          0:00.00 grep rsync
```
that rsync is not running. How can I clear the list of these rsync processes in htop.

```
61327 root       26   0     0     0 Z  0.0  0.0  0:00.05 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
61324 root       25   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61183 root       31   0     0     0 Z  0.0  0.0  0:00.05 rsync
61181 root       31   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61179 root       27   0     0     0 Z  0.0  0.0  0:00.07 rsync
61177 root       25   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61175 root       29   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
61171 root       27   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61167 root       25   0     0     0 Z  0.0  0.0  0:00.05 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
61165 root       26   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61113 root       30   0     0     0 Z  0.0  0.0  0:00.06 rsync
61111 root       30   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61109 root       27   0     0     0 Z  0.0  0.0  0:00.06 rsync
61107 root       24   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61105 root       26   0     0     0 Z  0.0  0.0  0:00.07 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
61103 root       25   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61044 root       31   0     0     0 Z  0.0  0.0  0:00.06 rsync
61042 root       29   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61040 root       26   0     0     0 Z  0.0  0.0  0:00.06 rsync
61038 root       25   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
61036 root       27   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
61034 root       26   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60919 root       28   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60917 root       25   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60914 root       30   0     0     0 Z  0.0  0.0  0:00.05 rsync
60912 root       31   0     0     0 Z  0.0  0.0  0:00.10 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60910 root       27   0     0     0 Z  0.0  0.0  0:00.07 rsync
60908 root       25   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60892 root       26   0     0     0 Z  0.0  0.0  0:00.07 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60890 root       25   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60861 root       28   0     0     0 Z  0.0  0.0  0:00.07 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60859 root       26   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60836 root       28   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60834 root       26   0     0     0 Z  0.0  0.0  0:00.10 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60832 root       31   0     0     0 Z  0.0  0.0  0:00.05 rsync
60830 root       31   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60828 root       25   0     0     0 Z  0.0  0.0  0:00.05 rsync
60826 root       24   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60824 root       26   0     0     0 Z  0.0  0.0  0:00.05 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60822 root       26   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60801 root       27   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60799 root       25   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60736 root       32   0     0     0 Z  0.0  0.0  0:00.06 rsync
60734 root       29   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60732 root       25   0     0     0 Z  0.0  0.0  0:00.06 rsync
60730 root       24   0     0     0 Z  0.0  0.0  0:00.07 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60727 root       26   0     0     0 Z  0.0  0.0  0:00.05 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60725 root       26   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60723 root       27   0     0     0 Z  0.0  0.0  0:00.05 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60721 root       25   0     0     0 Z  0.0  0.0  0:00.08 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60699 root       27   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
60697 root       26   0     0     0 Z  0.0  0.0  0:00.09 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60605 root       72   0     0     0 Z  0.0  0.0  0:00.06 rsync
60603 root       72   0     0     0 Z  0.0  0.0  0:00.06 rsync -aOHA --rsync-path=/usr/local/bin/sudo /usr/lo
60601 root       76   0     0     0 Z  0.0  0.0  0:04.46 rsync -aOHAe ssh -p 55500 --rsync-path=/usr/local/bi
```


----------



## zirias@ (May 1, 2020)

Kill it with fire. I assume that `Z` in all these lines means "zombie", so, something bad happened. If you're sure no other `rsync` processes are running on the machine, the most straight-forward solution would be a `killall -9 rsync` (maybe try a `killall rsync` first, in case some processes still react on normal signals).

*edit:* please try to come up with a more descriptive title next time, it doesn't seem like your issue has anything to do with `htop`.


----------



## akshin (May 1, 2020)

```
akshin@main:/pool/_sync# killall rsync
No matching processes were found
akshin@main:/pool/_sync# killall -9 rsync
No matching processes were found
```


----------



## gpw928 (May 2, 2020)

From the htop(1) man page: COLUMNS: STATE (S): *Z* for zombie (waiting for parent to read its exit status)

You can't kill a zombie process (there's a good reason it's called a zombie).

That's because the only existential resource it consumes is a slot in the process table.

The slot in the process table is required for the sole purpose of recording the exit status of the defunct process.

That slot must persist until either the parent wait(2)s on the zombie process, or the parent exits.

Find the parent process of the "rsync" zombie.  Send that process signal 15.

I can't recall the last time I used signal 9.  Signals 15, 1, 2, and 3 are always preferable.

pstree(1) makes for easy tracing of parent processes.


----------



## ralphbsz (May 2, 2020)

gpw928's description is right: the parent process seems to have suffered a bad accident. An easier way to find the parent process ID is to run "ps -j", perhaps filtering the output with "grep Z" to see only the parent of zombies.

A more interesting question is: how did you get here? Do you know who and why is starting all these rsync processes? Do you know what they died of? Do you know how to prevent a recurrence of them all going zombie on you?


----------



## zirias@ (May 2, 2020)

Of course, to get rid of zombies, you have to find their master  Sorry, didn't think this to the end, with so many zombie rsyncs, it's somewhat unlikely they are all children of rsync.

Still, about the signal: Signal 15 is implicit, that's why I suggested trying without a specific signal first. If a process doesn't reap its children any more, it's still somewhat likely it also doesn't process signals any more, so you _might_ need `-9`.

I'm in support of ralphbsz's point, you should definitely find out what led to this situation.


----------



## Bobi B. (May 2, 2020)

Try `ps daux`; `-d` stands for descendancy order (ps(1)).


----------



## PMc (May 2, 2020)

It's a loong time since I last had a zombie plague. I would check if `init` (pid no. 1) is still alive.


----------



## akshin (May 2, 2020)

Thank you all

#ps ajx | grep -w Z
      root 3994 *3992 *3992 3992 0 Z ?? 16:23,02 <defunct>
#ps auxww | grep *3992 *
#kill -9 *3992*


----------

