fix service status setting
fixes #18687 as 'disabled' can be at the end of the output fixes #20228 by not falling back to init scripts when it is a user service
This commit is contained in:
parent
49e9d10f8e
commit
19496b5b73
1 changed files with 5 additions and 2 deletions
|
@ -370,8 +370,11 @@ def main():
|
|||
if rc == 0:
|
||||
enabled = True
|
||||
elif rc == 1:
|
||||
# if both init script and unit file exist stdout should have enabled/disabled, otherwise use rc entries
|
||||
if is_initd and (not out.startswith('disabled') or sysv_is_enabled(unit)):
|
||||
# if not a user service and both init script and unit file exist stdout should have enabled/disabled, otherwise use rc entries
|
||||
if not module.params['user'] and \
|
||||
is_initd and \
|
||||
(not out.strip().endswith('disabled') or sysv_is_enabled(unit)):
|
||||
|
||||
enabled = True
|
||||
|
||||
# default to current state
|
||||
|
|
Loading…
Reference in a new issue