#!/bin/sh
if [ -d /run/systemd/system ]; then
	if systemctl is-active --quiet php@PHP_VERSION@-fpm.service; then
		exec systemctl --kill-who=main --signal=USR1 kill php@PHP_VERSION@-fpm.service
	fi
else
	if service php@PHP_VERSION@-fpm status >/dev/null 2>&1; then
		exec service php@PHP_VERSION@-fpm reopen-logs
	fi
fi
exit 0
