【问题标题】:Beanstalk: ebextensions customization fails with service: command not foundBeanstalk:ebextensions 定制因服务失败:找不到命令
【发布时间】:2023-03-27 05:04:01
【问题描述】:

我正在尝试通过我的 elasticbeanstalk 堆栈中的 .ebextensions 安装应用程序。我在这里关注了advanced environment customization 的文档。这是我的配置:

files:
  "/tmp/software.sh" :
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/bin/bash
      wget https://website.net/software/software-LATEST-1.x86_64.rpm
      software-LATEST-1.x86_64.rpm
      sed -i -e '$a\
      *.* @@127.0.0.1:1514;RSYSLOG_FileFormat' /etc/rsyslog.conf
      /sbin/service rsyslog restart
      /sbin/service software start
container_commands:
  01_run:
    command: "/tmp/software.sh"

应用配置时,即使我指向 /sbin/service.我尝试了很多不同的东西,但我总是得到这个错误。在主机上手动运行脚本没有任何问题。

堆栈使用的映像是 Amazon Linux release 2 (Karoo)

具体报错信息为:

[3744211/3744211]\n\n/tmp/[01;31m[Kalert[m[K_software.sh: line 8: service: command not found\n/tmp/[01;31m[Kalert[m[K_software.sh: line 9: service: command not found. \ncontainer_command 02_run in .eb[01;31m[Kextensions[m[K/[01;31m[Kalert[m[K-software.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":127,"events":

【问题讨论】:

    标签: amazon-web-services amazon-elastic-beanstalk


    【解决方案1】:

    我的同事尝试以不同的方式安装该软件,并且成功了。这是有效的:

    安装.config >>

      01_install_software:
        command: rpm -qa | grep -qw software || yum -y -q install https://website.net/software/software-LATEST-1.x86_64.rpm
      02_update_rsyslog:
        command: sed -i -e '$a*.* @@127.0.0.1:1514;RSYSLOG_FileFormat' -e '/*.* @@127.0.0.1:1514;RSYSLOG_FileFormat/d' /etc/rsyslog.conf
      03_restart_rsyslog:
        command: service rsyslog restart
    

    services.config >>

    services:
      sysvinit:
        rsyslog:
          enabled: "true"
          ensureRunning: "true"
        software:
          enabled: "true"
          ensureRunning: "true"
    

    【讨论】:

      猜你喜欢
      • 2020-11-15
      • 1970-01-01
      • 2014-01-09
      • 2015-12-01
      • 2010-11-09
      • 1970-01-01
      • 2019-11-07
      • 2022-12-04
      相关资源
      最近更新 更多