mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Return correct value for services that must be enabled in Systemd, not in SysV
This fixes situations, when a server switched from SysV to Systemd. SysV symlinks are still in place and Salt incorrectly determines, that service is already enabled. For example: ~$ salt-call --local service.enabled spamassassin [INFO ] Executing command 'systemctl is-enabled spamassassin.service' [INFO ] Executing command 'runlevel' in directory '/root' local: True However: ~$ systemctl is-enabled spamassassin.service disabled ~$ find /etc/rc*.d/ -name '*spamassassin' /etc/rc0.d/K02spamassassin /etc/rc1.d/K02spamassassin /etc/rc2.d/S02spamassassin /etc/rc3.d/S02spamassassin /etc/rc4.d/S02spamassassin /etc/rc5.d/S02spamassassin /etc/rc6.d/K02spamassassin
This commit is contained in:
parent
bd0496eef5
commit
45d563d5ac
1 changed files with 3 additions and 1 deletions
|
@ -779,9 +779,11 @@ def enabled(name, **kwargs): # pylint: disable=unused-argument
|
|||
# string will be non-empty.
|
||||
if bool(__salt__['cmd.run'](cmd, python_shell=False)):
|
||||
return True
|
||||
else:
|
||||
elif name in _get_sysv_services():
|
||||
return _sysv_enabled(name)
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def disabled(name):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue