mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
modules.gentoo_service handle stopped retcode
In OpenRC, when a service is stopped, the retcode of /sbin/openrc-run is 3, not 0.
This commit is contained in:
parent
c3a938e994
commit
81ec66fd8b
1 changed files with 4 additions and 3 deletions
|
@ -37,9 +37,9 @@ def __virtual__():
|
|||
'only available on Gentoo/Open-RC systems.')
|
||||
|
||||
|
||||
def _ret_code(cmd):
|
||||
def _ret_code(cmd, ignore_retcode=False):
|
||||
log.debug('executing [{0}]'.format(cmd))
|
||||
sts = __salt__['cmd.retcode'](cmd, python_shell=False)
|
||||
sts = __salt__['cmd.retcode'](cmd, python_shell=False, ignore_retcode=ignore_retcode)
|
||||
return sts
|
||||
|
||||
|
||||
|
@ -248,8 +248,9 @@ def status(name, sig=None):
|
|||
'''
|
||||
if sig:
|
||||
return bool(__salt__['status.pid'](sig))
|
||||
|
||||
cmd = _service_cmd(name, 'status')
|
||||
return not _ret_code(cmd)
|
||||
return not _ret_code(cmd, ignore_retcode=True)
|
||||
|
||||
|
||||
def enable(name, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue