aboutsummaryrefslogtreecommitdiffstats
path: root/main/php/php-fpm.initd
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2016-01-08 14:24:07 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-01-11 11:39:14 +0000
commita328da4ccd98a21a1f78ee22b71aad459cea4b53 (patch)
treeae56715a3ea87121ebb309715d8fde1944149183 /main/php/php-fpm.initd
parent73687df6245598d207fe21834fa8554d30612023 (diff)
downloadaports-a328da4ccd98a21a1f78ee22b71aad459cea4b53.tar.bz2
aports-a328da4ccd98a21a1f78ee22b71aad459cea4b53.tar.xz
main/php: APKBUILD and php-fpm.initd cleanups
- fix arch=noarch for php, php-common, php-pear - php-fpm and php-apache2 package code moved from main to related subpackages - clean init script for php-fpm
Diffstat (limited to 'main/php/php-fpm.initd')
-rw-r--r--main/php/php-fpm.initd37
1 files changed, 12 insertions, 25 deletions
diff --git a/main/php/php-fpm.initd b/main/php/php-fpm.initd
index a7e6798087..814c2bb264 100644
--- a/main/php/php-fpm.initd
+++ b/main/php/php-fpm.initd
@@ -1,10 +1,12 @@
#!/sbin/openrc-run
-PHP_FPM_CONF="/etc/php/php-fpm.conf"
+name="PHP FastCGI Process Manager"
+cfgfile="/etc/php/php-fpm.conf"
pidfile="/var/run/php-fpm.pid"
-command=/usr/bin/php-fpm
+command="/usr/bin/php-fpm"
+command_args="--fpm-config $cfgfile --pid $pidfile"
+required_files="$cfgfile"
-extra_commands="depend"
extra_started_commands="reload"
depend() {
@@ -12,29 +14,14 @@ depend() {
use apache2 lighttpd nginx
}
-start() {
- ebegin "Starting PHP FastCGI Process Manager"
- start-stop-daemon --start --pidfile ${pidfile} --exec ${command} \
- -- --fpm-config "${PHP_FPM_CONF}" --pid "${pidfile}"
- local i=0
- local timeout=50
- while [ ! -f ${pidfile} ] && [ $i -le $timeout ]; do
- sleep 0.1
- i=$(($i + 1))
- done
-
- [ $timeout -gt $i ]
- eend $?
-}
-
-stop() {
- ebegin "Stopping PHP FastCGI Process Manager"
- start-stop-daemon --signal QUIT --stop --pidfile ${pidfile}
- eend $?
+start_pre() {
+ ebegin
+ $command $command_args -t 2>/dev/null
+ eend $?
}
reload() {
- ebegin "Reloading PHP FastCGI Process Manager"
- [ -f ${pidfile} ] && kill -USR2 $(cat ${pidfile})
- eend $?
+ ebegin "Reloading $name"
+ start-stop-daemon --signal USR2 --pidfile ${pidfile} --name ${SVCNAME}
+ eend $?
}