I want to debug a running python service which has threads in my Ubuntu system. I need to attach running root process and be able to place break points in python script.

What would be the best way to follow for this task?


You can use the Python debugger, pdb, for this. You can import it as a module or use it interactively. The docs for 2.7 are here : https://docs.python.org/2/library/pdb.html

  • Would you mind to detail a little more how to use pdb? – Rui F Ribeiro Mar 8 '17 at 10:50
  • pdb can be used when the program is run from the console. In case of a service, pdb would interrupt the execution but you don't get a console prompt – davka May 15 '18 at 13:25

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.