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

sensu_agent Should Restart the Service Instead of Reloading #144

Open
devinlyons opened this issue Jul 6, 2023 · 0 comments
Open

sensu_agent Should Restart the Service Instead of Reloading #144

devinlyons opened this issue Jul 6, 2023 · 0 comments

Comments

@devinlyons
Copy link

The sensu_agent resource notifies the sensu-agent process to reload via systemd. However, the unit does not have a reload option. All other attempts to reload the agent's configuration are done with the :restart action.

Based on the logs, I believe the issue is located here:

notifies :reload, 'systemd_unit[sensu-agent]', :immediately

Here are the results I get when I run this resource.

  * sensu_agent[default] action install
    * packagecloud_repo[sensu/stable] action add
      * yum_package[pygpgme] action install (up to date)
      * log[pygpgme_warning] action write (skipped due to not_if)
      * template[/etc/yum.repos.d/sensu_stable.repo] action create (up to date)
      * execute[yum-makecache-sensu_stable] action nothing (skipped due to actio                                                                                                                                                             n :nothing)
      * ruby_block[yum-cache-reload-sensu_stable] action nothing (skipped due to                                                                                                                                                              action :nothing)
       (up to date)
    * yum_package[sensu-go-agent] action install
      - install version 6.9.2-7020 of package sensu-go-agent
    * systemd_unit[sensu-agent] action reload

      ================================================================================
      Error executing action `reload` on resource 'systemd_unit[sensu-agent]'
      ================================================================================

      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '3'
      ---- Begin output of ["/usr/bin/systemctl", "--system", "reload", "sensu-agent"] ----
      STDOUT:
      STDERR: Failed to reload sensu-agent.service: Job type reload is not applicable for unit sensu-agent.service.
      See system logs and 'systemctl status sensu-agent.service' for details.
      ---- End output of ["/usr/bin/systemctl", "--system", "reload", "sensu-agent"] ----
      Ran ["/usr/bin/systemctl", "--system", "reload", "sensu-agent"] returned 3

      Resource Declaration:
      ---------------------
      # In /var/chef/cache/cookbooks/sensu-go/resources/agent.rb

       59:     systemd_unit 'sensu-agent' do
       60:       action :nothing
       61:     end
       62:

      Compiled Resource:
      ------------------
      # Declared in /var/chef/cache/cookbooks/sensu-go/resources/agent.rb:59:in                                                                                                                                                              `block in class_from_file'

      systemd_unit("sensu-agent") do
        action [:nothing]
        default_guard_interpreter :default
        declared_type :systemd_unit
        cookbook_name "ac_sensu_agent"
        unit_name "sensu-agent"
      end

      System Info:
      ------------
      chef_version=16.16.13
      platform=centos
      platform_version=7.9.2009
      ruby=ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
      program_name=/usr/bin/chef-client
      executable=/opt/chef/bin/chef-client


    ================================================================================
    Error executing action `install` on resource 'sensu_agent[default]'
    ================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant