install supervisor
with this command on your server:
sudo yum -y install supervisor
(Cent-OS)
than run it and enable it on restart:
sudo systemctl start supervisord
sudo systemctl enable supervisord
add this after the last line of supervisord.conf
file:
[program:any_name]
process_name=%(program_name)s_%(process_num)02d
command=php flarum queue:work sqs --sleep=3 --tries=3
directory=/path_to_flarum
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/path_to_flarum/worker.log
stopwaitsecs=3600
after that, run this command:
systemctl restart supervisord
than this to see if it is active:
systemctl status supervisord
you can check the log file at /var/log/supervisor/supervisord.log
and search for INFO success:
at the last line. if you see that, supervisor is running and it will run your command on restart.
Braden did you add the lines exiting file or you created a new file?
exiting file need to be like below:
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Flarum\Extend;
return [
new Blomstra\Redis\Extend\Redis([
'host' => '127.0.0.1',
'password' => null,
'port' => 6379,
'database' => 1,
])
];