[rt-users] Using Runit and spawn-fcgi

Nicolas Roosen nicolas.roosen at gmail.com
Mon Jan 13 05:09:36 EST 2014


Hello,

On 11/01/2014 11:10 PM, Steven Hopps wrote:
> 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



More information about the rt-users mailing list