mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add restart to the service module
This commit is contained in:
parent
02c324f008
commit
5df495582a
1 changed files with 11 additions and 0 deletions
|
@ -35,6 +35,17 @@ def stop(name):
|
|||
name + ' stop')
|
||||
return not subprocess.call(cmd, shell=True)
|
||||
|
||||
def restart(name):
|
||||
'''
|
||||
Restart the named service
|
||||
|
||||
CLI Example:
|
||||
salt '*' service.restart <service name>
|
||||
'''
|
||||
cmd = os.path.join(grainmap[__grains__['os']],
|
||||
name + ' restart')
|
||||
return not subprocess.call(cmd, shell=True)
|
||||
|
||||
def status(name, sig=None):
|
||||
'''
|
||||
Return the status for a service, returns the PID or an empty string if the
|
||||
|
|
Loading…
Add table
Reference in a new issue