Changeset 29265


Ignore:
Timestamp:
2011-11-19T22:08:18+01:00 (6 years ago)
Author:
mhei
Message:

[packages] php5: cleanup fastcgi package

  • use new service functions
  • introduce uci config
  • rename initscript
Location:
packages/lang/php5
Files:
1 added
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • packages/lang/php5/Makefile

    r28510 r29265  
    1010PKG_NAME:=php 
    1111PKG_VERSION:=5.3.8 
    12 PKG_RELEASE:=5 
     12PKG_RELEASE:=6 
    1313 
    1414PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 
     
    459459 
    460460define Package/php5-fastcgi/install 
     461        $(INSTALL_DIR) $(1)/etc/config 
     462        $(INSTALL_DATA) ./files/php5-fastcgi.config $(1)/etc/config/php5-fastcgi 
     463 
    461464        $(INSTALL_DIR) $(1)/etc/init.d 
    462         $(INSTALL_BIN) ./files/php.init $(1)/etc/init.d/php 
     465        $(INSTALL_BIN) ./files/php5-fastcgi.init $(1)/etc/init.d/php5-fastcgi 
    463466endef 
    464467 
  • packages/lang/php5/files/php5-fastcgi.init

    r29234 r29265  
    11#!/bin/sh /etc/rc.common 
    2 # Copyright (C) 2010 OpenWrt.org 
     2# Copyright (C) 2010-2011 OpenWrt.org 
    33 
    44START=50 
    55 
    6 export PHP_FCGI_CHILDREN='' 
    7 PORT=1026 
    8 BIN=/usr/bin/php-fcgi 
     6SERVICE_DAEMONIZE=1 
     7SERVICE_WRITE_PID=1 
     8 
     9start_instance() { 
     10        local section="$1" 
     11        local enabled 
     12        local port 
     13 
     14        config_get_bool enabled "$section" 'enabled' 0 
     15        config_get port "$section" 'port' 1026 
     16 
     17        [ $enabled -gt 0 ] || return 1 
     18 
     19        PHP_FCGI_CHILDREN='' \ 
     20        service_start /usr/bin/php-fcgi -b $port 
     21} 
    922 
    1023start() { 
    11         $BIN -b $PORT & 
     24        config_load 'php5-fastcgi' 
     25        config_foreach start_instance 'php5-fastcgi' 
    1226} 
    1327 
    1428stop() { 
    15         kill `pidof php-fcgi` 
     29        service_stop /usr/bin/php-fcgi 
    1630} 
Note: See TracChangeset for help on using the changeset viewer.