- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试通过执行 memcached Chef 配方来自动化 aws ec2 memcached 实例引导。我从云形成 UserData 部分调用 shell 脚本名称cache-init.sh。我的 shell 脚本中有以下步骤:
我正在运行 AMI RHEL 6.7 版本
!/bin/bash
init () {
BINARIES=/root/.binaries
PROFILE_SCRIPT=/etc/profile.d/instance_profile.sh
APPLICATION_RELEASE_VERSION="app-v3.0.1"
CHEF_ZIP="app-chef-${APPLICATION_RELEASE_VERSION}.zip"
APP_FILES="${CHEF_ZIP}"
HOME=/root
}
# Initializing the script vairables.
init
# Create chef folders
mkdir /root/.chef;
mkdir /root/.metadata;
# Disable rhui-lb plugin, this has an issue in RHEL within VPC
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/rhui-lb.conf
# Print all environment varialbes in log
set > /root/.metadata/metadata.txt
# Update ${PROFILE_SCRIPT}
echo "export HOME=${HOME}" >> ${PROFILE_SCRIPT};
chmod 644 ${PROFILE_SCRIPT};
log 'Added ${PROFILE_SCRIPT}';
echo ${HOME}
# Install chef
# Set these just for Chef installation
/usr/bin/curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v 11.16.2-1;
chef_version=`chef-solo --version`;
log "Installed Chef Version : $chef_version in /opt/chef " ;
log "Installing ChefDk"
/usr/bin/curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -c current -P chefdk
chef-repo=/root/.chef/chef-repo
memcached_cookbook=${chef-repo}/cookbooks/memcached
cd ${memcached_cookbook}
# download and package the dependencies.
chef exec berks install
chef exec berks vendor
log "memcached dependencies downloaded and packaged"
cp -r berks-cookbooks/runit /root/.chef/itduzzit/cookbooks
cp -r berks-cookbooks/yum /root/.chef/itduzzit/cookbooks
cp -r berks-cookbooks/yum-epel /root/.chef/itduzzit/cookbooks
cp -r berks-cookbooks/packagecloud /root/.chef/itduzzit/cookbooks
# Clean up the dependencies.
rm -rf berks-cookbooks
执行berks install命令后,出现以下错误:
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rb-readline-0.5.3/lib/rbreadline.rb:1097:in <module:RbReadline>: HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory (RuntimeError)
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/rb-readline- 0.5.3/lib/rbreadline.rb:17:in <top (required)>
from ...
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/berkshelf-4.3.2/bin/berks:3:in `<top (required)>'
from /usr/bin/berks:49:in `load'
from /usr/bin/berks:49:in `<main>'
我尝试通过在cache-init.sh脚本开头导出它来设置HOME环境变量,但仍然遇到相同的错误。当我 ssh 到盒子并手动运行脚本时,它工作正常。我尝试寻找错误,但没有找到合适的修复方法。非常感谢这里的任何帮助。
最佳答案
在 init 下,应该是 export HOME=...
(对于其他所有内容都相同。如果没有 export
,您将创建一个 bash 变量,而不是一个环境变量。
关于amazon-web-services - Chef : HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36560160/
当我使用 Html.ActionLink 时,我发现 @Html.ActionLink("Home", "Index", "home")生成此字符串 Home ,那么为什么地址是\home\index
我有一个现有的 webapi 2 应用程序需要添加基本的前端。现有的 webapi Controller 已在名为 xController yController 的 Controllers 目录根目
我家里有一个应用程序小部件,它会定期更新。如果 HOME 不可见,我想停止更新。我使用一项服务来注册屏幕开/关接收器,以便在屏幕开/关时开始/停止更新应用程序小部件。但我不知道如何检测屏幕是否打开但用
我在使用 create-react-app 时遇到了这个问题,我得到了一个错误: Home does not contain an export named Home. 下面是我如何设置我的 App.
最近我不得不在 .bashrc 中更新我的 JAVA 环境变量 echo $JAVA_HOME # prints out /usr/java/... echo $(JAVA_HOME) # raise
$ cat Makefile all: echo VAR is ${HOME} echo VAR is $${HOME} 给予 $ make echo VAR is /home/abc
我尝试在 google home 模拟器中测试我的项目。直到昨天它还在工作,但今天它显示错误“完成您的请求时出错”网址:“https://console.actions.google.com/proj
我已经实现了具有 OnOff 特性的风扇打开/关闭功能和具有 Fanspeed 特性的风扇模式(“高”、“中”、“低”),现在我想实现百分比 Controller 。例如:将风扇速度设置为 50%。我
我制作了一个小型 Google Home 应用程序,我的服务通过 SimpleMessage + Card 返回响应。 在 console.actions.google.com 模拟器中运行应用程序时
我还在用log4j-1.2.14.jar 在我尝试使用的属性中 log4j.appender.R=org.apache.log4j.DailyRollingFileAppender log4j.app
我正在使用 google smarthome actions for IOT...我更新了我的操作 URL 和帐户链接详细信息。当我尝试在模拟器中启用测试以将我的 TestAPP 部署到云时,它失败并
我在使用 Spring Boot 时遇到了一些问题。 当我使用 @RequestMapping(value = "/home") 时,一切正常。但是当我使用 @RequestMapping(name
起初,文件图标在我的 Ubuntu 20.04 中丢失。后来我运行 sudo root ,但是点击桌面上的图标打开文件还是有些麻烦。现在我运行 sudo nautilus ,我看到 Home 是/ro
我想在 ionic 中制作一个应用程序,所以我通过命令在 ionic 中添加了一些自定义页面: ionic g 页面用户 但是我启动 ionic 服务器它显示错误 Runtime Error Cann
非常感谢您的帮助。 标题说明一切:使用有什么区别: echo `basename $HOME` 和 echo $(basename $HOME) 请注意,我知道 basename 命令的作用,两种语法
在 Rust 中,默认情况下,文件放在 $HOME/.cargo 和 $HOME/.rustup 中。有什么方法可以覆盖这些默认值吗? 我正在尝试调试一个模糊的问题,我想尝试更改文件位置。 最佳答案
我正在尝试以 root 身份备份机器的一些关键文件和目录,包括一些/home 数据,手动挑选一些文件以减小 tarball 大小。大多数情况下一切正常,因为大多数文件无论如何都归 root 所有,但说
如果菜单项是链接,屏幕阅读器应该将其读作“主页、链接、菜单项”还是“主页、菜单项”? 目前,屏幕阅读器将它读作“主页、链接、菜单项”,但我得到的是关于它的混合信息。一些信息说它应该是“主页、链接、菜单
我在一个有多个组织的项目上使用 php codeigniter。每个组织都会有自己的网站,我需要根据组织名称将每个用户重定向到其组织网站。 我得到了部分运行。以本地主机为例: localhost/ap
我正在 Mac OS X 上安装 Ruby on Rails。我遵循的教程说要添加: [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/script
我是一名优秀的程序员,十分优秀!