1

I use firefox to display some files over an sshfs mountpoint...

However, it happens that this mountpoint gets disconnected; if I inadvertantly reload a page, firefox will be forever stuck and cannot even be killed.

For example, I still see a firefox process with "D" here:

$ ps aux | grep firefox
plasmab    10269  0.8  4.2 3253252 344216 ?      D    18:12   0:51 /usr/lib/firefox/firefox
plasmab    13350  0.0  0.0  21996  1148 pts/3    S+   19:50   0:00 grep --color=auto firefox

and this, even after killall -9 firefox. Trying kill -9 10269 is useless.

Now, I followed steps to remove the lock and .parentlock files, but after that I still see the "D" process. Nonetheless I restarted Firefox and closed it again, which caused the unwanted process to disappear...

So removing the lock files and relaunching firefox despite the stuck process worked. Is there a better way though?

I suspect this question could be more general. For example I could be stuck doing a simple ls. How to kill such stuck processes?

1 Answers1

1

A process in D state is in uninterruptable sleep. No signal will kill it until its wait is over. Often the cause is incomplete I/O.

In your case, the connection, though lost, has not been closed. Either there is still some retrying to do or it it is at CLOSE_WAIT state. If you wait long enough, kill will work, but only after sshfs gives up.

You should kill the sshfs process first, and only then firefox, that will no longer have something to wait for, because the underlying filesystem will be gone (no more sshfs).

So, the quick fix:

  • kill sshfs
  • kill firefox

You might also want to look into the -o reconnect option of sshfs.