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
sudo systemctl daemon-reload
sudo systemctl enable billrun-worker
sudo systemctl start billrun-worker
sudo systemctl status billrun-worker
journalctl -u billrun-worker -f