>From what I understand using "puppet apply" will make no attempt to contact the puppet master and so is useful for testing, but all your Puppet config files must be local. The file you are applying should be in CWD, or you can just:
puppet apply [options] /wherever/test.pp As for your error output below, I'm not sure why it would be trying to look for "apply.pp", has it parsed the "apply" sub command as if it's expecting a file I wonder. It doesn't look like my output if I give it the wrong location for test.pp, but I am using Puppet 2.6.1 and can't help you with any other version. Run "puppet help" ? On Sep 30, 4:03 pm, "D.N. van der Meijden" <cybernijn...@gmail.com> wrote: > No problem Luke, thanks for helping me out here. > Since I'm still a puppet n00b, where should I place the test.pp? On > the host I presume (I tried /etc/puppet/manifests/test.pp) ? > > test.pp: > class test { > service { "rsyslog": > name => "rsyslog", > enable => true, > ensure => running, > hasstatus => true, > subscribe => File["/etc/rsyslog.conf"], > } > > } > > If I start the command on the client, I get some weird output: > > client:/etc/init.d# puppet apply --verbose --debug --trace --summarize > test.pp > /usr/lib/ruby/1.8/puppet/parser/parser_support.rb:95:in `file=' > /usr/lib/ruby/1.8/puppet/parser/interpreter.rb:69:in `create_parser' > /usr/lib/ruby/1.8/puppet/parser/interpreter.rb:54:in `parser' > /usr/lib/ruby/1.8/puppet/parser/interpreter.rb:27:in `compile' > /usr/lib/ruby/1.8/puppet/indirector/catalog/compiler.rb:68:in > `compile' > /usr/lib/ruby/1.8/puppet/util.rb:217:in `benchmark' > /usr/lib/ruby/1.8/puppet/indirector/catalog/compiler.rb:66:in > `compile' > /usr/lib/ruby/1.8/puppet/indirector/catalog/compiler.rb:21:in `find' > /usr/lib/ruby/1.8/puppet/indirector/indirection.rb:210:in `find' > /usr/lib/ruby/1.8/puppet/indirector.rb:49:in `find' > /usr/bin/puppet:210 > Could not parse for environment production: Could not find file /etc/ > init.d/apply.pp > > On 30 sep, 16:45, "luke.bigum" <luke.bi...@fasthosts.co.uk> wrote: > > > My apologies, I thought you were saying it starts but were unaware of > > the exit code. > > > I'm now unsure... You could try run this: > > > puppet apply --verbose --debug --trace --summarize test.pp > > > where test.pp is the simplest form of your service as possible, and > > see if you get anything useful, although I've just done that on a > > CentOS system and it wasn't as helpful as I imagined (didn't blatantly > > tell me the exit code as I hoped). > > > On Sep 30, 3:33 pm, "D.N. van der Meijden" <cybernijn...@gmail.com> > > wrote: > > > > Hi Luke, > > > > As mentioned it works manually: > > > > 'client:~# /etc/init.d/zabbix_agent start ; echo $? > > > Starting Zabbix agent: zabbix_agentd > > > 0 > > > > By the way, this specific client is a lenny 5.05 > > > > On 30 sep, 16:28, "luke.bigum" <luke.bi...@fasthosts.co.uk> wrote: > > > > > As Nigel indicated, the exit code for your init script is not what > > > > puppet expects, it is not a file permission problem. > > > > > As Nigel suggested, shut down your service then run this: > > > > > /etc/init.d/zabbix_agent start ; echo $? > > > > > And tell us what number is printed on the screen. If it prints 1, that > > > > would explain your Puppet error message. Not sure what operating > > > > system you use, but init scripts SHOULD return 0 when they run > > > > successfully. If your init script is returning 1 on success, it's > > > > broken. > > > > > -Luke > > > > > On Sep 30, 3:04 pm, "D.N. van der Meijden" <cybernijn...@gmail.com> > > > > wrote: > > > > > > Thanks for the quick reply Nigel. > > > > > I understand that the puppet is reporting back the exit status, but > > > > > what I don't understand is why it keeps failing when trying to start > > > > > via puppet. > > > > > All files are available on the client, permissions are ok and starting > > > > > the daemon manually works without problems. > > > > > > On 30 sep, 15:57, Nigel Kersten <nig...@google.com> wrote: > > > > > > > On Thu, Sep 30, 2010 at 6:42 AM, D.N. van der Meijden > > > > > > > <cybernijn...@gmail.com> wrote: > > > > > > > I'm trying to get a service running, but I keep getting the > > > > > > > following > > > > > > > error message: > > > > > > > "err: //Node[debiannode]/zabbix/Service[zabbix_agent]/ensure: > > > > > > > change > > > > > > > from stopped to running failed: Could not start > > > > > > > Service[zabbix_agent]: > > > > > > > Execution of '/etc/init.d/zabbix_agent start' returned 1: at > > > > > > > /etc/ > > > > > > > puppet/modules/zabbix/manifests/init.pp:62" > > > > > > > > The part of the init.pp script: > > > > > > > service { "zabbix_agent": > > > > > > > name => "zabbix_agent", > > > > > > > enable => true, > > > > > > > ensure => running, > > > > > > > hasstatus => true, > > > > > > > subscribe => File["zabbix_agentd.conf"], > > > > > > > require => [ File["/etc/zabbix"], > > > > > > > File["zabbix_agentd.conf"] ], > > > > > > > } # <-- line 62 > > > > > > > > If I start the daemon manually [as root or normal user zabbix] > > > > > > > (i.e. / > > > > > > > etc/init.d/zabbix_agent start), it works. > > > > > > > I checked the permissions, but these are set at 755 so that > > > > > > > shouldn't > > > > > > > be a problem. > > > > > > > > client:~# /etc/init.d/zabbix_agent start > > > > > > > Starting Zabbix agent: zabbix_agentd > > > > > > > client:~# ps -ef | grep zabbix > > > > > > > zabbix 2116 1 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > zabbix 2117 2116 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > zabbix 2118 2116 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > zabbix 2119 2116 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > zabbix 2120 2116 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > zabbix 2121 2116 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > zabbix 2122 2116 0 15:37 ? 00:00:00 /etc/zabbix/sbin/ > > > > > > > zabbix_agentd > > > > > > > root 2124 1890 0 15:37 pts/2 00:00:00 grep zabbix > > > > > > > > What am I missing here? > > > > > > > The exit status of starting the daemon, which is what Puppet is > > > > > > reporting back to you. > > > > > > > /etc/init.d/zabbix_agent start ; echo $? > > > > > > > It sounds like puppet is actually starting it but thinking the > > > > > > operation failed because the init script exits non-zero. > > > > > > > > -- > > > > > > > You received this message because you are subscribed to the > > > > > > > Google Groups "Puppet Users" group. > > > > > > > To post to this group, send email to > > > > > > > puppet-us...@googlegroups.com. > > > > > > > To unsubscribe from this group, send email to > > > > > > > puppet-users+unsubscr...@googlegroups.com. > > > > > > > For more options, visit this group > > > > > > > athttp://groups.google.com/group/puppet-users?hl=en. > > > > > > > -- > > > > > > nigel- Tekst uit oorspronkelijk bericht niet weergeven - > > > > > > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit > > > > > > oorspronkelijk bericht niet weergeven - > > > > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit > > > > oorspronkelijk bericht niet weergeven - > > > - Tekst uit oorspronkelijk bericht weergeven - -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.