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
module_utils_service: Fix glob path of rc.d for SUSE #43018
Conversation
The test
|
f8a6480
to
3476286
Compare
cc @bcoca |
lib/ansible/module_utils/service.py
Outdated
return bool(glob.glob('/etc/rc%s.d/S??%s' % (runlevel, name))) | ||
else: | ||
if "SUSE" in platform.dist()[0].upper(): | ||
return bool(glob.glob('/etc/init.d/rc?.d/S??%s' % name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, for old suse this might not work and others that derive from suse might have same issue, lets use it as a fallback location in general
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLES11 is "oldest" supported version. SLES10 has python2.4 - ansible will exit immediately with
SyntaxError: future feature absolute_import is not defined
Should I change the commit like:
if not os.path.isdir('/etc/rc0.d/'):
return bool(glob.glob('/etc/init.d/rc?.d/S??%s' % name))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/me hides his sles8 box
Still, for other derivatives, it would still be better to not gate it specifically to 'SUSE' dist
3476286
to
8caed07
Compare
@bcoca Changed to a more generic fix |
shipit |
Some distribtuions like SUSE has the rc%.d directories under /etc/init.d Quote of /etc/rc.d.README on SLES11. "Some people expect the system startup scripts in /etc/rc.d/. We use a slightly different structure for better LSB compliance."
8caed07
to
c7d0e3b
Compare
@samdoran done |
Please create a backport PR for this to be included in previous versions. |
SUMMARY
The service module reports always a changed message when you set "enabled: true" for a service e.g. ntp.
FIX:
SUSE has the rc%.d directories under /etc/init.d
Set the glob path to /etc/init.d on SLES.
Quote of /etc/rc.d.README on SLES11.
"Some people expect the system startup scripts in /etc/rc.d/.
We use a slightly different structure for better LSB compliance."
ISSUE TYPE
COMPONENT NAME
module_utils/service.py
ANSIBLE VERSION
ADDITIONAL INFORMATION
OS / ENVIRONMENT