#laravel #laravel-horizon
#laravel #laravel-horizon
Вопрос:
Я пытался настроить horizon для запуска внутри экземпляра elastic beanstalk, и, похоже, это работает.
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
очередь horizon действительно работает, если я запускаю ее вручную из ssh-оболочки.
вот мои файлы конфигурации для 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/ amp;amp; 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"
horizon.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
супервизор.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. вам когда-нибудь везло с этим?
Ответ №1:
В вашем файле 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
.