Debian Bug report logs -
#426780
Init-script for php-cgi in external FASTCGI Mode (Daemon mode)
Reported by: Kurt Zankl <kz@xon.uni.cc>
Date: Wed, 30 May 2007 20:48:06 UTC
Severity: wishlist
Tags: patch
Found in versions php5/5.2.0-8+etch1, php5/5.3.2-1
Fixed in version 5.3.5-1
Done: Ondřej Surý <ondrej@sury.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(full text, mbox, link).
Acknowledgement sent to Kurt Zankl <kz@xon.uni.cc>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Package: php5-cgi
Version: 5.2.0-8+etch1
Severity: minor
Tags: patch
There was no Init-script for php-cgi in external FASTCGI Mode (Daemon
mode) included. So I adapted /etc/init.d/skeleton for this application.
Start before httpd, stop after httpd:
# update-rc.d php-fastcgi defaults 19 21
Attached: /etc/init.d/php-fastcgi, /etc/default/php-fastcgi
PS: Tested with nginx httpd.
[init.php-fastcgi (text/plain, inline)]
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fastcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description: Start and stop php-cgi in external FASTCGI mode
### END INIT INFO
# Author: Kurt Zankl <kz@xon.uni.cc>
# Do NOT "set -e"
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="php-cgi in external FASTCGI mode"
NAME=php-fastcgi
DAEMON=/usr/bin/php-cgi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# If the daemon is not enabled, give the user a warning and then exit,
# unless we are stopping the daemon
if [ "$START" != "yes" -a "$1" != "stop" ]; then
log_warning_msg "To enable $NAME, edit /etc/default/$NAME and set START=yes"
exit 0
fi
# Process configuration
export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS
DAEMON_ARGS="-q -b $FCGI_HOST:$FCGI_PORT"
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
--background --make-pidfile --chuid $EXEC_AS_USER --startas $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE > /dev/null # --name $DAEMON
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
:
[default.php-fastcgi (text/plain, inline)]
#
# Settings for php-cgi in external FASTCGI Mode
#
# Should php-fastcgi run automatically on startup? (default: no)
START=yes
# Which user runs PHP? (default: www-data)
EXEC_AS_USER=www-data
# Host and TCP port for FASTCGI-Listener (default: localhost:9000)
FCGI_HOST=localhost
FCGI_PORT=9000
# Environment variables, which are processed by PHP
PHP_FCGI_CHILDREN=5
PHP_FCGI_MAX_REQUESTS=1000
Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(full text, mbox, link).
Acknowledgement sent to Steve Langasek <vorlon@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(full text, mbox, link).
Message #10 received at 426780@bugs.debian.org (full text, mbox, reply):
On Wed, May 30, 2007 at 10:38:41PM +0200, Kurt Zankl wrote:
> Package: php5-cgi
> Version: 5.2.0-8+etch1
> Severity: minor
> Tags: patch
> There was no Init-script for php-cgi in external FASTCGI Mode (Daemon
> mode) included. So I adapted /etc/init.d/skeleton for this application.
> Start before httpd, stop after httpd:
> # update-rc.d php-fastcgi defaults 19 21
> Attached: /etc/init.d/php-fastcgi, /etc/default/php-fastcgi
I don't believe that's appropriate to ship enabled. Most users who have
php5-cgi installed are *not* running it in fastcgi mode, because there's no
complete free fastcgi implementation available for apache.
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
vorlon@debian.org http://www.debian.org/
Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(full text, mbox, link).
Acknowledgement sent to <albert.lash@docunext.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(full text, mbox, link).
Message #15 received at 426780@bugs.debian.org (full text, mbox, reply):
Actually this init script is very useful for nginx as it is designed not to
initialize cgi scripts.
Severity set to `wishlist' from `minor'
Request was from Raphael Geissert <atomo64@gmail.com>
to control@bugs.debian.org.
(Fri, 29 Aug 2008 01:00:02 GMT) (full text, mbox, link).
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Sun, 21 Dec 2008 22:39:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <Olaf@XWIS.Net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Sun, 21 Dec 2008 22:39:02 GMT) (full text, mbox, link).
Message #22 received at 426780@bugs.debian.org (full text, mbox, reply):
> I don't believe that's appropriate to ship enabled. Most users who
have php5-cgi installed are *not* running it in fastcgi mode, because
there's no complete free fastcgi implementation available for apache.
Most users are using mod_php, which does not require php5-cgi AFAIK.
So are you sure your claim is correct? I doubt they're running PHP in
CGI mode.
Anyway, what's the status of this request?
I'm also looking for this script to use it with Nginx.
It might be useful with a future Lighttpd too.
Olaf
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Mon, 22 Dec 2008 01:15:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Steve Langasek <vorlon@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Mon, 22 Dec 2008 01:15:03 GMT) (full text, mbox, link).
Message #27 received at 426780@bugs.debian.org (full text, mbox, reply):
On Sun, Dec 21, 2008 at 11:35:50PM +0100, Olaf van der Spek wrote:
> Anyway, what's the status of this request?
No longer my problem. I don't maintain the php packages, so please don't
cc: me on their bugs.
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Thu, 20 May 2010 22:57:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <olaf@xwis.net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
Your message did not contain a Subject field. They are recommended and
useful because the title of a $gBug is determined using this field.
Please remember to include a Subject field in your messages in future.
(Thu, 20 May 2010 22:57:03 GMT) (full text, mbox, link).
Message #32 received at 426780@bugs.debian.org (full text, mbox, reply):
Anybody?
For Lighttpd this might be handy too, if PHP is running on a remote host
or if Lighttpd doesn't want to handle PHP processes itself.
Olaf
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Wed, 26 May 2010 11:09:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <olaf@xwis.net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Wed, 26 May 2010 11:09:03 GMT) (full text, mbox, link).
Message #37 received at 426780@bugs.debian.org (full text, mbox, reply):
Package: php5-cgi
Version: 5.3.2-1
Severity: normal
Still present in Squeeze... ;)
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing'), (1, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages php5-cgi depends on:
ii libbz2-1.0 1.0.5-4 high-quality block-sorting file co
ii libc6 2.10.2-9 Embedded GNU C Library: Shared lib
ii libcomerr2 1.41.11-1 common error description library
ii libdb4.8 4.8.26-1 Berkeley v4.8 Database Libraries [
ii libgssapi-krb5-2 1.8.1+dfsg-3 MIT Kerberos runtime libraries - k
ii libk5crypto3 1.8.1+dfsg-3 MIT Kerberos runtime libraries - C
ii libkrb5-3 1.8.1+dfsg-3 MIT Kerberos runtime libraries
ii libmagic1 5.04-2 File type determination library us
ii libonig2 5.9.1-1 Oniguruma regular expressions libr
ii libpcre3 7.8-3 Perl 5 Compatible Regular Expressi
ii libqdbm14 1.8.74-1.4 QDBM Database Libraries [runtime]
ii libssl0.9.8 0.9.8n-1 SSL shared libraries
ii libxml2 2.7.7.dfsg-2 GNOME XML library
ii mime-support 3.48-1 MIME files 'mime.types' & 'mailcap
ii php5-common 5.3.2-1 Common files for packages built fr
ii tzdata 2010j-1 time zone and daylight-saving time
ii ucf 3.0025 Update Configuration File: preserv
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime
php5-cgi recommends no packages.
Versions of packages php5-cgi suggests:
pn php-pear <none> (no description available)
-- no debconf information
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Sun, 20 Jun 2010 17:45:10 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <olaf@xwis.net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
Your message did not contain a Subject field. They are recommended and
useful because the title of a $gBug is determined using this field.
Please remember to include a Subject field in your messages in future.
(Sun, 20 Jun 2010 17:45:10 GMT) (full text, mbox, link).
Message #42 received at 426780@bugs.debian.org (full text, mbox, reply):
Somebody?
Is any help needed on this bug?
Olaf
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Fri, 25 Jun 2010 01:15:03 GMT) (full text, mbox, link).
Message #45 received at 426780@bugs.debian.org (full text, mbox, reply):
On Sunday 20 June 2010 12:44:49 Olaf van der Spek wrote:
> Somebody?
> Is any help needed on this bug?
>
An example init script could be shipped, yes. Will try to remember when I work
on the packaging again.
However, given the schedule for 5.3.3 we might (and I hope) end up shipping
that version in squeeze, which includes the FPM SAPI which pretty much
resolves multiple issues of the f/cgi.
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Sat, 26 Jun 2010 14:33:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <olaf@xwis.net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Sat, 26 Jun 2010 14:33:06 GMT) (full text, mbox, link).
Message #50 received at 426780@bugs.debian.org (full text, mbox, reply):
On 25-6-2010 3:13, Raphael Geissert wrote:
> On Sunday 20 June 2010 12:44:49 Olaf van der Spek wrote:
>> Somebody?
>> Is any help needed on this bug?
>>
>
> An example init script could be shipped, yes. Will try to remember when I work
> on the packaging again.
I'd prefer an actual init script.
If you think that's unsuitable for php-cgi (who's really using PHP as
CGI?), then I'd like to see a php-fcgi package with the init script.
> However, given the schedule for 5.3.3 we might (and I hope) end up shipping
> that version in squeeze, which includes the FPM SAPI which pretty much
> resolves multiple issues of the f/cgi.
A major change in a minor update? Sounds weird.
Olaf
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Sat, 26 Jun 2010 16:12:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Thomas Goirand <thomas@goirand.fr>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Sat, 26 Jun 2010 16:12:04 GMT) (full text, mbox, link).
Message #55 received at 426780@bugs.debian.org (full text, mbox, reply):
----- Original message -----
> who's really using PHP as
> CGI?
I think using php used as CGI is cool. You can run any php version, and using sbox from cern, which does a chroot and many setlimits() calls, secures policies under shared hosting env, but as keeping a quite good freedom in usages. I would like this php cgi-bin feature of php to be ketp in Debian.
Thomas
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Tue, 29 Jun 2010 09:48:06 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <olaf@xwis.net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Tue, 29 Jun 2010 09:48:06 GMT) (full text, mbox, link).
Message #60 received at 426780@bugs.debian.org (full text, mbox, reply):
On 26-6-2010 18:07, Thomas Goirand wrote:
>
> ----- Original message -----
>> who's really using PHP as
>> CGI?
>
> I think using php used as CGI is cool. You can run any php version, and using sbox from cern, which does a chroot and many setlimits() calls, secures policies under shared hosting env, but as keeping a quite good freedom in usages. I would like this php cgi-bin feature of php to be ketp in Debian.
Yeah, we should certainly not remove it.
Olaf
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Tue, 29 Jun 2010 22:51:06 GMT) (full text, mbox, link).
Message #63 received at 426780@bugs.debian.org (full text, mbox, reply):
On Tuesday 29 June 2010 04:46:36 Olaf van der Spek wrote:
> On 26-6-2010 18:07, Thomas Goirand wrote:
> > I think using php used as CGI is cool. You can run any php version, and
> > using sbox from cern, which does a chroot and many setlimits() calls,
> > secures policies under shared hosting env, but as keeping a quite good
> > freedom in usages. I would like this php cgi-bin feature of php to be
> > ketp in Debian.
>
> Yeah, we should certainly not remove it.
Stop second-guessing, nobody said the cgi is going to be removed.
Making more noise on the BTS (and the mailing list) won't help anything move
forward, so stop it.
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Tue, 16 Nov 2010 15:21:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Olaf van der Spek <olaf@xwis.net>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Tue, 16 Nov 2010 15:21:03 GMT) (full text, mbox, link).
Message #68 received at 426780@bugs.debian.org (full text, mbox, reply):
Hi,
What happened to FPM SAPI?
Olaf
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Tue, 16 Nov 2010 15:30:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Ondřej Surý <ondrej@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Tue, 16 Nov 2010 15:30:03 GMT) (full text, mbox, link).
Message #73 received at 426780@bugs.debian.org (full text, mbox, reply):
> What happened to FPM SAPI?
Nothing, it was never part of unstable. It will be added to unstable
after squeeze is out.
See http://lists.debian.org/debian-release/2010/10/msg00360.html
Ondrej
--
Ondřej Surý <ondrej@sury.org>
http://blog.rfc1925.org/
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Thu, 02 Dec 2010 06:12:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Roger Pettersson <noname@tele2.se>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Thu, 02 Dec 2010 06:12:03 GMT) (full text, mbox, link).
Message #78 received at 426780@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
I use env -i to start php-cgi else php environment gets polluted by bash env.
One example is if you run pam-tmpdir things that uses TMPDIR will fail.
/etc/default/php-fastcgi
#
# Settings for php-cgi in external FASTCGI Mode
#
# Should php-fastcgi run automatically on startup? (default: no)
START=yes
# Init script verbose output.
# INIT_VERBOSE=yes
# Listen type (default: tcp)
PHP_FCGI_TYPE=tcp
# Which user runs PHP? (default: www-data)
PHP_FCGI_USER=www-data
# Host and TCP port for FASTCGI-Listener (default: localhost:9000)
PHP_FCGI_HOST=127.0.0.1
PHP_FCGI_PORT=9000
# Unix socket.
PHP_FCGI_SOCKET=/var/run/php-fastcgi/php-fastcgi.sock
# Environment variables, which are processed by PHP
PHP_FCGI_CHILDREN=3
PHP_FCGI_MAX_REQUESTS=1024
/etc/init.d/php-fastcgi
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fastcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description: Start and stop php-cgi in external FASTCGI mode
### END INIT INFO
# Author: Kurt Zankl <kz@xon.uni.cc> modified by bac0n <noname@tele2.se>.
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="php-cgi in external FASTCGI mode"
NAME=php-fastcgi
DAEMON=/usr/bin/php-cgi
PIDDIR=/var/run/php-fastcgi
PIDFILE=$PIDDIR/$NAME.pid
SOCKETDIR=/var/run/php-fastcgi
SCRIPTNAME=/etc/init.d/$NAME
ENV=/usr/bin/env
# Exit if the package is not installed.
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present.
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# If the daemon is not enabled, give the user a warning and then exit,
# unless we are stopping the daemon.
if [ "$START" != "yes" -a "$1" != "stop" ]; then
log_warning_msg "To enable $NAME, edit /etc/default/$NAME and set START=yes"
exit 0
fi
# Set up pid directory if it doesnt exists.
if [ ! -d "$PIDDIR" ]; then
[ "$VERBOSE" != "no" ] && log_begin_msg "Setting up pid directory"
mkdir -p $PIDDIR
chown ${PHP_FCGI_USER}.root $PIDDIR
[ "$VERBOSE" != "no" ] && log_end_msg 0
fi
# Daemon arguments.
if [ $PHP_FCGI_TYPE == "socket" ]; then
# Set up socket directory if it doesnt exists.
if [ ! -d "$SOCKETDIR" ]; then
[ "$VERBOSE" != "no" ] && log_begin_msg "Setting up socket directory"
mkdir -p $SOCKETDIR
chown ${PHP_FCGI_USER}.root $SOCKETDIR
[ "$VERBOSE" != "no" ] && log_end_msg 0
fi
DAEMON_ARGS="-q -b $PHP_FCGI_SOCKET"
else
DAEMON_ARGS="-q -b $PHP_FCGI_HOST:$PHP_FCGI_PORT"
fi
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
# Start with clean environment.
if [ $PHP_FCGI_TYPE == "socket" ]; then
start-stop-daemon --start --quiet --background --make-pidfile --chuid $PHP_FCGI_USER --pidfile $PIDFILE --exec $ENV -- -i \
PHP_FCGI_SOCKET=$PHP_FCGI_SOCKET \
PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN \
PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS \
$DAEMON $DAEMON_ARGS || return 2
else
start-stop-daemon --start --quiet --background --make-pidfile --chuid $PHP_FCGI_USER --pidfile $PIDFILE --exec $ENV -- -i \
PHP_FCGI_HOST=$PHP_FCGI_HOST \
PHP_FCGI_PORT=$PHP_FCGI_PORT \
PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN \
PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS \
$DAEMON $DAEMON_ARGS || return 2
fi
}
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE > /dev/null
[ $? -eq 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ $? -eq 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
# Return last error.
return $?
}
case "$1" in
start)
[ "$VERBOSE" != "no" ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
if [ "$VERBOSE" != "no" ]; then
case $? in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
fi
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
if [ "$VERBOSE" != "no" ]; then
case "$?" in
0|1) log_end_msg 0 ;;
2) log_end_msg 1 ;;
esac
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Thu, 02 Dec 2010 15:27:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Raphael Geissert <geissert@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Thu, 02 Dec 2010 15:27:03 GMT) (full text, mbox, link).
Message #83 received at 426780@bugs.debian.org (full text, mbox, reply):
On 2 December 2010 00:09, Roger Pettersson <noname@tele2.se> wrote:
> I use env -i to start php-cgi else php environment gets polluted by bash env.
> One example is if you run pam-tmpdir things that uses TMPDIR will fail.
Personally, I don't think I will be adding an init script for -cgi.
For most (all?) the cases where one wants to start the cgi on its own
what you want is -fpm (which has/had its own init script.)
This bug should probably be tagged as wontfix, but I'm gonna wait for
the input from the other team members.
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Thu, 02 Dec 2010 15:33:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Ondřej Surý <ondrej@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Thu, 02 Dec 2010 15:33:03 GMT) (full text, mbox, link).
Message #88 received at 426780@bugs.debian.org (full text, mbox, reply):
On Thu, Dec 2, 2010 at 16:24, Raphael Geissert <geissert@debian.org> wrote:
> On 2 December 2010 00:09, Roger Pettersson <noname@tele2.se> wrote:
>> I use env -i to start php-cgi else php environment gets polluted by bash env.
>> One example is if you run pam-tmpdir things that uses TMPDIR will fail.
>
> Personally, I don't think I will be adding an init script for -cgi.
> For most (all?) the cases where one wants to start the cgi on its own
> what you want is -fpm (which has/had its own init script.)
>
> This bug should probably be tagged as wontfix, but I'm gonna wait for
> the input from the other team members.
I was thinking about putting those two files to
/usr/share/doc/php5-cgi/examples/, they can be usefull for somebody,
but I don't think we should add this to the default installation.
O.
--
Ondřej Surý <ondrej@sury.org>
http://blog.rfc1925.org/
Information forwarded
to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#426780; Package php5-cgi.
(Thu, 02 Dec 2010 15:39:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Raphael Geissert <geissert@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>.
(Thu, 02 Dec 2010 15:39:03 GMT) (full text, mbox, link).
Message #93 received at 426780@bugs.debian.org (full text, mbox, reply):
On 2 December 2010 09:29, Ondřej Surý <ondrej@debian.org> wrote:
> I was thinking about putting those two files to
> /usr/share/doc/php5-cgi/examples/, they can be usefull for somebody,
> but I don't think we should add this to the default installation.
Yeah, that could work too. As long as we try to keep track of those
extra files that very few people use and that tend to get out of date
(like the paranoid php.ini which hasn't been updated for 5.3, AFAIR.)
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
Reply sent
to Ondřej Surý <ondrej@sury.org>:
You have taken responsibility.
(Sun, 10 Apr 2011 21:54:20 GMT) (full text, mbox, link).
Notification sent
to Kurt Zankl <kz@xon.uni.cc>:
Bug acknowledged by developer.
(Sun, 10 Apr 2011 21:54:20 GMT) (full text, mbox, link).
Message #98 received at 426780-done@bugs.debian.org (full text, mbox, reply):
Version: 5.3.5-1
FPM SAPI is now provided and recommended instead of php5-cgi FASTCGI Mode
Init script for php5-fpm is provided.
O.
--
Ondřej Surý <ondrej@sury.org>
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sun, 19 Jun 2011 07:35:54 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sun Jul 2 01:14:44 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.