Using Runit and spawn-fcgi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am trying to use RT4 under nginx. I’m using the following command to
start it:

exec spawn-fcgi -n -u www-data -g www-data -a 127.0.0.1 -p 9000 –
/opt/rt4/sbin/rt-server.fcgi

If I run this command from the command line, it works. However if I
tell runit to execute the same command, I get bad gateway when trying
to create tickets. It does allow me to login and access the website
however.

There’s two points of weirdness I’m hoping I can get help
understanding. First, why am I able to access RT but not create
tickets, and second, why do I get different results using runit to
execute the script than if I run the script manually at the prompt?


Steven Hopps || steve.hopps@gmail.com
650-762-5466 || http://www.linkedin.com/in/shopps
PGP public key: Dropbox - File Deleted

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS0cFnAAoJEMbA/4/kCJKkFQkH/0Jv7r1NrdHZNzKy9ThTRi/K
/oq6IMrsW7UmKmIZCQFsdz3svoU6lAGwr3vAd1C2sIe/y7eH5heCVUQqUhchks/n
N5bySDUFeU8lRwL2t2nmqwGjzDA3WhRyboKkN327swDXeA3hhpXRG+KR3GPgozVH
dI3g9d9FKQ7fl1YZLtMrtu2eqmUDelrbIzNgPi1xXl0Iv4hqN4vkVCC6yfLeQwh4
2k2Tv1bme0321uPZuAqPmyLYr18QD7U3sNVMiQnBpwApikujb9ai8ANh19A1Hulu
tx6LTTGUU5f6dTXY0qREcTHNPnuLdQaBl3ZIiVDSknIJXXHJpIi3SeEeZAf15fA=
=Wd2k
-----END PGP SIGNATURE-----

Hello,

I am trying to use RT4 under nginx. I’m using the following command to
start it:

exec spawn-fcgi -n -u www-data -g www-data -a 127.0.0.1 -p 9000 –
/opt/rt4/sbin/rt-server.fcgi

If I run this command from the command line, it works. However if I
tell runit to execute the same command, I get bad gateway when trying
to create tickets. It does allow me to login and access the website
however.

On our system we are using an init script (etc/init.d/rt4) which does
the following to start RT4:

RTPATH="/opt/rt4/"
RTUSER=www-data
SOCKET_FILE=/opt/rt4/var/nginx/fcgi.sock

if you want to use a IP connection instead, please modify the su line

to start it with -p or --port option instead of the --socket one.
PID_FILE=/opt/rt4/var/nginx/fastcgi.pid

case $1 in
start)
echo -n "Starting RT: “
cd $RTPATH
export FCGI_SOCKET_PATH
RTUSER_GROUP=”id -gn $RTUSER 2>/dev/null"
if [ -n “$RTUSER_GROUP” ]
then
touch $PID_FILE $SOCKET_FILE;
chown $RTUSER:$RTUSER_GROUP $PID_FILE $SOCKET_FILE
fi
su $RTUSER -c “/opt/rt4/sbin/rt-server.fcgi --pidfile=$PID_FILE
–socket=$SOCKET_FILE 2> /dev/null” &
echo “Started.”
;;

There’s two points of weirdness I’m hoping I can get help
understanding. First, why am I able to access RT but not create
tickets, and second, why do I get different results using runit to
execute the script than if I run the script manually at the prompt?

Nicolas