Create file: /etc/systemd/system/billrun-worker.service
[Unit]
Description=BillRun PHP Worker
After=network.target
[Service]
ExecStart=/usr/bin/php /var/www/html/public/index.php --env container --worker
Restart=always
User=www-data
Group=www-data
WorkingDirectory=/var/www/html
StandardOutput=append:/var/log/billrun-worker.log
StandardError=append:/var/log/billrun-worker.err.log
[Install]
WantedBy=multi-user.target
If you need multi-tenant support:
[Unit]
Description=BillRun Tenant Test Worker
After=network.target
[Service]
ExecStart=/usr/bin/php /var/www/billrun/public/index.php --env prod --tenant tenantname --worker
Environment=APPLICATION_MULTITENANT=1
Restart=always
User=billrun
Group=billrun
WorkingDirectory=/var/www/billrun
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable billrun-worker
sudo systemctl start billrun-worker
sudo systemctl status billrun-worker
journalctl -u billrun-worker -f