Tuesday 5 July 2011

GridFTP on Gentoo

The Globus Project provides gridftp as one of the modules of its toolkit. I got the source and followed the quickstart guide to start the installation. However, the guide tells you how to run myproxy-server and globus-gridftp-server as xinet daemons. Although Gentoo provides xinetd package, that is not their preferred way of handling daemons. They use their own init scripts. So, I have tried to do it their way. My first script was for myproxy-server.

#!/sbin/runscript

start() {
    ebegin "Starting myproxy-server"
    start-stop-daemon --start --exec /home/titu/soc/gt/sbin/myproxy-server    eend $?
}

stop() {
    ebegin "Stopping myproxy-server"
    start-stop-daemon --stop --exec /home/titu/soc/gt/sbin/myproxy-server
    eend $?
}


My next script was for starting globus-gridftp-server as a daemon; however this process has having problems when I tried it the way I did for myproxy-server. Sometimes start-stop-daemon was not returning and sometimes start-stop-daemon was unable to stop. I tried to store PID values in a pid file by asking start-stop-daemon to create the pidfile by using -m option. However, it turned out that the PID in the pidfile was always slightly less than the actual PID. It was most likely because of forking. So, I modified the script using killall.

#!/sbin/runscript

start() {
    ebegin "Starting globus-gridftp-server"
    start-stop-daemon --start -b -e GLOBUS_LOCATION=/home/titu/soc/gt -e LD_LIBRARY_PATH=/home/titu/soc/gt/lib --exec /home/titu/soc/gt/sbin/globus-gridftp-server -- -S -f -p 2811
    eend $?
}

stop() {
    ebegin "Stopping globus-gridftp-server"
    killall globus-gridftp-server
    eend $?
}


It is essential to set environment variables for the gridftp server.

No comments: