-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fixes #5861: service_ensure_stopped_at_boot is missing #146
Fixes #5861: service_ensure_stopped_at_boot is missing #146
Conversation
# | ||
##################################################################################### | ||
|
||
# @name Service check at boot |
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.
the name is incomplete
there are lots of similarity betwwen service_ensure_stopped_at_boot and service_ensure_started_at_boot |
f7638f4
to
2d864f4
Compare
@ncharles updated |
vars: | ||
|
||
systemctl_utility_present:: | ||
"command_to_check" string => "!${paths.path[systemctl]} is-enabled ${service_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.
what is this ! doing there ?
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.
It's for negating the return code, but it seems to be bash specific.
@ncharles updated |
Your last commit is named xxx. Please rename. |
Agreed with @ncharles, this needs to be factorised. We should never duplicate code. A simple approach would be to add a method called service_ensure_boot_status(service_name, status), and modify service_ensure_{started,stopped}_at_boot to just be wrappers that call this central method with the second argument as "enabled" or "disabled". |
The only common part is the command call part. |
so, there is no may to DRY it a bit ? |
As said, there is almost nothing common between started and stopped at boot except the method structure. |
5572c9b
to
cbf0302
Compare
PR replaced by #310 |
http://www.rudder-project.org/redmine/issues/5861