2014-02-21 43 views
1

我使用廚師來配置一個CentOS機除了使用廚師執行「chkconfig --add tomcat」時發生錯誤?

execute "chkconfig add tomcat" do 
    command "chkconfig --add tomcat" 
end 

execute "chkconfig tomcat level" do 
    command "chkconfig --level 234 tomcat on" 
end 

這使這個錯誤一切都安裝好....

Mixlib::ShellOut::ShellCommandFailed 
------------------------------------ 
Expected process to exit with [0], but received '1' 
---- Begin output of chkconfig --add tomcat ---- 
STDOUT: 
STDERR: error reading information on service tomcat: No such file or directory 
---- End output of sudo chkconfig --add tomcat ---- 
Ran chkconfig --add tomcat returned 1 
+0

'tomcat'不在你的'$ PATH'中...... – sethvargo

回答

1

你結婚了使用chkconfig?有一個service資源應該爲你照顧這個。

Chef :: Provider :: Service :: Init :: Redhat服務與Red Hat和CentOS平臺一起使用的提供程序。

1
service "tomcat" do 
    supports :status => true, :restart => true, :reload => true 
    action [ :enable, :start ] 
end