| 1 |
|
| 2 |
=================================================================== |
| 3 |
=================================================================== |
| 4 |
Beta release of tcp/sockets based version of acedb client/server. |
| 5 |
|
| 6 |
Authors: |
| 7 |
Ed Griffiths [email protected] |
| 8 |
Jean Thierry-Mieg [email protected] |
| 9 |
=================================================================== |
| 10 |
=================================================================== |
| 11 |
|
| 12 |
|
| 13 |
=================================================================== |
| 14 |
== STATE OF THE RELEASE |
| 15 |
|
| 16 |
server: should be pretty solid. |
| 17 |
|
| 18 |
client: requires tidying up in serveral areas, including: |
| 19 |
|
| 20 |
- moving over to aceIO instead of filsubs |
| 21 |
|
| 22 |
- general error handling |
| 23 |
|
| 24 |
- handling of ace_in/ace_out options (I am unclear what |
| 25 |
ace_out is for, or what it is supposed to do, I'm sure |
| 26 |
it's broken at the moment). |
| 27 |
|
| 28 |
- command line needs completely redoing to account of |
| 29 |
various suggestions by Jean/James. |
| 30 |
|
| 31 |
- clean up client command line |
| 32 |
|
| 33 |
- clean up client structure (lots of untidy code....) |
| 34 |
|
| 35 |
- testing....as always. |
| 36 |
|
| 37 |
- do the client side file writing, needs some thought, we don't want to |
| 38 |
reimplement command.c on the client side !! |
| 39 |
|
| 40 |
|
| 41 |
Protocol: this may be expanded for aceio requests...not sure yet. |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
=================================================================== |
| 46 |
== OVERVIEW OF CODE LAYOUT: |
| 47 |
|
| 48 |
|
| 49 |
----------------------------------------------------------------- |
| 50 |
SOCKET LAYER - socket code only, knows nothing about acedb |
| 51 |
|
| 52 |
acesocket_.h |
| 53 |
acesocket.c |
| 54 |
acesocketlib.c |
| 55 |
(also needs serverclientutils.c) |
| 56 |
|
| 57 |
----------------------------------------------------------------- |
| 58 |
servertransport.h - defines interface between transport layer, |
| 59 |
in this case sockets, and acedb server |
| 60 |
|
| 61 |
|
| 62 |
----------------------------------------------------------------- |
| 63 |
ACEDB SERVER - acedb code only, knows nothing about sockets |
| 64 |
|
| 65 |
serverace_.h |
| 66 |
serverace.c |
| 67 |
serveracepasswd.c |
| 68 |
|
| 69 |
|
| 70 |
----------------------------------------------------------------- |
| 71 |
UTILS - used at acedb level by client and server (no socket code |
| 72 |
in here) |
| 73 |
|
| 74 |
serverclientutils.h |
| 75 |
serverclientutils.c |
| 76 |
|
| 77 |
|
| 78 |
----------------------------------------------------------------- |
| 79 |
ACEDB CLIENT - not well structured, but not worth a very layered |
| 80 |
approach. |
| 81 |
|
| 82 |
saceclient.h |
| 83 |
saceclient_.h |
| 84 |
saceclient.c |
| 85 |
saceclientlib.c |
| 86 |
(also needs acesocketlib.c) |
| 87 |
(also needs serverclientutils.c) |
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
=================================================================== |
| 93 |
== DOCUMENTATION |
| 94 |
|
| 95 |
There is also some documentation in wdoc: |
| 96 |
|
| 97 |
SOCKET_aceserver.html - users guide |
| 98 |
SOCKET_interface.html - developers internals guide. |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
=================================================================== |
| 104 |
== COMPILATION |
| 105 |
|
| 106 |
The two executables are called saceserver and saceclient to distinguish |
| 107 |
them from the rpc server/client. |
| 108 |
|
| 109 |
From within the usual acedb source code directory you need to type: |
| 110 |
|
| 111 |
> make saceserver saceclient |
| 112 |
|
| 113 |
|
| 114 |
=================================================================== |
| 115 |
== SET UP |
| 116 |
|
| 117 |
The sockets based version of the client/server comes with a number |
| 118 |
of new features, these are fully described in SOCKET_aceserver.html. |
| 119 |
The following i a brief summary to get you started, this should |
| 120 |
let you get the server/client going, after that you can tinker around |
| 121 |
to get more security etc.: |
| 122 |
|
| 123 |
1) Options in wspec/server.wrm: |
| 124 |
|
| 125 |
NO_RESTART |
| 126 |
- turns ON no restart of server after a crash/shutdown. |
| 127 |
|
| 128 |
NO_HOSTNAME_RESOLUTION |
| 129 |
- turns OFF checking for user being in a domain specified |
| 130 |
as having permission to log in, e.g. sanger.ac.uk |
| 131 |
|
| 132 |
DEBUG |
| 133 |
- turns ON server debugging output to database/server.log |
| 134 |
|
| 135 |
WRITE/READ |
| 136 |
- set the basic database access permission levels for the |
| 137 |
read and write groups (admin users always have access). |
| 138 |
Default is PASSWD, but NONE & WORLD can also be set. |
| 139 |
|
| 140 |
All of these options can be left at their default settings for just |
| 141 |
testing out the client/server. |
| 142 |
|
| 143 |
|
| 144 |
2) Passwords in wspec/serverpasswd.wrm: |
| 145 |
|
| 146 |
This file contains two types of record: groups/associated users |
| 147 |
records and individual user records. There are three groups: admin, write and read |
| 148 |
and to set up a database to run with the new socket server there needs |
| 149 |
to be at least one user in the admin group. To 'bootstrap' an admin |
| 150 |
user so you can access the database via the client you need to: |
| 151 |
|
| 152 |
- choose your admin userid (this does _not_ need to be an existing |
| 153 |
Unix userid, it can be any name you want), e.g. joebloggs |
| 154 |
|
| 155 |
- alter the admin group line in serverpasswd.wrm so it looks like |
| 156 |
this: |
| 157 |
|
| 158 |
admin: joebloggs |
| 159 |
|
| 160 |
- now use the acedb utility program makeUserPasswd to create the |
| 161 |
user entry for joebloggs (note that you won't see the password |
| 162 |
you type): |
| 163 |
(in the acedb source directory, |
| 164 |
make makeUserPasswd |
| 165 |
the executable is as usual in bin.$ACEDB_MACHINE) |
| 166 |
|
| 167 |
|
| 168 |
> makeUserPasswd joebloggs |
| 169 |
// Please enter passwd: jumbo10 |
| 170 |
// Please re-enter passwd: jumbo10 |
| 171 |
// The following line is a valid entry for wspec/serverpasswd.wrm |
| 172 |
|
| 173 |
joebloggs ccc5b9abf592836076410cdee518c518 |
| 174 |
|
| 175 |
> |
| 176 |
|
| 177 |
cut and paste the entry into a separate line in the serverpasswd.wrm file. |
| 178 |
|
| 179 |
Once the initial admin user has been set up, all other users can |
| 180 |
be set up from the admin userid via the new admin commands. |
| 181 |
|
| 182 |
|
| 183 |
You should now be in a position to test the server and client, it is |
| 184 |
recommended that you test the server in the foreground before trying |
| 185 |
to set it up to be run by inetd. |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
=================================================================== |
| 190 |
== TEST IN FOREGROUND |
| 191 |
|
| 192 |
------------------------- |
| 193 |
|
| 194 |
launch a server in foreground: |
| 195 |
|
| 196 |
saceserver <your/data/base> <your_port_number> <time_out_options> |
| 197 |
|
| 198 |
if something is wrong you shuold get a clear message |
| 199 |
|
| 200 |
------------------------- |
| 201 |
|
| 202 |
if the server starts OK, then start a client: |
| 203 |
|
| 204 |
saceclient <host_where_server_is_running> -port <port_number_from_above> |
| 205 |
acedb> status |
| 206 |
acedb> quit |
| 207 |
|
| 208 |
if that is ok, you can go ahead and try registering the server |
| 209 |
under inetd control (see next section). |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
=================================================================== |
| 214 |
== INSTALLATION UNDER INETD |
| 215 |
|
| 216 |
You can now run saceserver against any existing acedb database |
| 217 |
and/or register it under inetd by adding lines to the following |
| 218 |
files (you will need root access): |
| 219 |
|
| 220 |
For this example we assume: |
| 221 |
|
| 222 |
nickname for server/database - MyfirstDB |
| 223 |
port for server - 20113 |
| 224 |
path to server binary - /usr/local/bin/saceserver |
| 225 |
path to database - /home/databases/aardvarkDB |
| 226 |
timeout values for server - 200:200:0 |
| 227 |
|
| 228 |
|
| 229 |
------------------------------ |
| 230 |
in /etc/services add the line |
| 231 |
|
| 232 |
MyfirstDB 20113/tcp |
| 233 |
|
| 234 |
------------------------------ |
| 235 |
in /etc/inetd.conf add the line |
| 236 |
|
| 237 |
MyfirstDB stream tcp wait mieg /usr/local/bin/saceserver saceserver /home/databases/aardvarkDB 20113 200:200:0 |
| 238 |
|
| 239 |
MyfirstDB seen in both files, a random name of my choice to name the service |
| 240 |
stream tcp wait mandatory, this is the way the daemon must be declared |
| 241 |
mieg user name under which the daemon runs, avoid root, |
| 242 |
choose some local user owning /home/databases/aardvarkDB |
| 243 |
/usr/local/bin/saceserver full path to saceserver executable |
| 244 |
saceserver repeat the name of the execuatble so that it is found as argv[0] by the code |
| 245 |
/home/databases/aardvark the database directory |
| 246 |
20113 a given port number |
| 247 |
200:200:0 server and client time out in seconds, then a blocking factor |
| 248 |
(default zero is ok) |
| 249 |
|
| 250 |
------------------------------ |
| 251 |
Now get inetd to reread /etc/inetd.conf and pick up the information for MyfirstDB: |
| 252 |
|
| 253 |
1) find out the process id of inetd |
| 254 |
|
| 255 |
> ps -A | grep inetd |
| 256 |
|
| 257 |
545 ?? I 0:00.62 /usr/sbin/inetd |
| 258 |
|
| 259 |
2) Send inetd the interrupt signal |
| 260 |
|
| 261 |
> kill -HUP 545 |
| 262 |
|
| 263 |
Sending this signal should be enough but on some old systems a reboot may be necessary. |
| 264 |
|
| 265 |
---------------------------- |
| 266 |
|
| 267 |
then invoke the server via |
| 268 |
|
| 269 |
saceclient <host_where_server_is_running> -port 20113 |
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
=================================================================== |
| 275 |
== ACEPERL |
| 276 |
|
| 277 |
Jean says: |
| 278 |
|
| 279 |
i have under test a fixed AcePerl client code that i can also send |
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
=================================================================== |
| 284 |
=================================================================== |
| 285 |
please mail reports, error and suggestions to |
| 286 |
[email protected] |
| 287 |
[email protected] |
| 288 |
=================================================================== |
| 289 |
=================================================================== |
| 290 |
|