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 手动启动,horizon 队列确实可以工作。
这是我的 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-horizon.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
解决方案
在您的Horizon.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
.
推荐阅读
- firebase - Flutter Web & Firebase - 从 JSON API 接收的存储/日志信息
- java - 在 Spring Boot 项目中为特定用户启用 Swagger UI
- rust - 是否可以创建一个 Box<(T, [U])>?
- c - 将简单的 C 程序手动转换为汇编程序
- loops - 如何在带有变量的循环中运行 awk
- reactjs - 在 Gatsby 的所有页面中扩展背景视频和导航栏
- python-c-api - 为什么轮子安装将共享对象放在站点包文件夹而不是包文件夹中?
- list - 如何买到最便宜的水果
- python - Selenium Python:弹出窗口上的“关闭”按钮不可交互
- postgresql - Amazon Linux 2 AMI - 由于密码而无法访问文件夹