From c3b8c9799e0e0dd61ab21aa1c3eece49c0237d9a Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Sat, 19 Nov 2011 21:08:18 +0000 Subject: [PATCH] [packages] php5: cleanup fastcgi package - use new service functions - introduce uci config - rename initscript SVN-Revision: 29265 --- lang/php5/Makefile | 7 +++++-- lang/php5/files/php.init | 16 --------------- lang/php5/files/php5-fastcgi.config | 3 +++ lang/php5/files/php5-fastcgi.init | 30 +++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 18 deletions(-) delete mode 100644 lang/php5/files/php.init create mode 100644 lang/php5/files/php5-fastcgi.config create mode 100644 lang/php5/files/php5-fastcgi.init diff --git a/lang/php5/Makefile b/lang/php5/Makefile index e61fcb2b29..0d7a4b0573 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=php PKG_VERSION:=5.3.8 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.php.net/distributions/ @@ -458,8 +458,11 @@ define Package/php5-cgi/install endef define Package/php5-fastcgi/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/php5-fastcgi.config $(1)/etc/config/php5-fastcgi + $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php + $(INSTALL_BIN) ./files/php5-fastcgi.init $(1)/etc/init.d/php5-fastcgi endef define BuildModule diff --git a/lang/php5/files/php.init b/lang/php5/files/php.init deleted file mode 100644 index 2b8e4d96a5..0000000000 --- a/lang/php5/files/php.init +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2010 OpenWrt.org - -START=50 - -export PHP_FCGI_CHILDREN='' -PORT=1026 -BIN=/usr/bin/php-fcgi - -start() { - $BIN -b $PORT & -} - -stop() { - kill `pidof php-fcgi` -} diff --git a/lang/php5/files/php5-fastcgi.config b/lang/php5/files/php5-fastcgi.config new file mode 100644 index 0000000000..039d3bbc53 --- /dev/null +++ b/lang/php5/files/php5-fastcgi.config @@ -0,0 +1,3 @@ +config php5-fastcgi + option enabled 1 + option port '1026' diff --git a/lang/php5/files/php5-fastcgi.init b/lang/php5/files/php5-fastcgi.init new file mode 100644 index 0000000000..0c452ad273 --- /dev/null +++ b/lang/php5/files/php5-fastcgi.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2010-2011 OpenWrt.org + +START=50 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start_instance() { + local section="$1" + local enabled + local port + + config_get_bool enabled "$section" 'enabled' 0 + config_get port "$section" 'port' 1026 + + [ $enabled -gt 0 ] || return 1 + + PHP_FCGI_CHILDREN='' \ + service_start /usr/bin/php-fcgi -b $port +} + +start() { + config_load 'php5-fastcgi' + config_foreach start_instance 'php5-fastcgi' +} + +stop() { + service_stop /usr/bin/php-fcgi +} -- 2.30.2