Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 429  / 3 Years ago, mon, september 20, 2021, 7:59:18

Almost, every time if sudo pkill -f tor which runs as root on startup. I loose all the frames(frameless) of my current and future windows. And I have noticed the Ubuntu tends to behave strangely(can't define it exactly) to such an extent that restart(didn't try log-off and log-in) seems to be a be better option for me. I don't think tor is the cause of this but I am speaking as per observation.



What could be the reason behind this?


More From » window

 Answers
4

You're probably killing processes you didn't intend to. The -f options matches on the full command line:



The pattern is normally only matched against the  process  name.
When -f is set, the full command line is used.


To see which processes you're actually killing, do:



ps wwuxa |grep [t]or


The actual match as done by pkill is the same as done by pgrep. Compare the PIDs returned by pgrep tor vs. pgrep -f tor.



you'll see many processes; since you run pkill with sudo, this means you kill all those processes. My guess is gtk-window-decorator is the one whose absence causes the frames problem you describe. The rest of the strange behavior is due to the other system processes that also died.



In this case, since "tor" matches several system processes, you should specify a more strict regular expression, and not use -f. This may work:



pgrep  ^tor$


Don't use -f and ensure that it matches only one process, and that the process is indeed tor. Once you're satisfied, you can pkill instead of pgrep.



Finally, I'm unfamiliar with tor, but perhaps somewhere in the documentation you can find a more correct way to shut it down.


[#29099] Monday, September 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theurn

Total Points: 30
Total Questions: 110
Total Answers: 111

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
theurn questions
Tue, Apr 5, 22, 14:18, 2 Years ago
Mon, Feb 14, 22, 16:29, 2 Years ago
Sat, Apr 8, 23, 05:26, 1 Year ago
Tue, Jan 10, 23, 23:59, 1 Year ago
Fri, Apr 8, 22, 01:36, 2 Years ago
;