fabtools.service
¶
System services¶
This module provides low-level tools for managing system services,
using the service
command. It supports both upstart services
and traditional SysV-style /etc/init.d/
scripts.
See also
See also
-
fabtools.service.
is_running
(service)[source]¶ Check if a service is running.
import fabtools if fabtools.service.is_running('foo'): print "Service foo is running!"
-
fabtools.service.
start
(service)[source]¶ Start a service.
import fabtools # Start service if it is not running if not fabtools.service.is_running('foo'): fabtools.service.start('foo')
-
fabtools.service.
stop
(service)[source]¶ Stop a service.
import fabtools # Stop service if it is running if fabtools.service.is_running('foo'): fabtools.service.stop('foo')
-
fabtools.service.
restart
(service)[source]¶ Restart a service.
import fabtools # Start service, or restart it if it is already running if fabtools.service.is_running('foo'): fabtools.service.restart('foo') else: fabtools.service.start('foo')