This module provides low-level tools for managing systemd services.
See also
Enable a service.
fabtools.enable('httpd')
Note
This function is idempotent.
Disable a service.
fabtools.systemd.disable('httpd')
Note
This function is idempotent.
Check if a service is running.
if fabtools.systemd.is_running('httpd'):
print("Service httpd is running!")
Start a service.
if not fabtools.systemd.is_running('httpd'):
fabtools.systemd.start('httpd')
Note
This function is idempotent.
Stop a service.
if fabtools.systemd.is_running('foo'):
fabtools.systemd.stop('foo')
Note
This function is idempotent.
Restart a service.
if fabtools.systemd.is_running('httpd'):
fabtools.systemd.restart('httpd')
else:
fabtools.systemd.start('httpd')
Reload a service.
fabtools.systemd.reload('foo')
Warning
The service needs to support the reload operation.