mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
commit
e2a081b662
@ -85,3 +85,34 @@ def _check_minions_directories_raetkey(pki_dir):
|
||||
rejected = os.path.join(pki_dir, salt.key.RaetKey.REJ)
|
||||
|
||||
return accepted, pre, rejected
|
||||
|
||||
|
||||
def kill():
|
||||
'''
|
||||
Kill the salt minion.
|
||||
|
||||
If you have a monitor that restarts ``salt-minion`` when it dies then this is
|
||||
a great way to restart after a minion upgrade.
|
||||
|
||||
CLI example::
|
||||
|
||||
>$ salt minion[12] minion.kill
|
||||
minion1:
|
||||
----------
|
||||
killed:
|
||||
7874
|
||||
minion2:
|
||||
----------
|
||||
killed:
|
||||
29071
|
||||
|
||||
The result of the salt command shows the process ID of the minions that were
|
||||
successfully killed - in this case they were ``7874`` and ``29071``.
|
||||
'''
|
||||
pid = __grains__.get('pid')
|
||||
if pid:
|
||||
if 'ps.kill_pid' in __salt__:
|
||||
__salt__['ps.kill_pid'](pid)
|
||||
else:
|
||||
pid = None
|
||||
return {'killed': pid}
|
||||
|
Loading…
Reference in New Issue
Block a user