Jantman,
The problem is that init status script does return 0 when puppet checks the
service. Since I have one of the two instances of service running, init
script returns 0 and that's not cool.
Multiple instances just run with different parameters like interface. So
when you look at ps auxf, you would see two entries. When you run init
status script, it returns two PIDs.
After I posted this question, I got an idea.
I've tweaked my init script so when one instance dies, return value is
non-zero. Or in fact it is 3 which means that service is dead.
Now the problem is that puppet doesnt restart it for some reason. It states
that service status has changed from "stopped" to "running" but the service
restart command does not get initiated.
P.S. Thanks nikolavp for response but I need to get this working with
puppet.
On Friday, November 1, 2013 5:17:25 PM UTC-4, Jason Antman wrote:
>
> Yasha,
>
> What distribution are you running? Is there any chance that you've
> specified somewhere a non-default provider for the Service type?
>
> I'm confused... this doesn't seem to be a Puppet issue to me. You
> include "hasstatus => true"... so Puppet should restart the service if
> your init script returns non-0. Are you sure your init script is
> returning non-zero to trigger the restart?
>
> How are you configuring the multiple instances? The myApp::service class
> that you show below can only be applied once on a given node.
>
> -jantman
>
> On 11/01/2013 11:41 AM, Yasha Zislin wrote:
> > Hello,
> >
> > I have multiple instances of a service running on linux server. This
> > service has status, restart, start and stop init scripts.
> > One of the instances keeps dying for unknown reasons (probably network
> > related).
> > I have puppet configured to monitor the service but it doesnt consider
> > it to be down when one of the instances dies.
> >
> > Is there a way to configure puppet to initiate restart when one of the
> > instances dies?
> >
> > Here is my current config
> >
> > class myApp::service {
> > service { "myService":
> > ensure => running,
> > hasstatus => true,
> > hasrestart => true,
> > enable => true,
> > }
> > }
> >
> > Thanks.
> > --
> > 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] <javascript:>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/puppet-users/5de0eace-4117-4ac1-8cd2-23e6efc17237%40googlegroups.com.
>
>
> > For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
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/cd959b13-bc2f-44c1-8cf5-30f0521cd723%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.