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

Centos 7 - not properly managing sensu-client service #855

Closed
jwatroba opened this issue Dec 12, 2017 · 5 comments
Closed

Centos 7 - not properly managing sensu-client service #855

jwatroba opened this issue Dec 12, 2017 · 5 comments
Assignees

Comments

@jwatroba
Copy link

jwatroba commented Dec 12, 2017

Description of problem

  • What did you do?
    Use this module on CentOS 7 servers
  • What happened?
    If the sensu-client service isn't running, it will not start the process. We have the same config on our CentOS 6 systems and this works fine.
  • What did you expect to happen?
    sensu-client service should be started if it's not running.
  • How can someone reproduce the problem?
    Test sensu-client service management on CentOS7

Command used and debugging output

  • What does your puppet config look like (including any hiera config)
  sensu:
    api: false
    client_custom:
      tags:
        hostname: REDACTED
    install_repo: false
    manage_repo: false
    manage_services: true
    plugins:
    - REDACTED
    rabbitmq_host: REDACTED
    rabbitmq_password: REDACTED
    rabbitmq_vhost: "/sensu"
    sensu_plugin_version: 1.2.0
    subscriptions:
    - common
    use_embedded_ruby: true
    version: 0.26.5-2
  • Is this a masterless or master based puppet setup?
    master based.

Platform and version information

  • Your OS: CentOS 7
  • Your Ruby version: 2.3.0p0
  • Your version of Puppet: 4.8.0
  • Your version of Sensu: 0.26.5-2
  • Your version of this module: 2.41.0

Anything else to add that you think will be helpful?

@ghoneycutt ghoneycutt self-assigned this Dec 12, 2017
@ghoneycutt
Copy link
Collaborator

I'm not able to reproduce this issue.

Are you specifying the service provider elsewhere in your code? If you are, it could be attempting to use a different service provider instead of picking the correct one.

Search for Provider and Service in your code to see if you are.

@jwatroba
Copy link
Author

This is interesting. Running a debug trying to set the resource while the service is stopped:

puppet resource service sensu-client ensure=running --debug
...
Debug: Executing: '/bin/systemctl is-active sensu-client'
service { 'sensu-client':
  ensure => 'running',
}
...

The issue systems to be systemd reporting that it's active:

systemctl is-active sensu-client
active

When looking at the status it shows:

systemctl status sensu-client
sensu-client.service - LSB: Sensu monitoring framework client
   Loaded: loaded (/etc/rc.d/init.d/sensu-client; bad; vendor preset: disabled)
   Active: active (exited) since Sat 2017-12-09 08:20:39 PST; 3 days ago

Puppet seems to be treating the state "active (existed)" as running. Not sure why this is, but I'm guessing it's probably not related to this module.

@ghoneycutt
Copy link
Collaborator

Reminds me of https://tickets.puppetlabs.com/browse/PUP-7163 though that is with the service being enabled, not the status.

@ghoneycutt
Copy link
Collaborator

This could be it - https://tickets.puppetlabs.com/browse/PUP-6759

You could try upgrading puppet to the latest v4 version. Going to close this since it's not related to this module. Let us know if the upgrade works!

@jwatroba
Copy link
Author

It seems to have something to do with the mix of systemd and the old init script. If I restart the system, sensu-client starts fine. If I stop it with systemd, it will properly stop it and puppet will restart it. If I stop it with the init script:
/etc/init.d/sensu-client stop, it sets that 'Active' field to 'active (exited)' and puppet thinks it's running. Looks like sensu moved to systemd as a default if available in 0.27, so I'm guessing just upgrading my client will fix this.

Thanks for the help.

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

2 participants