Timeline for How to check if process with pid X is the one you expect
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 3, 2021 at 16:21 | comment | added | AnyDev | It seems you are reinventing service manager, if so, wrapping your background process into a systemd service should be easy and reliable. | |
Nov 2, 2021 at 17:08 | comment | added | DopeGhoti |
This only answers half of your question, but you can check if a process exists and is running with kill -0 $pid ; e. g. if kill -0 "$pid"; then printf "PID %d exists and is running.\n" "$pid" .
|
|
S Nov 2, 2021 at 16:51 | answer | added | carl verbiest | timeline score: 0 | |
S Nov 2, 2021 at 16:51 | history | asked | carl verbiest | CC BY-SA 4.0 |