Adds a queue worker to an Ubuntu system for Craft CMS. This will run the Craft queue for a site every sixty seconds, and email you if the queue worker stops.
Variables in both files are enclosed in braces and need to be modified. You will need a unique name for each queue you want to run, site is a generic placeholder.
- Disable Craft's queue runner by adding
'runQueueAutomatically' => false,
to the general.php file in the craft/config folder - SSH into server as root
- Type
sudo nano /etc/systemd/system/[email protected]
- Add contents of [email protected] with variables replaced
- Type
sudo systemctl start site-queue@{1..2}
- Type
sudo systemctl enable site-queue@{1..2}
- Type
sudo systemctl daemon-reload
- Type
sudo apt-get install mailutils
- Type
sudo nano /usr/local/bin/srvc.sh
- Add contents of srvc.sh with variables replaced
- Type
sudo crontab -e
- Add the contents of crontab to the bottom
- Type
sudo service cron restart
- To verify, type
journalctl -f -u site-queue@*.service