From 6ccf05630bc482dcbfacae98021db7211a3c7113 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Baud <baud@cern.ch> Date: Fri, 6 Dec 2002 15:58:33 +0000 Subject: [PATCH] Initial release --- mediachanger/castorrmc/rmc/rmc_dismount.man | 70 +++++++++++++ mediachanger/castorrmc/rmc/rmc_export.man | 60 +++++++++++ .../castorrmc/rmc/rmc_find_cartridge.man | 89 +++++++++++++++++ .../castorrmc/rmc/rmc_get_geometry.man | 70 +++++++++++++ mediachanger/castorrmc/rmc/rmc_import.man | 60 +++++++++++ mediachanger/castorrmc/rmc/rmc_mount.man | 72 ++++++++++++++ .../castorrmc/rmc/rmc_read_elem_status.man | 84 ++++++++++++++++ mediachanger/castorrmc/rmc/rmc_seterrbuf.man | 18 ++++ mediachanger/castorrmc/rmc/rmcdaemon.man | 99 +++++++++++++++++++ 9 files changed, 622 insertions(+) create mode 100644 mediachanger/castorrmc/rmc/rmc_dismount.man create mode 100644 mediachanger/castorrmc/rmc/rmc_export.man create mode 100644 mediachanger/castorrmc/rmc/rmc_find_cartridge.man create mode 100644 mediachanger/castorrmc/rmc/rmc_get_geometry.man create mode 100644 mediachanger/castorrmc/rmc/rmc_import.man create mode 100644 mediachanger/castorrmc/rmc/rmc_mount.man create mode 100644 mediachanger/castorrmc/rmc/rmc_read_elem_status.man create mode 100644 mediachanger/castorrmc/rmc/rmc_seterrbuf.man create mode 100644 mediachanger/castorrmc/rmc/rmcdaemon.man diff --git a/mediachanger/castorrmc/rmc/rmc_dismount.man b/mediachanger/castorrmc/rmc/rmc_dismount.man new file mode 100644 index 0000000000..696c0044a7 --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_dismount.man @@ -0,0 +1,70 @@ +.\" @(#)$RCSfile: rmc_dismount.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:31 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_DISMOUNT 3 "$Date: 2002/12/06 15:58:31 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_dismount \- send a request to the Remote Media Changer daemon to have a volume dismounted +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_dismount (char *" server , +.BI "char *" smc_ldr , +.BI "char *" vid , +.BI "int " drvord , +.BI "int " force ); +.SH DESCRIPTION +.B rmc_dismount +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to dismount the volume +.I vid +from the drive specified by +.IR drvord . +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I vid +is the volume visual identifier. +It must be at most six characters long. +.TP +.I drvord +specifies the drive ordinal in the robot. +.TP +.I force +tells the daemon to dismount without checking the vid. +.LP +This function requires TP_SYSTEM privilege in the Cupv database. +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader or vid too long or invalid drive ordinal or +requester does not have TP_SYSTEM privilege in the Cupv database. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error or Medium Removal Prevented. +.SH SEE ALSO +.BR rmc_get_geometry(3) , +.BR Cupvlist(1) , +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_export.man b/mediachanger/castorrmc/rmc/rmc_export.man new file mode 100644 index 0000000000..192f265e6f --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_export.man @@ -0,0 +1,60 @@ +.\" @(#)$RCSfile: rmc_export.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:32 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_EXPORT 3 "$Date: 2002/12/06 15:58:32 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_export \- send a request to the Remote Media Changer daemon to have a volume exported/ejected from the robot +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_export (char *" server , +.BI "char *" smc_ldr , +.BI "char *" vid ); +.SH DESCRIPTION +.B rmc_export +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to export the volume +.IR vid . +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I vid +is the volume visual identifier. +It must be at most six characters long. +.LP +This function requires TP_OPER privilege in the Cupv database. +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader or vid too long or +requester does not have TP_OPER privilege in the Cupv database. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error or Medium Removal Prevented. +.SH SEE ALSO +.BR rmc_get_geometry(3) , +.BR Cupvlist(1) , +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_find_cartridge.man b/mediachanger/castorrmc/rmc/rmc_find_cartridge.man new file mode 100644 index 0000000000..755249e50f --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_find_cartridge.man @@ -0,0 +1,89 @@ +.\" @(#)$RCSfile: rmc_find_cartridge.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:32 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_FIND_CARTRIDGE 3 "$Date: 2002/12/06 15:58:32 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_find_cartridge \- send a request to the Remote Media Changer daemon to find volume(s) in the robot +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_find_cartridge (char *" server , +.BI "char *" smc_ldr , +.BI "char *" template , +.BI "int " type , +.BI "int " startaddr , +.BI "int " nbelem , +.BI "struct smc_element_info *" element_info ); +.SH DESCRIPTION +.B rmc_find_cartridge +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to find the volume(s) identified by +.IR pattern . +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I pattern +to be matched with the volume visual identifier. +It must be at most 40 characters long. +.TP +.I type +gives the element type: 0 means all element types, 1 corresponds to the hand, +2 to the storage cells, 3 to the import/export door (CAP) and 4 to the drives. +.TP +.I startaddr +specifies the lowest element address to be searched. +.TP +.I nbelem +gives the maximum number of entries to be returned +.TP +.I element_info +gives the address of the buffer allocated by the calling program to receive the +reply. +.PP +.nf +.ft CW +struct smc_element_info { + int element_address; + int element_type; + int state; /* element descriptor byte 2 */ + unsigned char asc; + unsigned char ascq; + int flags; /* element descriptor byte 9 */ + int source_address; + char name[9]; +}; +.ft +.fi +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader or pattern too long. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error. +.SH SEE ALSO +.BR rmc_get_geometry(3) , +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_get_geometry.man b/mediachanger/castorrmc/rmc/rmc_get_geometry.man new file mode 100644 index 0000000000..04d7755890 --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_get_geometry.man @@ -0,0 +1,70 @@ +.\" @(#)$RCSfile: rmc_get_geometry.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:33 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_GET_GEOMETRY 3 "$Date: 2002/12/06 15:58:33 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_get_geometry \- send a request to the Remote Media Changer daemon to get the robot geometry +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_get_geometry (char *" server , +.BI "char *" smc_ldr , +.BI "struct robot_info *" robot_info ); +.SH DESCRIPTION +.B rmc_get_geometry +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to get the robot geometry. +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I robot_info +gives the address of the buffer allocated by the calling program to receive the +reply. +.PP +.nf +.ft CW +struct robot_info { + char inquiry[32]; + int transport_start; + int transport_count; + int slot_start; + int slot_count; + int port_start; + int port_count; + int device_start; + int device_count; +}; +.ft +.fi +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error. +.SH SEE ALSO +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_import.man b/mediachanger/castorrmc/rmc/rmc_import.man new file mode 100644 index 0000000000..671ea1ff01 --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_import.man @@ -0,0 +1,60 @@ +.\" @(#)$RCSfile: rmc_import.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:33 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_IMPORT 3 "$Date: 2002/12/06 15:58:33 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_import \- send a request to the Remote Media Changer daemon to have a volume imported/injected into the robot +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_import (char *" server , +.BI "char *" smc_ldr , +.BI "char *" vid ); +.SH DESCRIPTION +.B rmc_import +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to import the volume +.IR vid . +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I vid +is the volume visual identifier. +It must be at most six characters long. +.LP +This function requires TP_OPER privilege in the Cupv database. +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader or vid too long or +requester does not have TP_OPER privilege in the Cupv database. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error or Medium Removal Prevented. +.SH SEE ALSO +.BR rmc_get_geometry(3) , +.BR Cupvlist(1) , +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_mount.man b/mediachanger/castorrmc/rmc/rmc_mount.man new file mode 100644 index 0000000000..8ba71ccdf2 --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_mount.man @@ -0,0 +1,72 @@ +.\" @(#)$RCSfile: rmc_mount.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:33 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_MOUNT 3 "$Date: 2002/12/06 15:58:33 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_mount \- send a request to the Remote Media Changer daemon to have a volume mounted +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_mount (char *" server , +.BI "char *" smc_ldr , +.BI "char *" vid , +.BI "int " side , +.BI "int " drvord ); +.SH DESCRIPTION +.B rmc_mount +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to mount the volume +.I vid +on the drive specified by +.IR drvord . +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I vid +is the volume visual identifier. +It must be at most six characters long. +.TP +.I side +is an integer specifying the side number. +This field is only used if the specified device offers several sides, +for example a DVD. +.TP +.I drvord +specifies the drive ordinal in the robot. +.LP +This function requires TP_SYSTEM privilege in the Cupv database. +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader or vid too long or invalid drive ordinal or +requester does not have TP_SYSTEM privilege in the Cupv database. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error or Medium Removal Prevented. +.SH SEE ALSO +.BR rmc_get_geometry(3) , +.BR Cupvlist(1) , +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_read_elem_status.man b/mediachanger/castorrmc/rmc/rmc_read_elem_status.man new file mode 100644 index 0000000000..2e64be5288 --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_read_elem_status.man @@ -0,0 +1,84 @@ +.\" @(#)$RCSfile: rmc_read_elem_status.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:33 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_READ_ELEM_STATUS 3 "$Date: 2002/12/06 15:58:33 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_read_elem_status \- send a request to the Remote Media Changer daemon to read element(s) status in the robot +.SH SYNOPSIS +.B #include <sys/types.h> +.br +\fB#include "rmc_api.h"\fR +.sp +.BI "int rmc_read_elem_status (char *" server , +.BI "char *" smc_ldr , +.BI "int " type , +.BI "int " startaddr , +.BI "int " nbelem , +.BI "struct smc_element_info *" element_info ); +.SH DESCRIPTION +.B rmc_read_elem_status +asks the Remote Media Changer server running on +.I server +and connected to the picker +.I smc_ldr +to get the status of the elements of type +.IR type . +.TP +.I server +specifies the Remote Media Changer to be contacted. +.TP +.I smc_ldr +is the picker device as defined in /dev. +.TP +.I type +gives the element type: 0 means all element types, 1 corresponds to the hand, +2 to the storage cells, 3 to the import/export door (CAP) and 4 to the drives. +.TP +.I startaddr +specifies the lowest element address to be searched. +.TP +.I nbelem +gives the maximum number of entries to be returned +.TP +.I element_info +gives the address of the buffer allocated by the calling program to receive the +reply. +.PP +.nf +.ft CW +struct smc_element_info { + int element_address; + int element_type; + int state; /* element descriptor byte 2 */ + unsigned char asc; + unsigned char ascq; + int flags; /* element descriptor byte 9 */ + int source_address; + char name[9]; +}; +.ft +.fi +.SH RETURN VALUE +This routine returns 0 if the operation was successful or -1 if the operation +failed. In the latter case, +.B serrno +is set appropriately. +.SH ERRORS +.TP 1.2i +.B SECOMERR +Communication error. +.TP +.B ERMCUNREC +Unknown host or invalid loader. +.TP +.B ERMCFASTR +Unit attention. +.TP +.B ERMCOMSGR +Hardware error. +.SH SEE ALSO +.BR rmc_get_geometry(3) , +.B smc(1) +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmc_seterrbuf.man b/mediachanger/castorrmc/rmc/rmc_seterrbuf.man new file mode 100644 index 0000000000..565ca156cf --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmc_seterrbuf.man @@ -0,0 +1,18 @@ +.\" @(#)$RCSfile: rmc_seterrbuf.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:33 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMC_SETERRBUF 3 "$Date: 2002/12/06 15:58:33 $" CASTOR "rmc Library Functions" +.SH NAME +rmc_seterrbuf \- set receiving buffer for error messages +.SH SYNOPSIS +.BI "void rmc_seterrbuf (char *" buffer , +.BI "int " buflen ) +.SH DESCRIPTION +.B rmc_seterrbuf +tells the Remote Media Changer client API the address and the size of the buffer +to be used for error messages. If this routine is not called, the messages +are printed on +.BR stderr . +.SH AUTHOR +\fBCASTOR\fP Team <castor.support@cern.ch> diff --git a/mediachanger/castorrmc/rmc/rmcdaemon.man b/mediachanger/castorrmc/rmc/rmcdaemon.man new file mode 100644 index 0000000000..644bca7c16 --- /dev/null +++ b/mediachanger/castorrmc/rmc/rmcdaemon.man @@ -0,0 +1,99 @@ +.\" @(#)$RCSfile: rmcdaemon.man,v $ $Revision: 1.1 $ $Date: 2002/12/06 15:58:33 $ CERN IT-PDP/DM Jean-Philippe Baud +.\" Copyright (C) 2002 by CERN/IT/PDP/DM +.\" All rights reserved +.\" +.TH RMCDAEMON 1 "$Date: 2002/12/06 15:58:33 $" CASTOR "rmc Administrator Commands" +.SH NAME +rmcdaemon \- start the Remote Media Changer daemon +.SH SYNOPSIS +.B rmcdaemon +.I smc_ldr +.SH DESCRIPTION +.LP +The +.B rmcdaemon +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/shift.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/shift.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 /usr/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> -- GitLab