Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return correct value for services that must be enabled in Systemd #31677

Merged
merged 1 commit into from
Mar 6, 2016

Conversation

miihael
Copy link
Contributor

@miihael miihael commented Mar 4, 2016

What does this PR do?

Fix incorrect return value for service.enabled

Previous Behavior

True is returned when the Systemd-based service is disabled in Systemd
but enabled in SysV

New Behavior

True is returned only when the Systemd-based service is enabled in Systemd

Tests written?

  • Yes
  • No

This fixes situations, when a server is switched from SysV to Systemd.
SysV symlinks are still in place and Salt incorrectly determines, that
service is 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

@rallytime
Copy link
Contributor

Go Go Jenkins!

@rallytime
Copy link
Contributor

Hi @miihael - You have a small lint error. Would you mind cleaning that up?

@rallytime rallytime added the pending-changes The pull request needs additional changes before it can be merged label Mar 4, 2016
…t 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
@miihael
Copy link
Contributor Author

miihael commented Mar 6, 2016

You have a small lint error. Would you mind cleaning that up?

I fixed it, thank you!

@rallytime rallytime removed the pending-changes The pull request needs additional changes before it can be merged label Mar 6, 2016
@rallytime
Copy link
Contributor

Thanks!

rallytime pushed a commit that referenced this pull request Mar 6, 2016
Return correct value for services that must be enabled in Systemd
@rallytime rallytime merged commit bed98d8 into saltstack:develop Mar 6, 2016
@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 5, 2016

@rallytime can we get this backported to 2016.3? This will fix issue #34267

@Ch3LL Ch3LL added the bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch label Aug 5, 2016
@rallytime
Copy link
Contributor

@Ch3LL Definitely - see #35244

@rallytime rallytime added ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch. and removed bugfix-bckport will be be back-ported to an older release branch by creating a PR against that branch labels Aug 5, 2016
cachedout pushed a commit that referenced this pull request Aug 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ZZZ[Done]-back-ported-bf RETIRED The pull request has been back-ported to an older branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants