Manage Processes
Modules can register their own long-running tasks (for example: schedulers, workers, …).
To avoid having to maintain a dedicated supervisor for each module, the system provides a unified command capable of supervising all declared module processes.
This page explains how to start, reload, and keep this worker running in production.
Starting the Worker
Section titled “Starting the Worker”The epsicube:work command starts all module-defined long-running tasks and supervises them continuously.
php artisan epsicube:work[12:51:11] [Supervisor] Starting sub-processes…[12:51:11] [Supervisor] Starting 'schedule'…[12:51:11] [Supervisor] Starting 'queue'…[12:51:12] [schedule] INFO Running scheduled tasks....Once started, the worker continues running until manually stopped or until the terminal is closed.
Reloading the Worker
Section titled “Reloading the Worker”You can trigger a full reload of all running sub-processes using:
php artisan epsicube:reloadThis broadcasts a restart signal that forces epsicube:work to gracefully stop and restart each managed task:
Broadcasting reload signal.This is particularly useful when deploying changes that affect worker-level logic.
Setup for production
Section titled “Setup for production”To ensure it stays active after crashes, timeouts, or server restarts, you should use a process monitor, such as Supervisor.
Supervisor Configuration
Section titled “Supervisor Configuration”Supervisor configuration files are typically stored in the /etc/supervisor/conf.d directory. Within this directory, you may create any number of configuration files that instruct supervisor how your processes should be monitored. For example, let’s create a epsicube-worker.conf file that starts and monitors epsicube:work processes:
[program:epsicube-worker]process_name=%(program_name)s_%(process_num)02dcommand=php /path/to/your/application/artisan epsicube:workautostart=trueautorestart=truestopasgroup=truekillasgroup=trueuser=www-datanumprocs=1redirect_stderr=truestdout_logfile=/path/to/your/application/storage/logs/worker.logstopwaitsecs=3600Starting supervisor
Section titled “Starting supervisor”Once the configuration file has been created, you may update the Supervisor configuration and start the processes using the following commands:
sudo supervisorctl rereadsudo supervisorctl updatesudo supervisorctl start "epsicube-worker:*"For more information on Supervisor, consult the Supervisor documentation.