File: Cns_selectsrvr.man

package info (click to toggle)
lfc-postgres 1.7.4.7-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 13,676 kB
  • ctags: 10,779
  • sloc: ansic: 146,136; sh: 13,176; perl: 11,142; python: 5,529; cpp: 5,113; sql: 1,790; makefile: 861; fortran: 113
file content (137 lines) | stat: -rw-r--r-- 2,632 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
.\" @(#)$RCSfile: Cns_selectsrvr.man,v $ $Revision: 1.1.1.1 $ $Date: 2001/10/04 12:12:49 $ CERN IT-PDP/DM Jean-Philippe Baud
.\" Copyright (C) 2000 by CERN/IT/PDP/DM
.\" All rights reserved
.\"
.TH CNS_SELECTSRVR 3 "$Date: 2001/10/04 12:12:49 $" CASTOR "Cns Library Functions"
.SH NAME
Cns_selectsrvr \- select the CASTOR Name Server
.SH SYNOPSIS
.BI "int Cns_selectsrvr (char *" path ,
.BI "char *" current_directory_server ,
.BI "char *" server ,
.BI "char **" actual_path );
.SH DESCRIPTION
.B Cns_selectsrvr
selects the CASTOR Name Server.
.LP
The name server host name is selected according to the following rules:
.RS
.LP
if
.I path
is in the form
.IR server:pathname ,
.I server
is used else
.LP
if the environment variable CNS_HOST is set, its value is used as server name
else
.LP
if an entry for CNS HOST exists in the configuration file
.BR /etc/shift.conf ,
the corresponding value is used else
.LP
if
.I path
is an absolute path and contains at least 3 components,
the second component of the pathname is the domain name and the third component
is prefixed by the value of
.B CnsHostPfx
(defined in
.BR site.def )
to give the hostname or its alias else
.LP
the Name Server running on the local machine is used.
.RE
.SH EXAMPLES
.LP
1)
.I path
is
castor1:/castor/cern.ch/user/b/baud/test
.br
.I server
will be
castor1
and
.I actual_path will be
/castor/cern.ch/user/b/baud/test
.LP
2) The environment variable has been set using
.RS
setenv CNS_HOST castor5
.RE
and
.I path 
is
/castor/cern.ch/user/b/baud/test
.br
.I server
will be
castor5
and
.I actual_path will be
/castor/cern.ch/user/b/baud/test
.LP
3) The environment varaible is not set, but there is an entry in
.B /etc/shift.conf
like
.RS
CNS	HOST	castor2
.RE
and
.I path 
is
/castor/cern.ch/user/b/baud/test
.br
.I server
will be
castor2
and
.I actual_path will be
/castor/cern.ch/user/b/baud/test
.LP
4) The environment variable is not set, there is no entry in
.BR /etc/shift.conf,
NsHostPfx is defined as
.B cns
in
.B site.def
and
.I path 
is
/castor/cern.ch/user/b/baud/test
.br
.I server
will be
cnsuser
and
.I actual_path will be
/castor/cern.ch/user/b/baud/test
.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.3i
.B EFAULT
.IR path ,
.I server
or
.I actual_path
is NULL.
.TP
.B EINVAL
the server name is too long.
.SH FILES
.TP 1.3i
.B /etc/shift.conf
CASTOR global configuration file
.TP
.B site.def
site specific CASTOR compilation options
.SH SEE ALSO
.BR Castor_limits(4)
.SH AUTHOR
\fBCASTOR\fP Team <castor.support@cern.ch>