This question already has an answer here:
- Detect init system using the shell 18 answers
I have a Python service in systemd. I'd like to have it use the Python
syslog module for logging if it's running in systemd vs. otherwise. Is there a reliable way to determine if I'm running in systemd or is there a better way of going about it?