Skip to main content
Topic: Htop (Read 176 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Htop

Hello,

I have recently migrated from devuan to artix.When i run HTOP i can see that Firefox is running like this>
Quote


tom       3086     1 13 17:15 ?        00:02:20 /usr/lib/firefox/firefox
tom       3168  3086  0 17:15 ?        00:00:03 /usr/lib/firefox/firefox -contentproc -childID 2 -isForBrowser -prefsLen 41 -prefMapSize 221475 -parentBuildID 20200727193539 -appdir /usr/lib/firefox/browser 3086 true tab
tom       3229  3086  1 17:15 ?        00:00:13 /usr/lib/firefox/firefox -contentproc -childID 3 -isForBrowser -prefsLen 308 -prefMapSize 221475 -parentBuildID 20200727193539 -appdir /usr/lib/firefox/browser 3086 true tab

If i remeber well on Devuane i had in HTOP listing something like this>
Quote
tom  ...... /usr/sbin/firefox

When i want to get a PID of Firefox using PGREP, i get nothing .

echo $? returns 1, an error.

When i run Chromium, there is also no listing in HTOP like /usr/sbin/chromium but PGREP returns some PIDs

Well I do not whether this is a bug or feature?

Thanks for any suggestions or advice.

Re: Htop

Reply #1
You might want to take a look at the htop settings "hide userland process threads":

Re: Htop

Reply #2
Thanks for a swift reply.

But my question is whether the HTOP does intentionally show FIREFOX process like

/usr/lib/firefox/firefox

AND NOT like

/usr/sbin/firefox

Why the PGREP commnad does not return Firefox s PID?

Thanks

Re: Htop

Reply #3
Quote
Why the PGREP commnad does not return Firefox s PID?
what's the full pgrep command you're typing?

probably the way firefox is built from source for artix, using /usr/lib/firefox and then linking the binary in /usr/bin
waterfox is the same way:

Re: Htop

Reply #4
Thanks for clearing things up, my answer was a way off then ... :D

As @toxygen already mentioned, the different paths to the firefox executable are just a matter of packaging.
When you have a look at /usr/bin/firefox, it's just a tiny shell script launching  the firefox binary in /usr/lib/firefox.  So someone decided to put the whole firefox stuff to /usr/lib/firefox/.

As to pgrep, i'm not familiar with what behaviour would be expected, but it works fine as soon as i use the -f switch:
Code: [Select]
$ pgrep -a -f -o firefox
3123 /usr/lib/firefox/firefox

Re: Htop

Reply #5
Hello,

Thank you very much for explanation.When i run the command as you do

Code: [Select]
pgrep -a -o -f firefox

I get the awaited result >

Code: [Select]
3116 /usr/lib/firefox/firefox

I just do not understand why the PGREP command without the switches, does not return anything, ends with error?

As mentioned above when i run
Code: [Select]
pgrep chromium
, it returns the PID of chromium.

Any idea why?

Thanks