| 1 |
*********************************************************** |
| 2 |
*********************************************************** |
| 3 |
|
| 4 |
INSTALLATION of the Acedb-server |
| 5 |
|
| 6 |
July 18, 1995 (revised dec 98) |
| 7 |
SCCS: $Id: SERVER.INSTALLATION,v 1.9 2001/02/15 10:08:28 edgrif Exp $ |
| 8 |
|
| 9 |
This documentation was written by |
| 10 |
[email protected] |
| 11 |
[email protected] |
| 12 |
[email protected] |
| 13 |
|
| 14 |
For more information you can try: |
| 15 |
http://probe.nalusda.gov:8000/acedocs |
| 16 |
hhtp://alpha.crbm.cnrs-mop.fr |
| 17 |
|
| 18 |
*********************************************************** |
| 19 |
|
| 20 |
Usage, in foreground mode: |
| 21 |
|
| 22 |
aceserver database_path -port decimal_port_number \ |
| 23 |
-time_out client_time_out_in_seconds \ |
| 24 |
-server_time_out server_time_out_in_seconds |
| 25 |
|
| 26 |
ATTENTION, to run as a daemon, the code must be aliased as |
| 27 |
rpc.xxx |
| 28 |
|
| 29 |
*********************************************************** |
| 30 |
|
| 31 |
A: Create a database: |
| 32 |
|
| 33 |
1) First of all create a directory <database> which must at least |
| 34 |
contain a subdirectory database and a subdirectory wspec, and |
| 35 |
fill up the wspec directory, for example with a copy of the |
| 36 |
c.elegans wspec. |
| 37 |
|
| 38 |
2) Then run tace in this directory to initialise and fill the |
| 39 |
database with some data. |
| 40 |
|
| 41 |
3) Create a world readable 777 directory (for example /home/acelock) |
| 42 |
and edit accordingly the self-documented file wspec/server.wrm |
| 43 |
This file is necessary during client authentification. |
| 44 |
|
| 45 |
You can now start the server. |
| 46 |
|
| 47 |
*********************************************************** |
| 48 |
*********************************************************** |
| 49 |
|
| 50 |
B: Start the server or alternativelly register it |
| 51 |
|
| 52 |
|
| 53 |
NOTE that the portmap system daemon MUST be running for the |
| 54 |
server and client to be able to communicate. |
| 55 |
|
| 56 |
|
| 57 |
B1: Running in foreground: |
| 58 |
|
| 59 |
The port number is not necessary in foreground mode and the various |
| 60 |
time-outs default to 10 minutes which is probably reasonable. Hence |
| 61 |
you may start the server on the machine <host> with the simplified |
| 62 |
command: |
| 63 |
|
| 64 |
aceserver <database> |
| 65 |
|
| 66 |
or equivalently: |
| 67 |
|
| 68 |
setenv ACEDB <database> ; aceserver |
| 69 |
|
| 70 |
Where <database can be . (here), a relative or an absolute path. |
| 71 |
You then start the client anywhere on the network with the command: |
| 72 |
|
| 73 |
aceclient -access_info <host> |
| 74 |
|
| 75 |
the -access_info option will report eventual problems with the |
| 76 |
connection or the configuration of the file wspec/server.wrm |
| 77 |
|
| 78 |
*********************************************************** |
| 79 |
|
| 80 |
B2: Registering the server as a service: |
| 81 |
|
| 82 |
|
| 83 |
NOTE that the inetd system daemon must be running for this |
| 84 |
example to work. |
| 85 |
|
| 86 |
|
| 87 |
You need root access. |
| 88 |
|
| 89 |
1) Create a user account for the user that will run the program |
| 90 |
(in the following examples, 'aceserv') |
| 91 |
|
| 92 |
2) Link the aceserver executable in /usr/local/bin as rpc.acedbd |
| 93 |
The user created in step 1. must have execute permission on rpc.acedbd. |
| 94 |
|
| 95 |
cd /usr/local/bin ; ln -s <full_path_to/aceserver> rpc.acedbd |
| 96 |
|
| 97 |
3) Register your database, port, and program in /etc/rpc |
| 98 |
|
| 99 |
Examples: |
| 100 |
acedb 20000114 rpc.acedbd |
| 101 |
aboutdb 20000115 rpc.acedbd |
| 102 |
aatdb 20000116 rpc.acedbd |
| 103 |
|
| 104 |
You need one RPC port number (RPCPN) for each database you want to run. |
| 105 |
|
| 106 |
3) At least on Solaris, register your database in /etc/services |
| 107 |
|
| 108 |
Examples: |
| 109 |
acedb 20000114/tcp rpc.acedbd |
| 110 |
aboutdb 20000115/tcp rpc.acedbd |
| 111 |
aatdb 20000116/tcp rpc.acedbd |
| 112 |
|
| 113 |
You need one RPC port number (RPCPN) for each database you want to run. |
| 114 |
|
| 115 |
5) In /etc/inetd.conf add a line for each server. The format is: |
| 116 |
|
| 117 |
<databasename>/<version> stream rpc/tcp wait <user> <path> |
| 118 |
rpc.acedbd <DB_path> <port> <cto>:<sto>:<chunk> |
| 119 |
|
| 120 |
Where: |
| 121 |
|
| 122 |
<databasename> is the datbase name (port number on solaris) as entered in /etc/rpc |
| 123 |
<version> currently 1 |
| 124 |
<user> the username created in step: aceserv |
| 125 |
<path> the full path to the executable (or to the link) |
| 126 |
<DB_path> the full path to the database |
| 127 |
<port> the same port as was entered in /etc/rpc |
| 128 |
<cto> Client timeout. Time that a connection with an inactive client is kept open |
| 129 |
<sto> Server timeout. Time that the server stays alive, when no client connections are active |
| 130 |
<chunk> Maximum chunk size sent by server to client in kilobytes (0 means no limit) |
| 131 |
|
| 132 |
Examples: |
| 133 |
acedb/1 stream rpc/tcp wait aceserv /usr/local/bin/rpc.acedbd rpc.acedbd /acedb/worm 20000114 600:600:0 |
| 134 |
aboutdb/1 stream rpc/tcp wait aceserv /usr/local/bin/rpc.acedbd rpc.acedbd /acedb/aboutdb 20000115 600:600:0 |
| 135 |
aatdb/1 stream rpc/tcp wait aceserv /usr/local/bin/rpc.acedbd rpc.acedbd /acedb/aatdb 20000116 600:600:0 |
| 136 |
|
| 137 |
On solaris use the port number: |
| 138 |
20000114/1 stream rpc/tcp wait aceserv /usr/local/bin/rpc.acedbd rpc.acedbd /acedb/worm 20000114 600:600:0 |
| 139 |
|
| 140 |
6) Restart portmap then inetd by sending HANGUP signal to both of |
| 141 |
them , e.g. 'kill -HUP ' where PID is the |
| 142 |
process id of portmap then inetd. (or reboot your machine). |
| 143 |
|
| 144 |
If an aceclient is started to connect to your server machine with a |
| 145 |
port from the one's you created, the corresponding server will be |
| 146 |
started, and stay alive as long as there are active clients. If all |
| 147 |
clients are disconnected and the server timeout has elapsed, the server |
| 148 |
will shut itself down. A timeout = 0 (as set on the command line) will |
| 149 |
prevent shutdown (but this is not advisable). The default timeout is |
| 150 |
600 seconds. |
| 151 |
|
| 152 |
*********************************************************** |
| 153 |
*********************************************************** |
| 154 |
|
| 155 |
C: Running the client |
| 156 |
|
| 157 |
C1: C-aceclient |
| 158 |
|
| 159 |
Usage: aceclient <host> [-port <RPCN>] [-time_out <nn>] [-ace_out] [-ace_in] [-f file_name parms] |
| 160 |
|
| 161 |
host: is a machine where the server runs or is a registered service. |
| 162 |
RPCN: is the /etc/rpc program number of the service described in section B2. |
| 163 |
nn: is a number of seconds to receive a server answer, it defaults to 300. |
| 164 |
-ace_out: implies a clean output: .ace files or clean tables |
| 165 |
-ace_in: if the input to the client is an ace file to be parsed by the server. |
| 166 |
-f filename: say for mailing, a command file which is echoed on stdout except |
| 167 |
that %1 %2 ... %9 will be macro substituted by the parms parameters and |
| 168 |
that the construction %(xxx) where xxx is a client command will be evaluated |
| 169 |
|
| 170 |
C2: Perl-client |
| 171 |
|
| 172 |
You are encourage to down load and use the AcePerl module and AceBrowser |
| 173 |
available, with their documentation at http://stein.cshl.org |
| 174 |
|
| 175 |
The installation is detailled in the README of AcePerl but boils down to |
| 176 |
|
| 177 |
can write a perl client by including the perl access routines that we provide |
| 178 |
in your code. The ace command show -perl will then export the ace object as |
| 179 |
tree-like Perl5 constructs. |
| 180 |
perl Makefile.PL # to create a makefiel adapted to your machine |
| 181 |
make # to compile AcePerl |
| 182 |
make test #runs a test suite agains the ce.elegans server |
| 183 |
make install # you need to be root, transfers AcePerl to /usr/local.. |
| 184 |
|
| 185 |
|
| 186 |
The core functionality of the AcePerl is encapsulated in the following subroutine. |
| 187 |
This is all that is required to retrieve an Ace object |
| 188 |
and turn it into a browsable HTML page: |
| 189 |
|
| 190 |
sub display_object { |
| 191 |
my ($name,$class) = @_; |
| 192 |
my $obj = $DB->fetch($class,$name) || die "Couldn't find $name"; |
| 193 |
print |
| 194 |
start_html(-title=>"$class: $obj"), |
| 195 |
h1("$class: $obj"), |
| 196 |
$obj->asHTML, |
| 197 |
hr, |
| 198 |
address(a{href=>'mailto:[email protected]'},'Lincoln D. Stein'), |
| 199 |
end_html; |
| 200 |
} |
| 201 |
|
| 202 |
To see the full documentation, after installation, type the command |
| 203 |
|
| 204 |
perldoc Ace | lpr |
| 205 |
|
| 206 |
C3: Webace, Webace, the former PerlInterface to acedb is now considered obsolete |
| 207 |
|
| 208 |
*********************************************************** |
| 209 |
*********************************************************** |
| 210 |
** TROUBLE SHOOTING GUIDE |
| 211 |
|
| 212 |
There are several problems with rpc on several machines |
| 213 |
when the code is registered under inetd |
| 214 |
|
| 215 |
|
| 216 |
The system is known to run very well on |
| 217 |
dec alpha |
| 218 |
linux |
| 219 |
sun (not tested for several years) |
| 220 |
solaris (using the patch at compile time given below) |
| 221 |
|
| 222 |
On sgi: it may depend on the exact os versio, try to recompile |
| 223 |
|
| 224 |
It is not guaranteed on other unix platforms |
| 225 |
if you have the occasion of testing another machine, let me know. |
| 226 |
Acedb should compile and run on any unix platform and, except for inetd |
| 227 |
registration, has been tested at least on |
| 228 |
ibm, hp, fujitsu, nec, and convex |
| 229 |
|
| 230 |
------------------------------------------------------------ |
| 231 |
|
| 232 |
An rpc registration problem is characterized as follows |
| 233 |
tace works (stand alone acedb) |
| 234 |
otherwise, you probably need to edit the wspec directory |
| 235 |
aceserver started in foreground accepts conection from aceclient |
| 236 |
otherwise, you probably need to edit wspec/server.wrm and check |
| 237 |
user ids and file ownerships |
| 238 |
however, you do not connect to the server declared in inetd.conf |
| 239 |
|
| 240 |
1) Double check /etc/inetd.conf, /etc/rpc /etc/services |
| 241 |
|
| 242 |
2) try the server in foreground by doinga copy paste of the inet.conf line |
| 243 |
in this way you may detect a typo |
| 244 |
|
| 245 |
3) HUP again portmap and inetd |
| 246 |
|
| 247 |
4) reboot, because HUPing the inet daemon may have caused a problem |
| 248 |
|
| 249 |
5) try to recompile (make aceserver gifaceserver) |
| 250 |
|
| 251 |
6) contact [email protected] for help |
| 252 |
|
| 253 |
************** |
| 254 |
|
| 255 |
Known SOLARIS bug: |
| 256 |
|
| 257 |
ON solaris 5.5, the server does not connect when registered with inetd |
| 258 |
this is due apparently to a bug in rpcgen |
| 259 |
|
| 260 |
Symptom: |
| 261 |
if you start the server in foreground: |
| 262 |
rpc.acedbd $ACEDB 600:600:0 |
| 263 |
|
| 264 |
all works ok and the client works |
| 265 |
|
| 266 |
but started by inetd, the server can be seena s running: |
| 267 |
ps -elf | grep ace |
| 268 |
but you cannot connect with the client |
| 269 |
|
| 270 |
To fix this: |
| 271 |
|
| 272 |
setenv ACEDB_MACHINE SOLARIS_4_OPT |
| 273 |
make aceserver gifaceserver |
| 274 |
cd bin.SOLARIS_4_OPT |
| 275 |
\rm -f rpcace_svc.c |
| 276 |
\cp ../wrpc/rpcace_svc.crick rpcace_svc.c |
| 277 |
touch rpcace_svc.c |
| 278 |
\rm aceserver gifaceserver rpcace_sp.o |
| 279 |
cd .. |
| 280 |
make aceserver gifaceserver |
| 281 |
|
| 282 |
------------------------------------ |
| 283 |
|
| 284 |
The solaris problem is the following |
| 285 |
rpcace_svc.c is a c code automatically generated by rpcgen |
| 286 |
this code is bugged |
| 287 |
rpcace_svc.crick is a version that was generated under solaris.5.5.1 |
| 288 |
|
| 289 |
rpcace_svc.c is actually included in rpcace_sp.c at compile time |
| 290 |
this is why you must \rm rpcace_sp.o, then force recompilation |
| 291 |
|
| 292 |
*************************** |