Created
February 26, 2011 01:31
-
-
Save ratazzi/844829 to your computer and use it in GitHub Desktop.
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/sh | |
### BEGIN INIT INFO | |
# Provides: php-fpm php5-fpm | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: starts php-fpm | |
### END INIT INFO | |
set -u | |
DAEMON="PHP5 FPM" | |
FPM_CMD=/usr/local/sbin/php-fpm | |
FPM_CONF=/usr/local/etc/php-fpm.conf | |
FPM_PID=/var/run/php5-fpm.pid | |
TIMEOUT=30 | |
FPM_OPTIONS="--fpm-config $FPM_CONF" | |
SSD_OPTIONS="--oknodo --quiet --pidfile $FPM_PID --exec $FPM_CMD" | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_begin_msg "Starting $DAEMON..." | |
/sbin/start-stop-daemon --start $SSD_OPTIONS -- $FPM_OPTIONS | |
log_end_msg $? | |
;; | |
stop) | |
log_begin_msg "Stopping $DAEMON..." | |
/sbin/start-stop-daemon --stop $SSD_OPTIONS | |
log_end_msg $? | |
;; | |
graceful-stop) | |
log_begin_msg "Gracefully stopping $DAEMON..." | |
/sbin/start-stop-daemon --stop --retry QUIT/$TIMEOUT/TERM $SSD_OPTIONS | |
log_end_msg $? | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
reload|force-reload) | |
log_begin_msg "Reloading $DAEMON..." | |
/sbin/start-stop-daemon --stop --signal USR2 $SSD_OPTIONS | |
log_end_msg $? | |
;; | |
*) | |
echo "Usage: $0 {start|stop|graceful-stop|restart|reload|force-reload}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment