我试图在Elastic Beanstalk上安装GhostScript 9.10,因为目前只有Ghostscript 8.70可以通过yum包获得。
安装在EC2实例上通过SSH工作,但配置文件总是失败,我不明白原因。
这是我的.ebextensions配置文件:
commands:
01_admin_rights:
command: "sudo su"
02_get_gs:
command: "curl -O http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-9.10.tar.gz"
03_extract_gs:
command: "tar -xzf ghostscript-9.10.tar.gz"
04_cd_gs:
command: "cd ghostscript-9.10"
05_configure_gs:
command: "bash configure"
06_install_gs:
command: "make install"
07_so_gs:
command: "make so"
08_reboot:
command: "reboot"
这里是弹性beanstalk错误日志部分:
[2016-06-21T12:22:52.720Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 01_admin_rights] : Starting activity...
[2016-06-21T12:22:52.757Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 01_admin_rights] : Completed activity.
[2016-06-21T12:22:52.757Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 02_get_gs] : Starting activity...
[2016-06-21T12:22:53.524Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 02_get_gs] : Completed activity. Result:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 33.6M 100 33.6M 0 0 49.2M 0 --:--:-- --:--:-- --:--:-- 49.2M
[2016-06-21T12:22:53.524Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 03_extract_gs] : Starting activity...
[2016-06-21T12:22:55.066Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 03_extract_gs] : Completed activity.
[2016-06-21T12:22:55.066Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 04_cd_gs] : Starting activity...
[2016-06-21T12:22:55.069Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 04_cd_gs] : Completed activity.
[2016-06-21T12:22:55.070Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 05_configure_gs] : Starting activity...
[2016-06-21T12:22:55.073Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 05_configure_gs] : Activity execution failed, because: bash: configure: No such file or directory
(ElasticBeanstalk::ExternalInvocationError)
[2016-06-21T12:22:55.073Z] INFO [24703] - [Application update Come on #15@25/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild/prebuild_2__Staging/Command 05_configure_gs] : Activity failed.
我理解命令5失败,因为文件不存在。但是,当我通过SSH手动执行这些步骤时,文件仍然存在,并且所有命令都可以按此顺序执行。
我想念什么?
编辑: 我玩了configure参数并尝试了:
/ bin / bash:./ configure
./配置
bash ./configure
所有参数都失败并出现相同的错误"没有这样的文件或目录。" 如果我通过SSH连接并输入其中一个配置命令,那么它可以正常工作。
有谁知道这里发生了什么?
答案 0 :(得分:0)
我认为这可能是因为单独的命令不会使环境或当前目录保持一致。您的一个命令是cd
,但我不认为更改的目录会持续到下一个命令。尝试将所有命令合并为一个,如下所示:
command: |
cd directory
./configure
此外,ebextensions以root身份运行,因此您可能不需要sudo su
开头。