I, what happen’s precisely when you run
systemctl start apache2 (or other service) while service already started ?
Can it cause trouble to start several hundred times a day apache2 service? (to prevent the service from shutting down) or can it use memory or be dangerous?
Why don’t you just use
systemctl is-active to check whether it is running?
systemctl is-active --quiet apache2 || systemctl start apache2
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.