【发布时间】:2017-08-06 04:05:43
【问题描述】:
我正在尝试创建一个使用 jar 运行 java 的 Windows 服务。
创建服务的资源是:
service_name="Service"
service_file="C:\\chef_solo\\utils\\service-17.jar"
java_exe="#{java_home_win}\\bin\\java.exe"
binPath="#{java_exe} -jar #{service_file} "
execute "Installing #{service_name}" do
command "sc create \"#{service_name}\" binPath= \"#{binPath}\" obj= \".\\#{gst_user}\" password= \"#{gst_pwd}\" start= auto displayname= \"GS Translation Service\""
action :nothing
end
服务已创建,但在运行时,我收到一条错误消息:
Windows could not start the Service service on 192.168.0.10. Error 1053: The service did not respond to the start or control request in a timely fashion.
我猜这是因为当我手动运行它时,大约需要 45 秒才能启动服务并打开端口。 我怎样才能让它等待?或者还有什么我不明白的问题?
谢谢。
加布里埃尔
【问题讨论】:
标签: java windows chef-infra