- global service
- print("==================== Stopping %s" % service)
- os.system("service %s stop" % service)
- print("==================== Starting %s" % service)
- os.system("service %s start" % service)
+ services = ('sfa-db', 'sfa-aggregate', 'sfa-registry')
+ for service in services:
+ restart = ("systemctl -q is-active {s} && {{ echo restarting {s} ; systemctl restart {s}; }}"
+ .format(s=service))
+ os.system(restart)