rpms/spawn-fcgi/devel spawn-fcgi.init, NONE, 1.1 spawn-fcgi.sysconfig, NONE, 1.1 .cvsignore, 1.2, 1.3 sources, 1.2, 1.3 spawn-fcgi.spec, 1.1, 1.2

Matthias Saou thias at fedoraproject.org
Wed Sep 30 17:16:15 UTC 2009


Author: thias

Update of /cvs/extras/rpms/spawn-fcgi/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6061

Modified Files:
	.cvsignore sources spawn-fcgi.spec 
Added Files:
	spawn-fcgi.init spawn-fcgi.sysconfig 
Log Message:
Update to 1.6.3 and add custom init script.



--- NEW FILE spawn-fcgi.init ---
#!/bin/sh
#
# spawn-fcgi   Start and stop FastCGI processes
#
# chkconfig:   - 80 20
# description: Spawn FastCGI scripts to be used by web servers

### BEGIN INIT INFO
# Provides: 
# Required-Start: $local_fs $network $syslog $remote_fs $named
# Required-Stop: 
# Should-Start: 
# Should-Stop: 
# Default-Start: 
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: Start and stop FastCGI processes
# Description:       Spawn FastCGI scripts to be used by web servers
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

exec="/usr/bin/spawn-fcgi"
prog="spawn-fcgi"
config="/etc/sysconfig/spawn-fcgi"

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

lockfile=/var/lock/subsys/$prog

start() {
    [ -x $exec ] || exit 5
    [ -f $config ] || exit 6
    echo -n $"Starting $prog: "
    # Just in case this is left over with wrong ownership
    [ -n "${SOCKET}" -a -S "${SOCKET}" ] && rm -f ${SOCKET}
    daemon "$exec $OPTIONS >/dev/null"
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog
    # Remove the socket in order to never leave it with wrong ownership
    [ -n "${SOCKET}" -a -S "${SOCKET}" ] && rm -f ${SOCKET}
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

rh_status() {
    # run checks to determine if the service is running or use generic status
    status $prog
}

rh_status_q() {
    rh_status &>/dev/null
}


case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?



--- NEW FILE spawn-fcgi.sysconfig ---
# You must set some working options before the "spawn-fcgi" service will work.
# If SOCKET points to a file, then this file is cleaned up by the init script.
#
# See spawn-fcgi(1) for all possible options.
#
# Example :
#SOCKET=/var/run/php-fcgi.sock
#OPTIONS="-u apache -g apache -s $SOCKET -S -M 0600 -C 32 -F 1 -P /var/run/spawn-fcgi.pid -- /usr/bin/php-cgi"



Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/spawn-fcgi/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- .cvsignore	14 Sep 2009 09:59:29 -0000	1.2
+++ .cvsignore	30 Sep 2009 17:16:14 -0000	1.3
@@ -1 +1 @@
-spawn-fcgi-1.6.2.tar.bz2
+spawn-fcgi-1.6.3.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/spawn-fcgi/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- sources	14 Sep 2009 09:59:29 -0000	1.2
+++ sources	30 Sep 2009 17:16:14 -0000	1.3
@@ -1 +1 @@
-f74a8f4d8e379c53926b5eeef84b381c  spawn-fcgi-1.6.2.tar.bz2
+787ed2f88d2204bf1fe4fbd6e509d1d7  spawn-fcgi-1.6.3.tar.bz2


Index: spawn-fcgi.spec
===================================================================
RCS file: /cvs/extras/rpms/spawn-fcgi/devel/spawn-fcgi.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- spawn-fcgi.spec	14 Sep 2009 09:59:29 -0000	1.1
+++ spawn-fcgi.spec	30 Sep 2009 17:16:14 -0000	1.2
@@ -1,12 +1,17 @@
 Summary: Simple program for spawning FastCGI processes
 Name: spawn-fcgi
-Version: 1.6.2
+Version: 1.6.3
 Release: 1%{?dist}
 License: BSD
 Group: System Environment/Daemons
 URL: http://redmine.lighttpd.net/projects/spawn-fcgi/
 Source0: http://www.lighttpd.net/download/spawn-fcgi-%{version}.tar.bz2
+Source1: spawn-fcgi.init
+Source2: spawn-fcgi.sysconfig
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+# Note that restarting automatically upon update makes no sense at all here
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/service, /sbin/chkconfig
 
 %description
 This package contains the spawn-fcgi program used for spawning FastCGI
@@ -25,20 +30,41 @@ processes, which can be local or remote.
 %install
 %{__rm} -rf %{buildroot}
 %{__make} install DESTDIR=%{buildroot}
+%{__install} -D -p -m 0755 %{SOURCE1} \
+    %{buildroot}%{_sysconfdir}/init.d/spawn-fcgi
+%{__install} -D -p -m 0600 %{SOURCE2} \
+    %{buildroot}%{_sysconfdir}/sysconfig/spawn-fcgi
 
 
 %clean
 %{__rm} -rf %{buildroot}
 
 
+%post
+/sbin/chkconfig --add spawn-fcgi
+
+%preun
+if [ $1 -eq 0 ]; then
+    /sbin/service spawn-fcgi stop &>/dev/null || :
+    /sbin/chkconfig --del spawn-fcgi
+fi
+
+
 %files
 %defattr(-,root,root,-)
 %doc AUTHORS COPYING NEWS README
+%{_sysconfdir}/init.d/spawn-fcgi
+%config(noreplace) %{_sysconfdir}/sysconfig/spawn-fcgi
 %{_bindir}/spawn-fcgi
 %{_mandir}/man1/spawn-fcgi.1*
 
 
 %changelog
+* Wed Sep 30 2009 Matthias Saou <http://freshrpms.net/> 1.6.3-1
+- Update to 1.6.3.
+- Include init script and sysconfig file to make it easy to manage a single
+  instance.
+
 * Tue Apr 21 2009 Matthias Saou <http://freshrpms.net/> 1.6.2-1
 - Update to 1.6.2.
 - Remove leftover -f from %%files section.




More information about the fedora-extras-commits mailing list