Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
php-fpm systemd unit with auto-restart (because php-fpm crashes half the times it's started)
[Unit]
Description=PHP FastCGI Server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/php-fpm.pid
ExecStart=/usr/sbin/php-fpm --fpm-config /etc/php5/fpm/php-fpm.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment