首页 > 解决方案 > laravel 地平线弹性豆茎监督有错误

问题描述

我一直在尝试设置 Horizo​​n 以在弹性 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 手动启动,horizo​​n 队列确实可以工作。

这是我的 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"

地平线.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

标签: laravellaravel-horizon

解决方案


在您的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.


推荐阅读