pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/45689: www/spawn-fcgi: add '_interpreter' variable to rc script



>Number:         45689
>Category:       pkg
>Synopsis:       www/spawn-fcgi: add '_interpreter' variable to rc script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 05 20:45:00 +0000 2011
>Originator:     Matthias Rampke
>Release:        DragonFlyBSD HEAD
>Organization:
>Environment:
DragonFly grade.so 2.13-DEVELOPMENT DragonFly v2.13.0.451.g34910-DEVELOPMENT 
#1: Sat Dec  3 22:32:37 CET 2011     
matthias%grade.so@localhost:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
>Description:
The rc script for spawn-fcgi does not pass an interpreter to rc.subr's 
check_pid, causing the PID check (and thus e.g. stopping the corresponding 
spawnfcgi job) to fail if it is a #! script (e.g. #!/usr/pkg/bin/python2.7, in 
my case).

The patch below simply adds a spawnfcgi_${job}_interpreter variable that is 
passed to check_pid on a per-job-basis. For non-script jobs it need not be 
specified, thus current behaviour will remain unchanged unless this variable is 
set.
>How-To-Repeat:
in rc.conf:
spawnfcgi_enable="YES"
spawnfcgi_jobs="foo"
spawnfcgi_foo_command="/path/to/some/python/fastcgi/script"
spawnfcgi_fcgiwrap_socket="/tmp/foo.sock"


where "/path/to/some/python/fastcgi/script" is executable with a

#!/usr/pkg/bin/python2.7

header, then

/etc/rc.d/spawnfcgi start
/etc/rc.d/spawnfcgi stop

>Fix:
diff --git a/www/spawn-fcgi/files/spawnfcgi.sh 
b/www/spawn-fcgi/files/spawnfcgi.sh
index ba391ac..4e73973 100644
--- a/www/spawn-fcgi/files/spawnfcgi.sh
+++ b/www/spawn-fcgi/files/spawnfcgi.sh
@@ -19,7 +19,8 @@ spawnfcgi_pid()
 {
        pidfile=${pidfile_base}$1
        job_command=$(eval echo \$${name}_${job}_command)
-       rc_pid=`check_pidfile "$pidfile" $job_command`
+        job_interpreter=$(eval echo \$${name}_${job}_interpreter)
+       rc_pid=`check_pidfile "$pidfile" $job_command $job_interpreter`
 }
 
 spawnfcgi_start()



Home | Main Index | Thread Index | Old Index