laravel监督有错误的Horizo​​n弹性豆茎

时间:2019-03-26 21:11:16

标签: laravel laravel-horizon

我一直在尝试设置地平线以在一个有弹性的beantalk实例中运行,并且看起来可行。

supervisorctl status

为我提供以下输出

horizon                          RUNNING   pid 3435, uptime 0:06:31

但是日志打印成功开始,然后循环显示错误消息,并且队列不起作用

Horizon started successfully.
sh: line 0: exec: : not found
sh: line 0: exec: : not found <------ This prints like an infinite loop

如果从ssh shell手动启动地平线队列,它将起作用。

这是我的EBS配置文件

001-cron.config

files:
"/etc/cron.d/mycron":
    mode: "000644"
    owner: root
    group: root
    content: |
        * * * * * root php /var/app/current/artisan schedule:run

002-horizo​​n.config

container_commands:
01-copy_systemd_file:
    command: "easy_install supervisor"
02-enable_systemd:
    command: "mkdir -p /etc/supervisor/conf.d"
03-copy_horizon_config:
    command: "cp .ebextensions/horizon.conf /etc/supervisor/conf.d/horizon.conf"
    cwd: "/var/app/ondeck"
04-copy_supervidor_config:
    command: "cp .ebextensions/supervisord.conf /etc/supervisord.conf"
    cwd: "/var/app/ondeck"
05-touch_log:
    command: "mkdir -p /var/log/supervisor/ && touch /var/log/supervisor/supervisord.log"
06-run_supervisor:
    command: "/usr/local/bin/supervisord -c /etc/supervisord.conf || true"
07-run_process:
    command: "/usr/local/bin/supervisorctl restart horizon:*"
08-get_status:
    command: "/usr/local/bin/supervisorctl status"

horizo​​n.conf

[program:horizon]
process_name=%(program_name)s
command=php /var/app/current/artisan horizon
autostart=true
autorestart=true
user=ec2-user
redirect_stderr=true
stdout_logfile=/var/log/horizon.log

supervisord.conf

; supervisor config file

[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)

[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)

; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket

; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.

[include]
files = /etc/supervisor/conf.d/*.conf
; Change according to your configurations

1 个答案:

答案 0 :(得分:0)

在您的 horizo​​n.conf 文件中,尝试指定php的完整路径:

/usr/bin/php

像这样:

[program:horizon]
process_name=%(program_name)s
command=/usr/bin/php /var/app/current/artisan horizon
autostart=true
autorestart=true
user=root
redirect_stderr=true
stdout_logfile=/var/log/horizon.log

还请注意,我正在使用user=root