A similar question is already asked here, but my question is very specific: I don't have a PID, but a PID file. Is there a cleaner way of doing this other than reading the file myself? Preferably without an extra module to install.
To avoid an XY problem, what I really want to do is to issue this in Python: pkill -HUP rsyslogd
. I am asking because I thought of os.kill(pid_file, signal.SIGHUP)
, but if there is a different idea for doing what I want, that's more than welcome.