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 <[email protected]>:
> 
> 
> 
>> Am 27.11.2023 um 17:54 schrieb 'Kenyon Ralph' via Puppet Users 
>> <[email protected]>:
>> 
>> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/BD107A9D-ED3E-46F9-9A29-CF9D62FB4D94%40gmail.com.

Reply via email to