9

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?

1 Answers1

8

Why don't you just use systemctl is-active to check whether it is running?

For example:

systemctl is-active --quiet apache2 || systemctl start apache2
Michael Hampton
  • 252,907