Chef-Solo Tomcat7 Cookbook安装期间的SSL错误 [英] SSL Error during Chef-Solo Tomcat7 Cookbook Installation
本文介绍了Chef-Solo Tomcat7 Cookbook安装期间的SSL错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在安装 Tomcat 7食谱时发生错误. 在Chef-Solo中执行时,出现此错误. openssl已正确安装.
An error occurred during the installation of Tomcat 7 Cookbook. While executing in Chef-Solo, this error appeared. The openssl is correctly installed.
* execute[Create Tomcat SSL certificate] action run
================================================================================
Error executing action `run` on resource 'execute[Create Tomcat SSL certificate]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '127'
---- Begin output of /usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore "/etc/tomcat7/keystore.jks" -storepass "AWpbettrAMoVK4orJOdi" -keypass "AWpbettrAMoVK4orJOdi" -dname "cn=localhost" ----
STDOUT:
STDERR: sh: 1: /usr/lib/jvm/default-java/bin/keytool: not found
---- End output of /usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore "/etc/tomcat7/keystore.jks" -storepass "AWpbettrAMoVK4orJOdi" -keypass "AWpbettrAMoVK4orJOdi" -dname "cn=localhost" ----
Ran /usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore "/etc/tomcat7/keystore.jks" -storepass "AWpbettrAMoVK4orJOdi" -keypass "AWpbettrAMoVK4orJOdi" -dname "cn=localhost" returned 127
Resource Declaration:
---------------------
# In /root/.chef/chef-repo/cookbooks/tomcat/recipes/default.rb
181: execute "Create Tomcat SSL certificate" do
182: group node['tomcat']['group']
183: command "#{node['tomcat']['keytool']} -genkeypair -keystore \"#{node['tomcat']['config_dir']}/#{node['tomcat']['keystore_file']}\" -storepass \"#{node['tomcat']['keystore_password']}\" -keypass \"#{node['tomcat']['keystore_password']}\" -dname \"#{node['tomcat']['certificate_dn']}\""
184: umask 0007
185: creates "#{node['tomcat']['config_dir']}/#{node['tomcat']['keystore_file']}"
186: action :run
187: notifies :restart, "service[tomcat]"
188: end
189: end
Compiled Resource:
------------------
# Declared in /root/.chef/chef-repo/cookbooks/tomcat/recipes/default.rb:181:in `from_file'
execute("Create Tomcat SSL certificate") do
action [:run]
retries 0
retry_delay 2
command "/usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore \"/etc/tomcat7/keystore.jks\" -storepass \"AWpbettrAMoVK4orJOdi\" -keypass \"AWpbettrAMoVK4orJOdi\" -dname \"cn=localhost\""
backup 5
creates "/etc/tomcat7/keystore.jks"
group "tomcat7"
returns 0
umask 7
cookbook_name :tomcat
recipe_name "default"
end
* service[tomcat] action restart
- restart service service[tomcat]
[2014-02-04T10:42:24-02:00] ERROR: Running exception handlers
[2014-02-04T10:42:24-02:00] ERROR: Exception handlers complete
Chef Client failed. 5 resources updated
[2014-02-04T10:42:24-02:00] FATAL: Stacktrace dumped to /opt/chef-solo/chef-stacktrace.out
[2014-02-04T10:42:24-02:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[Create Tomcat SSL certificate] (tomcat::default line 181) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127'
---- Begin output of /usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore "/etc/tomcat7/keystore.jks" -storepass "AWpbettrAMoVK4orJOdi" -keypass "AWpbettrAMoVK4orJOdi" -dname "cn=localhost" ----
STDOUT:
STDERR: sh: 1: /usr/lib/jvm/default-java/bin/keytool: not found
---- End output of /usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore "/etc/tomcat7/keystore.jks" -storepass "AWpbettrAMoVK4orJOdi" -keypass "AWpbettrAMoVK4orJOdi" -dname "cn=localhost" ----
Ran /usr/lib/jvm/default-java/bin/keytool -genkeypair -keystore "/etc/tomcat7/keystore.jks" -storepass "AWpbettrAMoVK4orJOdi" -keypass "AWpbettrAMoVK4orJOdi" -dname "cn=localhost" returned 127
如果有人有解决此问题的想法,请回答:)
If somebody have a idea for resolve this, pls, answer :)
推荐答案
This is a known tomcat cookbook issue: COOK-4097
您可以通过为keytool可执行文件分配正确的路径来解决此问题:
You can work-around this problem by assigning the correct path to the keytool executable:
override["tomcat"]["keytool"] = "/usr/bin/keytool"
我有一个工作示例,请检查食谱的属性部分:
I have a working example, check the attributes section of the cookbook:
这篇关于Chef-Solo Tomcat7 Cookbook安装期间的SSL错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文