Created
August 18, 2021 07:58
-
-
Save germanow/c0cb17690e233a0b54723379aff7aba7 to your computer and use it in GitHub Desktop.
Example of systemd service for yii2-queue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=queue Worker Number %i | |
After=network.target | |
[Service] | |
Type=simple | |
User=user | |
WorkingDirectory=/path/to/project | |
PIDFile=/var/run/queue.%i | |
Environment=LANG=en_US.UTF-8 | |
Environment=LC_ALL=en_US.UTF-8 | |
Environment=LC_LANG=en_US.UTF-8 | |
ExecStart=/usr/bin/php /path/to/project/yii queue/listen --verbose | |
ExecReload=/bin/kill -s HUP $MAINPID | |
ExecStop=/bin/kill -s TERM $MAINPID | |
PrivateTmp=true | |
Restart=always | |
RestartSec=5 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment