Roughly speaking the service name is the init script name, so if you would manually stop/stop with /etc/init.d/java, then your service name in puppet is also java.
node "servername" { Service { "java": ensure = >"Stopped", } } Using "Resource" (initial capital) instead of "resource" (all lower case) is for defaults. You probably want to use "service" there. You probably also want enable => false, so that the service will not start on boot. Using debug/verbose will help you: puppet apply --debug manifest.pp puppet apply --verbose manifest.pp On Fri, Jun 20, 2014 at 03:02:01AM -0700, Satish Katuru wrote: > Hi, > > I am new to Puppet and We are trying to stop and start any one of the > services running on the Puppet master /agent machine. > > Here is the Scenario: > > 1. we have a Jboss service running on Puppet master and I am trying to > kill this service thru puppet.(this service is runnning with my userid) > > Service name is "java". > > 2. In /etc/puppet/manifests/nodes.pp I have written code like this > > node "servername" > { > > Service { > > "java": > ensure = >"Stopped", > > } > } > > after this I ran this command > > puppet apply nodes.pp > > Nothing has happend.Still the process is running.(I am able to see the > process id : ps -ef|grep java) > > 3.After this i created a module and place this code in init.pp in > /etc/puppet/modues/httpd/ > > node "servername" > { > inlcude httpd > } > > puppet apply nodes.pp > > Nothing happend. > > Can you please guide us how to kill a process? > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > > [2]https://groups.google.com/d/msgid/puppet-users/c81e168e-38f0-416c-b0c2-bd0124c9e760%40googlegroups.com. > For more options, visit [3]https://groups.google.com/d/optout. > > References > > Visible links > 1. mailto:puppet-users+unsubscr...@googlegroups.com > 2. > https://groups.google.com/d/msgid/puppet-users/c81e168e-38f0-416c-b0c2-bd0124c9e760%40googlegroups.com?utm_medium=email&utm_source=footer > 3. https://groups.google.com/d/optout -- 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/20140620172500.GA16135%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.