Commit fb26933c authored by Dennis Waldron's avatar Dennis Waldron Committed by Steven Murray
Browse files

Initial Revision

parent 761d5f7d
#! /bin/sh
#
#/******************************************************************************
# rmcd.init
#
# This file is part of the Castor project.
# See http://castor.web.cern.ch/castor
#
# Copyright (C) 2003 CERN
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# @(#)$RCSfile: rmcd.init,v $ $Revision: 1.1 $ $Release$ $Date: 2009/07/23 12:18:46 $ $Author: waldron $
#
# chkconfig: 345 71 34
# description: RMC server daemon
#
# @author castor dev team
#*****************************************************************************/
# Source function library.
. /etc/rc.d/init.d/functions
# Variables
prog="rmcd"
RETVAL=0
# Source sysconfig files
if [ -f /etc/sysconfig/castor ]; then
. /etc/sysconfig/castor
fi
if [ -f /etc/sysconfig/$prog ]; then
. /etc/sysconfig/$prog
fi
start() {
# Run daemon
echo -n $"Starting $prog: "
cd /var/spool/rmc
daemon /usr/bin/$prog $RMCD_OPTIONS
# Write the pid to a file.
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
pid=`ps -eo pid,ppid,comm | egrep " 1 $prog\$" | awk '{print $1}'`
rm -f /var/run/$prog.pid
if [ -n "$pid" ]; then
echo $pid > /var/run/$prog.pid
RETVAL=0
else
RETVAL=1
fi
fi
[ $RETVAL -eq 0 ] && success $"$base startup" || failure $"$base startup"
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ -f /var/lock/subsys/$prog ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
restart() {
stop
start
}
# See how we were called
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $prog
RETVAL=$?
;;
restart)
restart
;;
condrestart)
[ -f /var/lock/subsys/$prog ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
exit $RETVAL
.\" @(#)$RCSfile: rmcd.man,v $ $Revision: 1.1 $ $Date: 2009/07/23 12:18:46 $ CERN IT-PDP/DM Jean-Philippe Baud
.\" Copyright (C) 2002 by CERN/IT/PDP/DM
.\" All rights reserved
.\"
.TH RMCD 8 "$Date: 2009/07/23 12:18:46 $" CASTOR "rmc Administrator Commands"
.SH NAME
rmcd \- start the Remote Media Changer daemon
.SH SYNOPSIS
.B rmcd
.I smc_ldr
.SH DESCRIPTION
.LP
The
.B rmcd
command starts the Remote Media Changer daemon.
This command is usually executed at system startup time
.RB ( /etc/rc.local ).
.LP
.I smc_ldr
is the picker device as defined in /dev.
.LP
If the Remote Media Changer daemon is not active,
the requests are automatically retried by the client API.
.LP
All error messages and statistical information are kept in a log.
.LP
The Remote Media Changer daemon listen port number can be defined on client
hosts and on the Remote Media Changer host itself in either of the following
ways:
.RS
.LP
setting an environment variable RMC_PORT
.RS
.HP
setenv RMC_PORT 5014
.RE
.LP
an entry in
.B /etc/castor/castor.conf
like:
.RS
.HP
RMC PORT 5014
.RE
.LP
an entry in
.B /etc/services
like:
.RS
.HP
rmc 5014/tcp # CASTOR Remote Media Changer
.RE
.RE
.LP
If none of these methods is used, the default port number is taken from the
definition of RMC_PORT in rmc_constants.h.
.LP
The Remote Media Changer host name can be defined on client hosts
in either of the following ways:
.RS
.LP
setting an environment variable RMC_HOST, for example:
.RS
.HP
setenv RMC_HOST castor5
.RE
.LP
an entry in
.B /etc/castor/castor.conf
for example:
.RS
.HP
RMC HOST castor5
.RE
.RE
.LP
If none of these methods is used, the default host is the local host.
.LP
In the log each entry has a timestamp.
For each user command there is one message RMC92 giving information about
the requestor (hostname, uid, gid) and one message RMC98 giving the command
itself.
The completion code of the command is also logged.
.SH FILES
.TP 1.5i
.B /var/spool/rmc/log
.SH EXAMPLES
.TP
Here is a small log:
.nf
12/06 11:40:58 7971 rmc_srv_mount: RMC92 - mount request by 0,0 from tpsrv015.cern.ch
12/06 11:40:58 7971 rmc_srv_mount: RMC98 - mount 000029/0 on drive 2
12/06 11:41:08 7971 rmc_srv_mount: returns 0
12/06 11:42:43 7971 rmc_srv_unmount: RMC92 - unmount request by 0,0 from tpsrv015.cern.ch
12/06 11:42:43 7971 rmc_srv_unmount: RMC98 - unmount 000029 2 0
12/06 11:42:48 7971 rmc_srv_unmount: returns 0
.fi
.SH AUTHOR
\fBCASTOR\fP Team <castor.support@cern.ch>
# Options to pass to the rmc daemon
#RMCD_OPTIONS=
# Should we run with another limit on the core file size other than the default?
DAEMON_COREFILE_LIMIT=unlimited
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment