# systemd unit that keeps Horizon (and therefore every queue worker — # crawling, enrichment, ai-monitoring, integrations-sync, default) running # permanently, restarting it if it ever crashes or the server reboots. # This replaces the local dev habit of `nohup php artisan horizon &`, # which does not survive a reboot and isn't supervised at all. # # Install: # sudo cp deploy/modernsignal-horizon.service /etc/systemd/system/ # sudo systemctl daemon-reload # sudo systemctl enable --now modernsignal-horizon # # Deploys after this point should run `php artisan horizon:terminate` # (systemd restarts it automatically) rather than editing this file — # terminate lets in-flight jobs finish first instead of killing them. [Unit] Description=ModernSignal Horizon queue supervisor After=network.target redis-server.service postgresql.service [Service] User=www-data Group=www-data Restart=always RestartSec=5 WorkingDirectory=/var/www/modernsignal ExecStart=/usr/bin/php /var/www/modernsignal/artisan horizon ExecStop=/usr/bin/php /var/www/modernsignal/artisan horizon:terminate --wait [Install] WantedBy=multi-user.target