Created
October 10, 2017 05:30
-
-
Save tzkmx/7ca25363d9c73ebeca03d5378be04e77 to your computer and use it in GitHub Desktop.
SystemD Units to watch and fix PHP FPM pool definition files
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
#! /bin/bash | |
sed -i -e '/catch_workers_output/d; /pm.max_children = 5/s/.*/pm.max_children = 10\npm.max_requests = 50/;' $1 |
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= Watches changes to PHP FPM Pool definition: %p/%i. | |
Documentation= man:systemd.path | |
[Path] | |
PathChanged=/opt/plesk/%P/php-fpm.d/%i.conf | |
[Install] | |
WantedBy=multi-user.target |
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= Fixes undesired changes to [%p:%i] pool | |
Documentation= man:systemd.service | |
[Service] | |
Type=oneshot | |
ExecStart=/root/fix_php_fpm_pool.sh /opt/plesk/%P/php-fpm.d/%i.conf %i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment