Expand description
Just some random process manipulation functions that I’ve found useful
Functions§
- find_
all_ pids - Walk through /proc and find all processes with the name that equals the cmd_name.
- get_
cmdline - Get the cmdline used to start the process
- kill_
and_ restart - Kills a process and optionally the parent process and restarts them. simulate will just log and not kill anything. Currently SIGTERM is used to nicely stop processes and wait for them to exit. If you need a bigger hammer this isn’t the function for you.
- spinlock
- Simple spinlock that waits a certain number of milliseconds while a pid still exists.