-
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 #7529: Add support for the SRC system on AIX for service management #277
Fixes #7529: Add support for the SRC system on AIX for service management #277
Conversation
@@ -36,7 +36,7 @@ bundle agent test | |||
|
|||
methods: | |||
|
|||
"ph" usebundle => service_management("${init.service}", "reload"); | |||
"ph" usebundle => service_action("${init.service}", "reload"); |
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.
This bundle was renamed a while ago. It doesn't exist.
@@ -39,7 +39,14 @@ bundle agent service_action(service_name, action) | |||
|
|||
"action_command" string => "${paths.path[service]} ${service_name} ${action}"; | |||
|
|||
!systemctl_utility_present.!service_utility_present.init_d_directory_present:: | |||
!systemctl_utility_present.!service_utility_present.startsrc_utility_present:: | |||
"svc_action_cmd[restart]" string => "/usr/bin/stopsrc -s ${service_name}; /usr/bin/startsrc -s ${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.
This method may not always work: stopsrc says that the service was requested to stop, not that it stoped
cf https://www.ibm.com/developerworks/community/blogs/brian/entry/scripting_the_stop_and_restart_of_src_controlled_processes_on_aix6?lang=en
the common workaround is:
stopsrc -s sshd
sleep 10
startsrc -s sshd
the tricky one (and hard to make all purpose) is stopsrc -s sshd && until lssrc -s sshd | grep -q inoperative; do echo "Waiting for sshd to stop"; perl -e 'select(undef,undef,undef,.25)'; done && startsrc -s sshd
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.
OK, sounds good to me. I don't see why this is harder, though. Implementing.
Please wait before merging - this is missing support for service_check_started_at_boot |
PR updated |
58da841
to
adedf05
Compare
PR updated |
c833f19
to
56dfe2a
Compare
PR updated |
56dfe2a
to
4ebfbb1
Compare
PR updated |
OK, this is ready for review and merge again! |
@@ -35,7 +35,10 @@ bundle agent service_check_started_at_boot(service_name) | |||
pass2.!systemctl_utility_present.chkconfig_utility_present:: | |||
"command_to_check" string => "${paths.path[chkconfig]} --list ${service_name} | grep -q -e 3:on -e B:on"; | |||
|
|||
pass2.(!(systemctl_utility_present|chkconfig_utility_present)|broken_systemctl):: | |||
pass2.!systemctl_utility_present.!chkconfig_utility_present.lsitab_utility_present:: | |||
"command_to_check" string => "lsitab -a | egrep '^${service_name}:[0-9]+:(respawn|boot|bootwait|wait|once|initdefault|sysinit):'"; |
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.
could you use the full paths to the binaries ?
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.
Wow, I'm amazed that CFEngine doesn't complain about this anymore!! Yes, of course, fixing
PR updated |
4ebfbb1
to
92750eb
Compare
PR updated |
92750eb
to
2f23092
Compare
redhat:: | ||
"service_name" string => "crond"; | ||
aix:: | ||
"service_name" string => "sshd"; |
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.
Given that most of the time the machine doing the test will be controlled by someone like us you can use a use a less critical service like syslogd, snmpd or inetd.
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.
True, but this is just a check. No harm can be done.
2f23092
to
c5ad40d
Compare
PR updated |
PR updated |
c5ad40d
to
db0a659
Compare
Good, merging |
…rc_system_on_aix_for_service_management Fixes #7529: Add support for the SRC system on AIX for service management
https://www.rudder-project.org/redmine/issues/7529