简体   繁体   English

在 aws elastic beanstalk 上设置 linux 服务

[英]Setting up linux services on aws elastic beanstalk

I would like to restart php-fpm and apache on my Amazon Linux 1 instances deployed via elastic beanstalk.我想在通过弹性 beantalk 部署的 Amazon Linux 1 实例上重启 php-fpm 和 apache。 I'm using a load balanced environment and want to automate the entire deploy process.我正在使用负载平衡环境并希望自动化整个部署过程。

Does anybody have any additional information on this post from aws ?有人从 aws 获得关于这篇文章的任何其他信息吗?

I'm simple trying to use a yaml file too restart these services (gracefully) after each deploy.我很简单地尝试使用 yaml 文件,在每次部署后(优雅地)重新启动这些服务。

example:例子:

services: 
  sysvinit:
    myservice:
      enabled: true
      ensureRunning: true
      commands: 
        - "command name used as trigger"

I'm really not sure what is acceptable input for the "myservices" section.我真的不确定“myservices”部分可接受的输入是什么。 Any help is appricated.任何帮助都是适用的。

Thanks!谢谢!

I haven't verified the following, but my understanding is as follows.以下我没有验证过,但我的理解如下。 Since you have to restart php-fpm and apache services your service section could be:由于您必须重新启动php-fpmapache服务,因此您的服务部分可能是:

services: 
  sysvinit:
    php-fpm:
      enabled: true
      ensureRunning: true
      commands: 
        - 01_some_command_name
    apache:
      enabled: true
      ensureRunning: true
      commands: 
        - 02_some_other_command_name

The 01_some_command_name and 02_some_other_command_name are names of commands in commands section. 01_some_command_name02_some_other_command_name命令部分中的命令名称。 For example:例如:

commands:
  01_some_command_name: 
    command: echo "execute command 01"
  02_some_other_command_name: 
    command: echo "execute command 02"

Execution of the two commands, should trigger in my view the restart of the php-fpm and apache services.执行这两个命令,在我看来应该会触发php-fpmapache服务的重启。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM