-
Hi!
I've developed a Laravel app, but I can't get the queue worker to work, as I'm unable to create the file...# APPNAME Queue Worker File # ---------------------------------- [Unit] Description=APPNAME Queue Worker After=redis-server.service [Service] # On some systems the user and group might be different. # Some systems use `apache` or `nginx` as the user and group. User=www-data Group=www-data Restart=always ExecStart=/usr/bin/php /var/www/app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3 [Install] WantedBy=multi-user.target
I'm aware of that the
ExecStart
path is wrong, but I can't create this file Any ideas? -
@xevotech You cannot put in a systemd service file because the app is running in a container and the container itself has no systemd inside it.
Not an expert on laravel but there are two ways:
-
In the startup script, start the queue worker in the background - https://docs.cloudron.io/apps/lamp/#custom-startup-script . So,
sudo -u www-data /usr/bin/php /var/www/app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3 &
-
Alternately, you can put this in the crontab - https://docs.cloudron.io/apps/lamp/#cron-support . So,
0 * * * * sudo -u www-data /usr/bin/php /var/www/app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3 --stop-when-empty
(the stop-when-empty is needed so that the queue worker quits when the queue is empty).
Would either of the above work?
-
-
@girish I'm getting an error with LAMP's PHP.ini. Chaning the PHP.ini in the data dir doesn't fix it. What do I do?
The error as following:
May 07 22:10:38 PHP: syntax error, unexpected $end in /etc/php/7.4/cli/conf.d/99-cloudron.ini on line 5 May 07 22:10:38 May 07 22:10:38 ErrorException May 07 22:10:38 May 07 22:10:38 pcntl_async_signals() has been disabled for security reasons May 07 22:10:38 May 07 22:10:38 at /app/data/vendor/laravel/framework/src/Illuminate/Queue/Worker.php:639 May 07 22:10:38 635▕ * @return void May 07 22:10:38 636▕ */ May 07 22:10:38 637▕ protected function listenForSignals() May 07 22:10:38 638▕ { May 07 22:10:38 ➜ 639▕ pcntl_async_signals(true); May 07 22:10:38 640▕ May 07 22:10:38 641▕ pcntl_signal(SIGTERM, function () { May 07 22:10:38 642▕ $this->shouldQuit = true; May 07 22:10:38 643▕ }); May 07 22:10:38 May 07 22:10:38 +17 vendor frames May 07 22:10:38 18 /app/data/artisan:37 May 07 22:10:38 Illuminate\Foundation\Console\Kernel::handle() May 07 22:10:38 box:tasks 6710: {"percent":100,"message":"Done"} May 07 22:10:39 box:apptask xevoid.com updating app with values: {"installationState":"installed","error":null,"health":null} May 07 22:10:39 box:taskworker Task took 24.15 seconds May 07 22:10:39 box:tasks setCompleted - 6710: {"result":null,"error":null} May 07 22:10:39 box:tasks 6710: {"percent":100,"result":null,"error":null} May 07 22:10:43 ==> Do not override existing index file May 07 22:10:43 ==> Source custom startup script May 07 22:10:43 PHP: syntax error, unexpected $end in /etc/php/7.4/cli/conf.d/99-cloudron.ini on line 5 May 07 22:10:43