Regarding Service elements in init.pp

16 views
Skip to first unread message

Satish Katuru

unread,
Jul 3, 2014, 8:53:01 AM7/3/14
to puppet...@googlegroups.com
Hi ,

My init.pp has two service elements like below:

class httpd
{

service{
"startjavaservice.sh":
ensure => "running",
}

service{
"stopjavaservice.sh":
ensure =>"stopped",

}
}

First one is for starting Java service and the second one is for stopping the same service.

Problem:

When it has  only one service then it is working fine but when it has two services it is not working.

(If  It has only startjavaservice then java service is getting started successfully and if it has only stopjavaservice java service is getting stopped.
If it has both the services first service should start and then it should be stopped but here only first thing happened. Java service has started but not stopped)

Can any one help me out on this?


Regards,
Sathish.

Christopher Wood

unread,
Jul 3, 2014, 9:17:43 AM7/3/14
to puppet...@googlegroups.com
In your place I would merge those two into a single init script with the usual lsb-ish start+stop+restart+status that puppet's service type/provider expects. They both control the same service and thus should be defined in a single resource.
> --
> 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 [1]puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> [2]https://groups.google.com/d/msgid/puppet-users/14b889bb-bbdf-4818-baa7-995a8d6afdd8%40googlegroups.com.
> For more options, visit [3]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:puppet-users...@googlegroups.com
> 2. https://groups.google.com/d/msgid/puppet-users/14b889bb-bbdf-4818-baa7-995a8d6afdd8%40googlegroups.com?utm_medium=email&utm_source=footer
> 3. https://groups.google.com/d/optout
Reply all
Reply to author
Forward
0 new messages