Previous: Client, Up: Conceptual model [Contents][Index]
The SERVER activity manage local cache integrity and exchange files with other MEDIATEX’s SERVERs. CLIENT (see Client) may ask it to updates the ~mdtx/md5sums/mdtx-COLL.md5 (see mdtxCOLL.md5) file that gives the local cache’s status.
The SERVER activity is divided into 7 process:
• cache: | cache | |
• extract: | extract | |
• cgiServer: | cgiServer | |
• have: | have | |
• uploadServer: | uploadServer | |
• notify: | notify | |
• delivering: | delivering |
Flood diagram:
# nohup mediatexd
# kill -s TERM PID
# kill -s HUP PID
from init.d (see init.d): standard UNIX process management (HUP signal for reload...).
[save]
from misc (see misc): serialize the last cache status into a file.
[extract]
[notify]
from CLIENT respectively to extract (see extract), notify (see notify): ask server to extract or notify locally available archive contents to other servers.
[quick-scan]
[scan]
from CLIENT: ask server to check recorded local supplies are still available from the cache and match recorded size ([quick-scan]) or both recorded md5sum and size ([scan]). Next, scan the cache directory and remind new local-supplies founded, or remove files if they do not match an extraction rule.
[trim]
from CLIENT: remove form cache all files that are safe and extractable from a containers available into the cache.
[clean]
from CLIENT: remove form cache all files that are safe and extractable from supports locally available.
[purge]
from CLIENT: remove form cache all files that are safe.
[status]
from CLIENT: ask server print into the logs its memory status.
<cgiSrv-query>
from cgiClient (see cgiClient) to cgiServer (see cgiServer): receive a socket query asking for an archive.
<have>
from supp (see supp) to have (see have): receive a socket query providing archives from a support.
<upload>
from misc (see misc) to cache (see cache): receive a socket query providing an archive and asking to handle it into the cache.
<notify>
from a remote SERVER to notify (see notify): receive a socket query providing remote cache content index.
$ mediatex adm bind
$ mediatex adm unbind
$ mediatex adm get path as coll on path
to misc (see misc): tells client to make operations that needs privileges, like binding directories into the chroot jail or using collection account to retrieve archives remotely.
$ mediatex adm mount iso on path
$ mediatex adm umount path
from extract (see extract) to supp (see supp): tel client to mount supports as it need root privileges.
<notify>
from notify (see notify) to a remote SERVER: send a socket query providing local cache content index.
$ /usr/share/mediatex/scripts/deliver.sh
$ /usr/share/mediatex/scripts/audit.sh
from delivering (see delivering) to deliver (see deliver) or audit (see audit): respectively notify archive availability to USER or audit an archive.
/etc/mediatex/mdtx.conf (see mdtx.conf)
~mdtx/git/mdtx/supports.txt (see supports.txt)
/etc/mediatex/mdtx-COLL/servers.txt (see servers.txt)
/etc/mediatex/mdtx-COLL/extractXXX.txt (see extract.txt)
~mdtx/md5sums/mdtx-COLL.md5 (see mdtxCOLL.md5)
Return codes on <socket> messages:
X--
)
1-- …
negative reply
2-- …
ok
3-- …
bad request
4-- …
internal error
-0-
)
301 message parser error
302 message without collection
303 message from server '%s' not registered into %s collection
304 message contains a record not related to author %s but %s
305 unknown message type: %s
400 internal error
401 fails to read message
402 fails to load %s collection's serverTree
403 fails to get localhost
404 fails to load %s collection's cache
-1-
)
210 ok
310 empty message
332 message do not provide a final supply %s
313 already exists %s:%lli
-2-
)
120 not found %s:%lli
220 ok %s/%s
221 ok
320 empty message
-3-
)
230 ok
330 empty message
331 message do not provide a final supply %s
-4-
)
240 ok
Code:
Previous: Client, Up: Conceptual model [Contents][Index]