Install RServe

Download the RServe service from the following RServe web site:
http://www.rforge.net/Rserve/files/

Refer to the installation documentation at http://www.rforge.net/Rserve/doc.html for detailed information about how to install the service.

Note: RServe and the DSB component must be installed on the same server. Also, do not install RServe from CRAN by using the R install.packages command, because the version on CRAN often is out of date.

To install RServe:

  1. Download the Rserve_0.5-<version>.tar.gz package, place it in the current R directory and execute the following command as the root user:
    R CMD INSTALL Rserve_0.5-X.tar.gz
  2. Create a configuration file to define the following:
    • Assign the directory in which RServe will store temporary files.
    • Assign the communication port on which Rserve will accept connections.
    • Assign the user account under which the daemon will run. 

      Make sure that the user account has write permission in both the temp directory and the DSB temp directory tree, /tmp/VDC.
    • Choose the account password.

    See the example RServe /etc/Rserv.conf configuration file.
    The file /etc/Rserv.pwd stores the RServe access username and password. Note that these do not constitute a UNIX login username and password; these credentials are used by RServe only and cannot be used to open a shell on the system if compromised. An example /etc/Rserv.pwd file is:
    <account> <password>
    For more information on RServe configuration parameters, refer to the RServe documentation at http://www.rforge.net/Rserve/doc.html.

  3. Start the RServe daemon. 
Type the following:
    R CMD Rserve
  4. Create a startup file to make sure that RServe starts at boot time.

The Rserv.conf File

workdir /tmp/Rserv
pwdfile /etc/Rserv.pwd
remote enable
auth required
plaintext disable
fileio enable

port <port number>
maxinbuf 262144

maxsendbuf 0
uid 48

The RServe Startup File

#! /bin/sh
# chkconfig: 2345 99 01
# description: Rserve, /etc/init.d/rserve

case "$1" in
  start)
        echo -n "Starting Rserve daemon: "
        R CMD Rserve
        echo "."
        ;;
  stop)
        echo -n "Stopping Rserve daemon: "
        killall -s 9 Rserve
        echo "."
        ;;
  restart)
        echo -n "Stopping Rserve daemon: "
        killall -s 9 Rserve
        echo "."
        echo -n "Starting Rserve daemon: "
        R CMD Rserve
        echo "."
        ;;
  *)
        echo "Usage: /etc/init.d/rserve {start|stop|restart}"
        exit 1
esac

exit 0