Dan McManus
2012-Jul-24 23:00 UTC
[Puppet Users] can''t get custom restart to work on a windows service
Hi! I am encountering something that I am not sure is a bug or not, so I thought I''d post a question. Running Puppet 2.7.18 on Windows 2003. Basically, what I want to do is manage nsclient++ on windows. I am able to manage the files just fine, but restarting doesn''t work because of bug 13489<http://projects.puppetlabs.com/issues/13489>. So I thought I might circumvent it thusly: service { "NSClientpp": ensure => running, restart => ''c:/program files/nsclient++/scripts/restart.bat'', subscribe => File["c:/program files/nsclient++/nsc.ini"], } and restart.bat is very simple: sc stop nsclientpp perl -e "sleep 10" sc start nsclientpp echo ran >> c:\restart.txt it has world read and execute permissions, so it should run, but restart.txt doesn''t get created and the service still won''t start on its own. My question is whether I am doing something wrong or is this is a bug? Thanks Dan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/N7gK-LpAp3UJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Josh Cooper
2012-Jul-25 17:24 UTC
Re: [Puppet Users] can''t get custom restart to work on a windows service
Hi Dan, On Tue, Jul 24, 2012 at 4:00 PM, Dan McManus <mothbitten1@gmail.com> wrote:> > Basically, what I want to do is manage nsclient++ on windows. I am able to manage the files just fine, but restarting doesn''t work because of bug 13489.I''d recommend trying out the latest version of puppet 2.7.x, directly from github. You should just need to patch `lib/puppet/provider/service/windows.rb`. Normally, I''d point you to our nightly builds, but the windows jobs haven''t been running lately due to some infrastructure reorganization. I''ll sort that out next week.> So I thought I might circumvent it thusly: > > > service { "NSClientpp": > ensure => running, > restart => ''c:/program files/nsclient++/scripts/restart.bat'', > subscribe => File["c:/program files/nsclient++/nsc.ini"], > } > > and restart.bat is very simple: > > sc stop nsclientpp > perl -e "sleep 10" > sc start nsclientpp > echo ran >> c:\restart.txt > > it has world read and execute permissions, so it should run, but restart.txt doesn''t get created and the service still won''t start on its own. > > My question is whether I am doing something wrong or is this is a bug?The windows service provider doesn''t currently support overriding the `restart` method. We should either call that out in the provider documentation or add the ability to override it. I''ve filed this as https://projects.puppetlabs.com/issues/15693 Josh -- Josh Cooper Developer, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Dan McManus
2012-Jul-26 17:52 UTC
[Puppet Users] Re: can''t get custom restart to work on a windows service
I modified the windows.rb and it seems to work well now. Many thanks! Dan On Tuesday, July 24, 2012 5:00:09 PM UTC-6, Dan McManus wrote:> > Hi! > > I am encountering something that I am not sure is a bug or not, so I > thought I''d post a question. > > Running Puppet 2.7.18 on Windows 2003. > > Basically, what I want to do is manage nsclient++ on windows. I am able to > manage the files just fine, but restarting doesn''t work because of bug > 13489 <http://projects.puppetlabs.com/issues/13489>. So I thought I might > circumvent it thusly: > > > service { "NSClientpp": > ensure => running, > restart => ''c:/program files/nsclient++/scripts/restart.bat'', > subscribe => File["c:/program files/nsclient++/nsc.ini"], > } > > and restart.bat is very simple: > > sc stop nsclientpp > perl -e "sleep 10" > sc start nsclientpp > echo ran >> c:\restart.txt > > it has world read and execute permissions, so it should run, but > restart.txt doesn''t get created and the service still won''t start on its > own. > > My question is whether I am doing something wrong or is this is a bug? > > Thanks > > Dan > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/FkklIRSsF64J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Josh Cooper
2012-Jul-27 17:13 UTC
Re: [Puppet Users] Re: can''t get custom restart to work on a windows service
Hi Dan, Great to hear. This issue will be fixed in puppet 2.7.19, which should enter rc next week. Josh On Thu, Jul 26, 2012 at 10:52 AM, Dan McManus <mothbitten1@gmail.com> wrote:> I modified the windows.rb and it seems to work well now. Many thanks! > > Dan > > > On Tuesday, July 24, 2012 5:00:09 PM UTC-6, Dan McManus wrote: >> >> Hi! >> >> I am encountering something that I am not sure is a bug or not, so I >> thought I''d post a question. >> >> Running Puppet 2.7.18 on Windows 2003. >> >> Basically, what I want to do is manage nsclient++ on windows. I am able to >> manage the files just fine, but restarting doesn''t work because of bug >> 13489. So I thought I might circumvent it thusly: >> >> >> service { "NSClientpp": >> ensure => running, >> restart => ''c:/program files/nsclient++/scripts/restart.bat'', >> subscribe => File["c:/program files/nsclient++/nsc.ini"], >> } >> >> and restart.bat is very simple: >> >> sc stop nsclientpp >> perl -e "sleep 10" >> sc start nsclientpp >> echo ran >> c:\restart.txt >> >> it has world read and execute permissions, so it should run, but >> restart.txt doesn''t get created and the service still won''t start on its >> own. >> >> My question is whether I am doing something wrong or is this is a bug? >> >> Thanks >> >> Dan >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/FkklIRSsF64J. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- Josh Cooper Developer, Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.