New comment by heliocat on void-packages repository https://github.com/void-linux/void-packages/pull/30599#issuecomment-830989639 Comment: > 3. Like heliocat says, don't do pgrep or other process hacks. Unlike heliocat, I think using `/proc` is just as ugly. Don't do it. > I didn't say I thought `/proc` wasn't ugly, more that it's less ugly to use the native pid following in runit and then check the specific process details than it is to walk the entire process tree. The `chpst -L` route is probably the least-bad since it'll be relatively TOCTOU-free.