Update phyre

This commit is contained in:
Bozhidar Slaveykov 2023-11-26 01:15:50 +02:00
parent 97a5f85d5d
commit ccdf33af85

View file

@ -8,7 +8,7 @@
# Default-Start: 2 3 4 5 # Default-Start: 2 3 4 5
# Default-Stop: 0 1 6 # Default-Stop: 0 1 6
# Short-Description: starts the phyre control panel # Short-Description: starts the phyre control panel
# Description: starts nginx using start-stop-daemon # Description: starts nginx & php-fpm using start-stop-daemon
### END INIT INFO ### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@ -18,6 +18,12 @@ NGINX_DESC=phyre-nginx
NGINX_PID=/run/phyre-nginx.pid NGINX_PID=/run/phyre-nginx.pid
NGINX_CONF=/usr/local/phyre/nginx/conf/nginx.conf NGINX_CONF=/usr/local/phyre/nginx/conf/nginx.conf
PHP_DAEMON=/usr/local/phyre/php/sbin/phyre-php
PHP_NAME=phyre-php
PHP_DESC=phyre-php
PHP_PID=/run/phyre-php.pid
PHP_CONF=/usr/local/phyre/php/etc/php-fpm.conf
set -e set -e
start_nginx() { start_nginx() {
@ -30,29 +36,44 @@ stop_nginx() {
--retry 5 --oknodo --exec $NGINX_DAEMON --retry 5 --oknodo --exec $NGINX_DAEMON
} }
start_php() {
start-stop-daemon --start --quiet --pidfile $PHP_PID \
--retry 5 --exec $PHP_DAEMON --oknodo
}
stop_php() {
start-stop-daemon --stop --quiet --pidfile $PHP_PID \
--retry 5 --oknodo --exec $PHP_DAEMON
}
case "$1" in case "$1" in
start) start)
start_nginx start_nginx
start_php
;; ;;
stop) stop)
stop_nginx stop_nginx
stop_php
;; ;;
restart | force-reload | reload | configtest | testconfig) restart | force-reload | reload | configtest | testconfig)
stop_nginx stop_nginx
stop_php
sleep 1 sleep 1
start_nginx start_nginx
start_php
;; ;;
status) status)
status_of_proc -p $NGINX_PID "$NGINX_DAEMON" phyre-nginx status_of_proc -p $NGINX_PID "$NGINX_DAEMON" phyre-nginx
status_of_proc -p $PHP_PID "$PHP_DAEMON" phyre-php
;; ;;
*) *)