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

Do not include pupmod::agent::cron if daemonize=true #161

Open
nick-markowski opened this issue Nov 9, 2021 · 2 comments
Open

Do not include pupmod::agent::cron if daemonize=true #161

nick-markowski opened this issue Nov 9, 2021 · 2 comments

Comments

@nick-markowski
Copy link
Member

Including pupmod::agent::cron when daemonize = true causes a conflict of puppet service management. Recommend updating the logic in init.pp to exclude pupmod::agent::cron and ensure the legacy cron and new systemd timer absent, when daemonize = true:

if $daemonize {
  $_puppet_service_ensure = 'running'
  cron { 'puppetagent': ensure => 'absent' }
  systemd::timer { 'puppet_agent.timer': ensure => 'absent' }
}
else {
  $_puppet_service_ensure = 'stopped'
  include 'pupmod::agent:cron'
}
@trevor-vaughan
Copy link
Member

The puppet::agent::cron::enable boolean should also disable the exec that kills the puppet service if set to false.

@greatflyingsteve
Copy link

greatflyingsteve commented Mar 21, 2024

I hate to add insult to injury, but how is such a glaringly obvious bug, that kneecaps the majority use case for the Puppet Agent, that even the meanest testing should have uncovered, still present four releases and over two years later?

We were using simp-pupmod in our environment, and this bug just bit us. As an additional heads-up, there's one more problem to solve: when Puppet is applying the change from vendor service to timer unit (or vice versa), the order of operations is non-deterministic, and the agent will accidentally suicide about half of the time when it removes or nerfs the service unit it was running under and systemd immediately kills it before it can start the new run method.

When this gets fixed, please test the transition from vendor service to timer unit and vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

3 participants