Adam Scarborough
2013-Sep-05 17:50 UTC
[Puppet Users] Odd behaviour trying to specify restart command for service on windows
Hi i''m having a strange issue and was wondering if anyone could help I have the following resource defined for a windows service: service{''Tomcat7'': ensure => running, restart => ''c:/windows/system32/cmd.exe /c c:/Tomcat7/bin/RestartService.bat'' } in this case both ''c:/windows/system32/cmd.exe and c:/Tomcat7/bin/RestartService.bat exist however when running something which notifies this service to restart i receive the following: Notice: /Stage[main]/Dep7selfedit/File[c:\tomcat7\webapps\esign.war]/ensure: defined content as ''{md5}7b024320ab00c33d189a9fac6217bbea'' Info: /Stage[main]/Dep7selfedit/File[c:\tomcat7\webapps\esign.war]: Scheduling refresh of Service[Tomcat7] Debug: /Stage[main]/Dep7selfedit/File[c:\tomcat7\webapps\esign.war]: The container Class[Dep7selfedit] will propagate my refresh event Debug: /Schedule[never]: Skipping device resources because running on a host Debug: /Schedule[weekly]: Skipping device resources because running on a host Debug: /Schedule[puppet]: Skipping device resources because running on a host Debug: Class[Dep7selfedit]: The container Stage[main] will propagate my refreshevent Debug: Service[Tomcat7](provider=windows): Service Tomcat7 is running Debug: Service[Tomcat7](provider=windows): Service Tomcat7 is running Debug: Executing ''c:/windows/system32/cmd.exe /c c:/Tomcat7/bin/RestartService.bat'' Error: /Stage[main]/Dep7transcription/Service[Tomcat7]: Failed to call refresh:CreateProcess() failed: The system cannot find the file specified. Error: /Stage[main]/Dep7transcription/Service[Tomcat7]: CreateProcess() failed:The system cannot find the file specified. I am somewhat befuddled as to why this is. Any help would be much appreciated Thanks Adam -- 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+unsubscribe@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. For more options, visit https://groups.google.com/groups/opt_out.
Rob Reynolds
2013-Sep-09 14:59 UTC
Re: [Puppet Users] Odd behaviour trying to specify restart command for service on windows
Try this restart => ''c:/windows/system32/cmd.exe /c c:\Tomcat7\bin\RestartService. bat'' cmd.exe may not know how to find items with a path that contains forward slashes. On Thu, Sep 5, 2013 at 12:50 PM, Adam Scarborough <scarby2@gmail.com> wrote:> Hi > > i''m having a strange issue and was wondering if anyone could help > > I have the following resource defined for a windows service: > > > service{''Tomcat7'': > ensure => running, > restart => ''c:/windows/system32/cmd.exe /c > c:/Tomcat7/bin/RestartService.bat'' > } > > in this case both ''c:/windows/system32/cmd.exe and > c:/Tomcat7/bin/RestartService.bat exist > > however when running something which notifies this service to restart i > receive the following: > > Notice: > /Stage[main]/Dep7selfedit/File[c:\tomcat7\webapps\esign.war]/ensure: > defined content as ''{md5}7b024320ab00c33d189a9fac6217bbea'' > Info: /Stage[main]/Dep7selfedit/File[c:\tomcat7\webapps\esign.war]: > Scheduling refresh of Service[Tomcat7] > Debug: /Stage[main]/Dep7selfedit/File[c:\tomcat7\webapps\esign.war]: The > container Class[Dep7selfedit] will propagate my refresh event > Debug: /Schedule[never]: Skipping device resources because running on a > host > Debug: /Schedule[weekly]: Skipping device resources because running on a > host > Debug: /Schedule[puppet]: Skipping device resources because running on a > host > Debug: Class[Dep7selfedit]: The container Stage[main] will propagate my > refreshevent > Debug: Service[Tomcat7](provider=windows): Service Tomcat7 is running > Debug: Service[Tomcat7](provider=windows): Service Tomcat7 is running > Debug: Executing ''c:/windows/system32/cmd.exe /c > c:/Tomcat7/bin/RestartService.bat'' > Error: /Stage[main]/Dep7transcription/Service[Tomcat7]: Failed to call > refresh:CreateProcess() failed: The system cannot find the file specified. > Error: /Stage[main]/Dep7transcription/Service[Tomcat7]: CreateProcess() > failed:The system cannot find the file specified. > > I am somewhat befuddled as to why this is. Any help would be much > appreciated > > Thanks > > Adam > > -- > 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+unsubscribe@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. > For more options, visit https://groups.google.com/groups/opt_out. >-- Rob Reynolds Developer, Puppet Labs Join us at PuppetConf 2014, September 23-24 in San Francisco -- 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+unsubscribe@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. For more options, visit https://groups.google.com/groups/opt_out.