A better way would be, IMHO, to modify the init-script to do the correct things for both the JBoss processes and Puppet.
I am working in that direction with the stuff I have to maintain. Stacks running apache, mysql, tomcat and other things. Rather than one init-script for each, I'd like to implement an init-script that will start / stop / restart / status the entire stack at once as well as individual pieces thereof. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Original Message ----- From: "GRANIER Bernard (MORPHO)" <bernard.gran...@morpho.com> To: puppet-users@googlegroups.com Sent: Thursday, February 7, 2013 10:17:06 AM Subject: RE: [Puppet Users] Re: service ressource on CentOS 6.3 Hi, Thanks for your anwser, to solve my problem I write an exec resource with a kill … That should not be puppet spirit, anyway it runs … Cordialement, Bernard Granier CE Plateforme Système bernard.gran...@morpho.com 01 58 11 32 51 From: puppet-users@googlegroups.com [mailto:puppet-users@googlegroups.com] On Behalf Of jcbollinger Sent: Thursday, February 07, 2013 3:28 PM To: puppet-users@googlegroups.com Subject: [Puppet Users] Re: service ressource on CentOS 6.3 On Thursday, February 7, 2013 4:49:18 AM UTC-6, bernard...@morpho.com wrote: Error: /Stage[main]/Jbossuninstall/Service[jboss]/ensure: change from running to stopped failed: Could not stop Service[jboss]: Execution of '/sbin/service jboss stop' returned : In fact command /sbin/service jboss stop returns 143, is it the error reason ? Yes. Linux Standards Base specifications call for initscript actions other than 'status' to return 0 on success, and Puppet relies on your services to comply. Supposing that Jboss is in fact stopped successfully in your scenario, the initscript is defective on account of returning the wrong code. This is not a CentOS problem, because CentOS did not provide whatever Jboss package you are using. Supposing that you don't want to fix the Jboss init script, you can work around its buggy behavior by declaring a custom 'stop' command for the Service resource. You'll have to determine the details to match your requirements and the behavior of the initscript. If you don't care whether jboss really does stop then it might be '/bin/bash -c "/sbin/service jboss stop || /bin/true"'. John -- 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 post to this group, send email to puppet-users@googlegroups.com . Visit this group at http://groups.google.com/group/puppet-users?hl=en . For more options, visit https://groups.google.com/groups/opt_out . # " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system." # -- 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 post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en . 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 puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.