2021-04-04 14:15:05
strace is a very old yet popular tool for Linux troubleshooting. Moreover, on many Ops interviews an interviewer is only satisfied when a candidate mentiones strace during the troubleshooting questions section. And of course, there are more bonus points for mentioning that strace shows system calls of a given process(es) and their arguments and return values.
Although, what are we trying to solve with it? And when to use it?
Julia Evans collected 9 common categories of problems which people use to solve with strace:
- where’s the config file?
- what other files does this program depend on?
- why is this program hanging?
- is this program stuck?
- why is this program slow?
- hidden permissions errors
- what command line arguments are being used?
- why is this network connection failing?
- why does this program succeed when run one way and fail when run in another way?
P.S. She also has a free webzine on how strace works!
2.3K views11:15