Hi I am still new to puppet and we want see if we can get puppet to stop and start our custom software. The init script leaves much to be desired and I don''t think it is possible to get puppet to start the service using a simple service type. The service does not create a pid, does not return a status or start a process that has the same name as the service. All the service does is bootstrap a bunch of other code. I tried a number of variations on the below - fyi I can manually start the process using a simple "sudo /sbin/service env_3-2 start" as root service { env_3-2: provider => init, ensure => true, binary => "/etc/rc.d/init.d/env_3-2 start", } this is the error i get using the above type Tue Feb 19 10:22:52 EST 2008 /:main/Node[atl01app101]/env32_start/Service[env_3-2]/ensure (err): change from stopped to running failed: Could not start Service[env_3-2]: Execution of ''/etc/init.d/env_3-2 start'' returned 256: at /etc/puppet/manifests/classes/env32_start.pp:10 What does "returned 256" mean? Now I am working on using conditionals to invoke an exec command to simply start our software - i am still a little confused about how conditionals work in puppet - can I used if/then? i can only find a reference to using if/else. If anyone has any ideas I would much appreciate input since I am a little lost right now. Thanks Ed _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On 19/02/2008, Edward Bailey <eds.mailing.list.account@gmail.com> wrote:> Hi > > I am still new to puppet and we want see if we can get puppet to stop and > start our custom software. The init script leaves much to be desired and I > don''t think it is possible to get puppet to start the service using a simple > service type. The service does not create a pid, does not return a status or > start a process that has the same name as the service. All the service does > is bootstrap a bunch of other code.I think I would modify the init.d script if it doesn''t return the pid as it''s status. If the service is like iptables in that "status" always is true you could use something like the following where "status =>" is a script that checks if the service is "up or down." service { "iptables": status => "/root/bin/iptables_check.sh", start => "/etc/init.d/iptables start", ensure => running, } <snip> Kent
Edward Bailey
2008-Feb-19 17:20 UTC
Re: need help with starting a custom service in redhat
another basic question - is puppet looking for a value such as "running" "true" or just a number like 1 or 0? Thanks Ed On Feb 19, 2008 11:56 AM, Kenton Brede <kbrede@gmail.com> wrote:> On 19/02/2008, Edward Bailey <eds.mailing.list.account@gmail.com> wrote: > > Hi > > > > I am still new to puppet and we want see if we can get puppet to stop > and > > start our custom software. The init script leaves much to be desired and > I > > don''t think it is possible to get puppet to start the service using a > simple > > service type. The service does not create a pid, does not return a > status or > > start a process that has the same name as the service. All the service > does > > is bootstrap a bunch of other code. > > I think I would modify the init.d script if it doesn''t return the pid > as it''s status. If the service is like iptables in that "status" > always is true you could use something like the following where > "status =>" is a script that checks if the service is "up or down." > > service { "iptables": > status => "/root/bin/iptables_check.sh", > start => "/etc/init.d/iptables start", > ensure => running, > } > > <snip> > Kent > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Arjuna Christensen
2008-Feb-19 21:56 UTC
Re: need help with starting a custom service inredhat
I believe it checks exit codes. The error 256 you mentioned I is the shell interpreter complaining about something - I haven''t been able to dig up what exactly (e.g; 768 = file doesn''t exist, or something) What does ''/etc/init.d/env_3-2 start && echo $?'' yield? You''d be better off to write an LSB[1] conformant init script for your application :P Arjuna Christensen | Systems Engineer Maximum Internet Ltd DDI: + 64 9 913 9683 | Ph: +64 9 915 1825 | Fax:: +64 9 300 7227 arjuna.christensen@maxnet.co.nz| www.maxnet.co.nz --- [1] http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html From: puppet-users-bounces@madstop.com [mailto:puppet-users-bounces@madstop.com] On Behalf Of Edward Bailey Sent: Wednesday, 20 February 2008 6:21 a.m. To: Puppet User Discussion Subject: Re: [Puppet-users] need help with starting a custom service inredhat another basic question - is puppet looking for a value such as "running" "true" or just a number like 1 or 0? Thanks Ed On Feb 19, 2008 11:56 AM, Kenton Brede <kbrede@gmail.com> wrote: On 19/02/2008, Edward Bailey <eds.mailing.list.account@gmail.com> wrote:> Hi > > I am still new to puppet and we want see if we can get puppet to stop and > start our custom software. The init script leaves much to be desired and I > don''t think it is possible to get puppet to start the service using a simple > service type. The service does not create a pid, does not return a status or > start a process that has the same name as the service. All the service does > is bootstrap a bunch of other code.I think I would modify the init.d script if it doesn''t return the pid as it''s status. If the service is like iptables in that "status" always is true you could use something like the following where "status =>" is a script that checks if the service is "up or down." service { "iptables": status => "/root/bin/iptables_check.sh", start => "/etc/init.d/iptables start", ensure => running, } <snip> Kent _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
lol - i agree with you, i hoping our dev team will fix the issues with the start script soon the output you requested is Ok: All apps up and running! 0 The output is also 0 if I run /etc/init.d/env_3-2 stop && echo $? seems like the script returns 0 no matter what On Feb 19, 2008 4:56 PM, Arjuna Christensen <arjuna.christensen@maxnet.co.nz> wrote:> I believe it checks exit codes. > > The error 256 you mentioned I is the shell interpreter complaining about > something - I haven''t been able to dig up what exactly (e.g; 768 = file > doesn''t exist, or something) > > What does ''/etc/init.d/env_3-2 start && echo $?'' yield? > > You''d be better off to write an LSB[1] conformant init script for your > application :P > > Arjuna Christensen | Systems Engineer > Maximum Internet Ltd > DDI: + 64 9 913 9683 | Ph: +64 9 915 1825 | Fax:: +64 9 300 7227 > arjuna.christensen@maxnet.co.nz| www.maxnet.co.nz > > --- > > [1] > http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html > > > From: puppet-users-bounces@madstop.com [mailto: > puppet-users-bounces@madstop.com] On Behalf Of Edward Bailey > Sent: Wednesday, 20 February 2008 6:21 a.m. > To: Puppet User Discussion > Subject: Re: [Puppet-users] need help with starting a custom service > inredhat > > another basic question - is puppet looking for a value such as "running" > "true" or just a number like 1 or 0? > > Thanks > > Ed > On Feb 19, 2008 11:56 AM, Kenton Brede <kbrede@gmail.com> wrote: > On 19/02/2008, Edward Bailey <eds.mailing.list.account@gmail.com> wrote: > > Hi > > > > I am still new to puppet and we want see if we can get puppet to stop > and > > start our custom software. The init script leaves much to be desired and > I > > don''t think it is possible to get puppet to start the service using a > simple > > service type. The service does not create a pid, does not return a > status or > > start a process that has the same name as the service. All the service > does > > is bootstrap a bunch of other code. > I think I would modify the init.d script if it doesn''t return the pid > as it''s status. If the service is like iptables in that "status" > always is true you could use something like the following where > "status =>" is a script that checks if the service is "up or down." > > service { "iptables": > status => "/root/bin/iptables_check.sh", > start => "/etc/init.d/iptables start", > ensure => running, > } > > <snip> > Kent > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Frank Sweetser
2008-Feb-20 02:58 UTC
Re: need help with starting a custom service inredhat
Edward Bailey wrote:> lol - i agree with you, i hoping our dev team will fix the issues with > the start script soon > > the output you requested is > > Ok: All apps up and running! > 0 > > The output is also 0 if I run /etc/init.d/env_3-2 stop && echo $? > > seems like the script returns 0 no matter whatIf you''ve got a chance to give feedback to your dev team, you should probably point them at this standard: http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html This defines what the return codes of the script should be. -- Frank Sweetser fs at wpi.edu | For every problem, there is a solution that WPI Senior Network Engineer | is simple, elegant, and wrong. - HL Mencken GPG fingerprint = 6174 1257 129E 0D21 D8D4 E8A3 8E39 29E3 E2E8 8CEC