On Friday, December 1, 2023 at 10:17:29 AM UTC-8 jochen....@gmail.com wrote:
Hi Nick, good point! As of the debug log, it seems to issue the start command, although the dog says that puppet would use the restart command if hasrestart is set to true I will have to wait for the problem to reoccur to finally test this. Thanks a lot This is not a puppet problem. Your amavis service configuration is broken if it requires a restart instead of a start when it dies and is stopped. Either fix the service, or use puppet to install a systemd dropin that sets https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Restart= or something like that. Am 01.12.2023 um 19:10 schrieb Nick Bertrand <ni...@nickbertrand.com>: Hi Jochen, When amavis is in the broken state, does `service amavis start` fix it or is it just `service amavis restart` that fixes it? If 'restart' works, but 'start' doesn't, I wonder if Puppet is running the start command instead of restart. Running the puppet agent in debug mode should show you the actual command being run. If you see `systemctl start amavis` is being run, you might try setting the `start` parameter to what you have `restart` set to: service { 'amavis': ... start => '/usr/sbin/service amavis restart', ... } Thanks, Nick On Fri, Dec 1, 2023 at 11:39 AM Jochen Haeberle <jochen....@gmail.com> wrote: now I have a declaration that kicks in when the problem occurs: service { 'amavis': hasrestart => true, provider => 'systemd', restart => '/usr/sbin/service amavis restart', status => '/usr/bin/systemctl is-active --quiet amavis && [ "$(/usr/bin/systemctl show -p SubState --value amavis)" = "running" ] && exit 0 || exit 1', ensure => running } the status-line detects the problem fine and when I run this, puppet says it’s chaning the service status: Notice: /Stage[main]/Main/Service[amavis]/ensure: ensure changed 'stopped' to 'running' But it is not running after that. Manually running /usr/sbin/service amavis restart brings up the service fine. Anyone has a tipp what I am doing wrong? thx Am 28.11.2023 um 12:45 schrieb Jochen Haeberle <jochen....@gmail.com>: Am 27.11.2023 um 17:54 schrieb 'Kenyon Ralph' via Puppet Users < puppet...@googlegroups.com>: The service restarts manually fine with service amavis restart The question is not why it died but how to get it running again using Puppet. Puppet simply runs systemctl start amavis if you have ensure => running. If it is dying, it most likely has nothing to do with Puppet. sure, Puppet is not involved in the dying. But my problem is, why it is not restarting the service. When I had the problem, service amavis start did not work, but service amavis restart did. So I changed my declaration to service { 'amavis': hasrestart => true, ensure => running } Perhaps this will work better. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/BD107A9D-ED3E-46F9-9A29-CF9D62FB4D94%40gmail.com <https://groups.google.com/d/msgid/puppet-users/BD107A9D-ED3E-46F9-9A29-CF9D62FB4D94%40gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAP15v%2B-MB6rKu26AZWqJtq3Z9Dy1QkcGt8Z2Dy%3DkYG-Mf2A9Lw%40mail.gmail.com <https://groups.google.com/d/msgid/puppet-users/CAP15v%2B-MB6rKu26AZWqJtq3Z9Dy1QkcGt8Z2Dy%3DkYG-Mf2A9Lw%40mail.gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/18e9b5b6-cd6b-4c0e-98f7-fbe874917be5n%40googlegroups.com.