Tuesday, March 5, 2013
a basic /etc/init.d/rserve (start Rserve at boot time)
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: rserve startup script
#
RSERVE=/usr/local/lib64/R/bin/Rserve
. /etc/rc.d/init.d/functions
test -f /etc/Rserv.conf
export R_HOME=/usr/local/lib64/R
RETVAL=0
case "$1" in
start)
echo -n "Starting Rserve: "
[ -f $RSERVE ] || exit 1
$RSERVE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rserve
;;
stop)
echo -n "Shutting down RServe: "
killproc $RSERVE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rserve
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
status)
status $RSERVE
RETVAL=$?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment