-*- Mode: Text; -*- ;;;> EXAMPLES-MESSAGE ;;;> ;;;>****************************************************************************************** ;;;> ;;;> Symbolics hereby grants permission to customer to incorporate ;;;> the examples in this file in any work belonging to customer. ;;;> ;;;>****************************************************************************************** D,#TD1PsT[Begin using 006 escapes](1 0 (NIL 0) (:SWISS :ITALIC NIL) "HL12I")This file is0 1only being provided as an0 1example.0 1You would probably want to change0 1some things in this file before0 1running it0 1at your site, which is why it is provided as a text file rather than0 1a0 1directly-usable Lisp file. Note that the server machines all have the property0 "SERVER-MACHINE YES"1, which0 1ensures that they cannot be accessed from the0 1network0 1until after this0 1init file explicitly enables network services. Since0 1these0 1machines0 1are server machines, they are likely to be continuously0 1bothered by0 1network requests at all times of day or night. Disabling servers0 1until0 1explicitly enabled ensures that maintenance and debugging0 1facilities,0 1including 0load-and-save-patches, 1can be performed0 1without interference. 0;;; -*- Mode: Lisp; Syntax: Common-lisp; Package: User; Base: 10 -*- ;;; Login file for the SCRC File Servers. 1Because this init file is used by many file servers here, we need an0 1easy way to express per-file-server customizations. 0So 1we use a macro: 0;;; Routines which are used only here. (DEFMACRO FILE-SERVER-ONLY-ON (HOSTS &BODY BODY) `(WHEN (OR ,@(LOOP FOR HOST IN HOSTS COLLECT `(SEND NET:*LOCAL-HOST* :PATHNAME-HOST-NAMEP ,(STRING HOST)))) ,@BODY)) (DEFMACRO IF-SYSTEM-NOT-LOADED ((SYSTEM-NAME) &BODY BODY) `(WHEN (NULL (SCT:FIND-SYSTEM-NAMED ,(STRING SYSTEM-NAME) NIL T)) ,@BODY)) 1It is always a good idea to make sure that all the latest patches are0 1loaded into a server machine, so that bugs will be fixed as soon as0 1the fix is known. This matters a lot at Symbolics, where new patches are0 1made available every day, not just when a new minor release is0 1distributed. Patches must be loaded before enabling servers, since0 1the world might be momentarily in an inconsistent state while a0 1patch loads. 0(WHEN (YES-OR-NO-P "Load patches? ") (LOAD-PATCHES :ALL :QUERY NIL)) 1The following section defines some functions to make various preallocated system data structures bigger, and calls the functions. This improves LMFS performance by dedicating a lot of memory to the buffers in which it encaches0 1disk records, improves scheduler performance by decreasing the number of pages0 1in its working set, and improves network performance by dedicating more memory0 1to network packet buffers. These changes are useful because a server machine0 1stresses LMFS, the scheduler, and the network much more than a user machine.0 1These functions were originally written for Release 5, and have been0 1maintained more-or-less through release 6, but0 1could well stop working in0 1a future release; they aren't considered to be supported software. The amount of memory allocated to LMFS buffers is based on the amount0 1of physical memory on the machine. Our server machines are equipped with as much memory as possible, in an attempt to boost performance. The size of the scheduler's active-processes table is set to the largest number of processes ever observed on the machine at one time; this number could vary at different sites, but it doesn't hurt to make it too large. The amount of memory allocated to network buffers is set (on a 3600) to a fixed size, 64K, that was picked by guesswork. A smaller installation might want to set this to a smaller size. The size in a normal machine is 32K. Incidentally, we allocate extra disk space to virtual memory on our 3600 server machines, in an attempt to boost performance by decreasing the amount of time spent garbage-collecting. Quabbin, for example, has 50 megawords of swapping space allocated on one disk, and three additional disks used for file storage. Keeping swapping space and file space on different disks should decrease the amount of time spent waiting for disk seeks. 0;;; Make various things larger since this machine is going to be mainly serving. (DEFUN ALLOCATE-MEMORY-TO-LMFS-BUFFERS (FRACTION-OF-PHYSICAL-MEMORY &OPTIONAL (EVEN-IF-SMALLER NIL) (FRACTION-OF-DIRECTORY-BUFFERS 0.5833333)) (ZL:CHECK-ARG FRACTION-OF-PHYSICAL-MEMORY (AND (NUMBERP FRACTION-OF-PHYSICAL-MEMORY) (< 0 FRACTION-OF-PHYSICAL-MEMORY 0.5)) "a number larger than zero and less than 0.5") (ZL:CHECK-ARG FRACTION-OF-DIRECTORY-BUFFERS (AND (NUMBERP FRACTION-OF-DIRECTORY-BUFFERS) (< 0 FRACTION-OF-DIRECTORY-BUFFERS 1.0)) "a number larger than zero and less than 1.0") (LET* ((NBUFS (FLOOR (* (* SI:*COUNT-USABLE-PAGES* SYS:PAGE-SIZE) FRACTION-OF-PHYSICAL-MEMORY) LMFS:*FILE-BUFFER-WORD-SIZE*)) (NDIR (FLOOR (* NBUFS FRACTION-OF-DIRECTORY-BUFFERS))) (NFILE (- NBUFS NDIR))) (WHEN (OR EVEN-IF-SMALLER (AND ( NDIR LMFS:*DEFAULT-N-DIRECTORY-BUFFERS*) ( NFILE LMFS:*DEFAULT-N-FILE-BUFFERS*))) (LMFS:MAKE-MORE-FILE-BUFFERS (- NFILE LMFS:*DEFAULT-N-FILE-BUFFERS*) (- NDIR LMFS:*DEFAULT-N-DIRECTORY-BUFFERS*))))) (ALLOCATE-MEMORY-TO-LMFS-BUFFERS 1/6) (DEFUN MAKE-MORE-ACTIVE-PROCESSES (N) (WITHOUT-INTERRUPTS ;!! (UNLESS ( (LENGTH SI:ACTIVE-PROCESSES) N) (LET ((AP (SI:MAKE-ACTIVE-PROCESSES N))) (LOOP FOR X IN SI:ACTIVE-PROCESSES FOR Y IN AP WHEN (CAR X) DO (LOOP FOR L ON X FOR LL ON Y DO (SETF (CAR LL) (CAR L)))) (SETQ SI:ACTIVE-PROCESSES AP))))) (MAKE-MORE-ACTIVE-PROCESSES 120.) 1This function initializes LMFS, sets up file server logging, and takes care of other housekeeping 0(FS:INITIALIZE-SERVER) 1This next function should be used instead of the previous one to enable the file access protection mechanisms on the server. 0(FS:INITIALIZE-SECURE-SERVER) 1The next form ensures that asynchronous notifications don't pop-up windows to display their message. This is important on a server0 1machine because pop-up notifications might obscure and temp-lock a0 1window below the popped-up notification, causing the obscuree to hang.0 1This might not be noticed for quite a while as no one works at the0 1file-server console with any regularity. 0(SETQ TV:*ALLOW-POP-UP-NOTIFICATIONS* NIL) 1The next form makes sure that all the file server machines that also0 1serve as Print servers load the print spooler software every time they0 1boot. Of course, there's no need to load this software if it's0 1already loaded, probably because someone saved a world load with the0 1print server preloaded. This technique is used often here. 0(FILE-SERVER-ONLY-ON (QUABBIN RIVERSIDE STONY-BROOK WAIKATO YUKON) (IF-SYSTEM-NOT-LOADED (PRINT) (LOAD-SYSTEM "PRINT" :VERSION :LATEST :QUERY NIL))) 1Here we do much the same for the store-and-forward mailer, except that0 1we don't use the0 file-server-only-on1 form as our guide. Instead we0 1use the namespace object that represents this host, and look at the0 1services it supports. If it has the 0USER-PROPERTY1 of0 EXPERIMENTAL-MAILER,1 then we load the latest version of the Mailer.0 1If that's not the case, but the local host does support0 STORE-AND-FORWARD-MAIL1 service, then we load the released mailer.0 1Otherwise, we don't load the mailer software at all. 0(IF-SYSTEM-NOT-LOADED (MAILER) (COND ;; Run the experimental mailer ((SEND NET:*LOCAL-HOST* :USER-GET :EXPERIMENTAL-MAILER) (LOAD-SYSTEM "MAILER" :VERSION :EXPERIMENTAL :QUERY NIL)) ;; Run the released mailer ((ASSQ :STORE-AND-FORWARD-MAIL (SEND NET:*LOCAL-HOST* :SERVICE)) (LOAD-SYSTEM "MAILER" :VERSION :RELEASED :QUERY NIL)))) 1This next form is quite specific to Symbolics. The file-server named 0Quabbin1 is the sole source of mailer forwarding tables for Symbolics. These tables tell the store-and-forward mailers within Symbolics where0 1to forward addresses not local to that host. When this init file is0 1read by 0Quabbin1, it sets up this list, which is checked by the mailer0 1when it is started, down at the0 (si:enable-services)1 below. It's rather doubtful any other site will have this elaborate a mail0 1domain for quite a while. 0;; If you add a new mailer to the Symbolics domain, be sure to add it to this list. (FILE-SERVER-ONLY-ON (QUABBIN) (SETQ MAILER:FORWARDING-TABLE-HOSTS '("CUPID" "GILA" "PEGASUS" "RIVERSIDE" "RUSSIAN" "SCRC-TENEX" "STONY-BROOK" "VIXEN" "WAIKATO" "WHITE" "YUKON"))) 1The next section makes sure that Internet protocol support is loaded0 1on all file-servers. This is especially handy for those file-servers0 1that are going to be handling mail traffic to the Arpanet community;0 1they will need 0IP-TCP 1support to run0 SMTP1 to communicate with mailers0 1on those hosts. 0;; Make sure that TCP (which is not in all worlds) is loaded. (IF-SYSTEM-NOT-LOADED (IP-TCP) (WHEN (LOOP FOR (NET) IN (SEND NET:*LOCAL-HOST* :ADDRESS) THEREIS (EQ :INTERNET (SEND NET :TYPE))) (LOAD-SYSTEM "IP-TCP" :VERSION (INTERN (FORMAT NIL "SYSTEM-~D" (SCT:GET-SYSTEM-VERSION "System")) "KEYWORD") :QUERY NIL) (SEND CHAOS:*UNC-INTERFACE* :ENABLE) (LOOP FOR (NETWORK) IN (SEND NET:*LOCAL-HOST* :ADDRESS) WHEN (EQ :INTERNET (SEND NETWORK :TYPE)) DO (SEND NETWORK :ENABLE)))) 1With many processes competing for the machine, Peek's slow redisplay can take an excruciatingly long time to complete. Change the interval between automatic redisplays to0 1minimize this annoyance. 0(SETQ TV:PEEK-SLEEP-TIME (* 60. 60.)) ;60 seconds, not the default 2 1Enable our pdp-11s that serve as network bridges and0 1terminal concentrators to download themselves from these file-servers 0;;; Set up pdp-11 bootload server if not already loaded (FILE-SERVER-ONLY-ON (QUABBIN STONY-BROOK WAIKATO) (UNLESS (LOOP FOR S IN NETI:*SERVERS* THEREIS (EQ (NETI:SERVER-PROTOCOL-NAME S) :11LOAD)) (LOAD "SCRC|QUABBIN:>PDP-11>11LOAD" :VERBOSE NIL :IF-DOES-NOT-EXIST NIL :SET-DEFAULT-PATHNAME NIL))) 1Site systems are a convenient way to group together functions that everyone at the site wants to use, but that aren't suitable for0 1release to other sites. Since a file-server is just as much a local0 1user as everyone else [if not more so], load this if not already0 1loaded. 0;;; Load site system. (WHEN (EQ (SEND NET:*LOCAL-SITE* :NAME) :SCRC) (IF-SYSTEM-NOT-LOADED (SCRC) (LOAD-SYSTEM "SCRC" :QUERY NIL))) 1Since the file server consoles are in a fairly deserted area, no one is likely0 1to be around when bugs occur. This section tells the automatic server0 1bug report facility where to send automatic bug mail, and how0 1to handle repetitive occurrences of what it perceives are0 1identical problems. 0(WHEN (EQ SITE-NAME :SCRC) (SETQ DBG:*AUTOBUG-RECIPIENTS* '("AUTOBUG-SERVER@SCRC-STONY-BROOK")) (SETQ DBG:*AUTOBUG-DUPLICATE-ACTION* :IGNORE)) 1The next section turns on the garbage collector and adjusts its parameters. The various0 1servers cons a fair amount of garbage, and since the server machine is expected to stay0 1up for weeks at a time without being rebooted, the garbage collector must be turned on0 1or the machine would quickly exhaust its address0 1space. 0(SETQ SI:GC-FLIP-RATIO 1) (GC-ON) 1The next section tunes some scheduler variables so that we spend less0 1time scheduling and more time serving, possibly at the expense of our0 1interactive response (but that's not how this machine earns its pay). 0(SETQ SI:*DEFAULT-SEQUENCE-BREAK-INTERVAL* 1000000.) (SETQ SI:SEQUENCE-BREAK-INTERVAL 1000000.) (SETQ SI:DEFAULT-QUANTUM 60.) (LOOP FOR P IN SYS:ALL-PROCESSES WHEN (= (SEND P :QUANTUM) 6) DO (SEND P :SET-QUANTUM SI:DEFAULT-QUANTUM)) 1This sets the command prompt to a string that identifies this machine (useful since we have three or four file server consoles lined up in a0 1row). 0(SETQ CP:*DISPATCH-MODE* :COMMAND-PREFERRED) (SETQ CP:*PROMPT* (STRING-APPEND SI:LOCAL-PRETTY-HOST-NAME "> ")) 1This next section has been commented out, but is left in case we need0 1it again. It used to load a program that kept track of the uptime and downtime of our network bridges. 0;;; Don't do this for now. ;(FILE-SERVER-ONLY-ON (QUABBIN) ; (LOAD "QUABBIN:>DCP>track-hosts")) ;keep track of MINITS uptimes 1Since this is a server machine, and yet we're allowing people to use the Terminal program to connect to it and type arbitrary Lisp forms, be a little careful and guard against people accidentally typing 0(login) 1when they're starting a Terminal session, or 0(logout)1 when they're done. Do this with an initialization so that if this lispm-init.lisp file gets read in0 1twice, we don't execute the code twice. 0(DEFUN NO-LOGOUTS () (SETF #'SI:FILE-SERVER-LOGOUT #'LOGOUT) (FMAKUNBOUND 'LOGOUT) (SETF #'SI:FILE-SERVER-LOGIN #'LOGIN) (FMAKUNBOUND 'LOGIN)) (ADD-INITIALIZATION "No logouts" '(NO-LOGOUTS) '(:ONCE)) 1At this point other machines can start getting service from this one. We notify people that the machine is available with a little low-level hacking rather than use the standard (but slower) mechanism. 0(SYS:ENABLE-SERVICES) (LET ((*STANDARD-OUTPUT* (MAKE-BROADCAST-STREAM))) ;Don't care whether it works or not ; (CHAOS:NOTIFY-ALL-LMS (FORMAT NIL "~A is up for service now" NET:*LOCAL-HOST*)) ; The following is much faster because it avoids converting host objects into ; chaos addresses and then back into host objects, only to throw them away anyway. (CHAOS:POLL-HOSTS (NET:GET-LOCAL-LISPMS) (CHAOS:MAKE-NOTIFY-RFC (FORMAT NIL "~A is up for service now" NET:*LOCAL-HOST*)) #'IGNORE #'IGNORE))