2

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?

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.

2

Your pkill call kills all processes which have the string tor in their command line (such as monitor or navigator or calculator etc). Thus, I guess you're also killing important processes and end up in an unstable system.

I recommend stopping tor using:

sudo service tor stop

or

sudo /etc/init.d/tor stop 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.