Skip to content

Instantly share code, notes, and snippets.

@ntrrgc
Created March 3, 2014 15:03
Show Gist options
  • Save ntrrgc/9326847 to your computer and use it in GitHub Desktop.
Save ntrrgc/9326847 to your computer and use it in GitHub Desktop.
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