Add reload to systemd module

This commit is contained in:
Thomas S Hatch 2012-04-25 15:56:07 -06:00
parent 61057b2b66
commit 876991a452

View File

@ -31,6 +31,7 @@ def get_enabled():
ret.append(serv)
return sorted(ret)
def get_disabled():
'''
Return a list of all disabled services
@ -46,6 +47,7 @@ def get_disabled():
ret.append(serv)
return sorted(ret)
def get_all():
'''
Return a list of all available services
@ -63,6 +65,7 @@ def get_all():
ret.add(fn_[:fn_.rindex('.')])
return sorted(list(ret))
def start(name):
'''
Start the specified service with systemd
@ -89,16 +92,28 @@ def stop(name):
def restart(name):
'''
Start the specified service with systemd
Restart the specified service with systemd
CLI Example::
salt '*' service.start <service name>
salt '*' service.restart <service name>
'''
cmd = 'systemctl restart {0}.service'.format(name)
return not __salt__['cmd.retcode'](cmd)
def reload(name):
'''
Reload the specified service with systemd
CLI Example::
salt '*' service.reload <service name>
'''
cmd = 'systemctl reload {0}.service'.format(name)
return not __salt__['cmd.retcode'](cmd)
# The unused sig argument is required to maintain consistency in the state
# system
def status(name, sig=None):