mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Add reload to systemd module
This commit is contained in:
parent
61057b2b66
commit
876991a452
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user