.TH ASD 8 .CT 1 sa_auto .SH NAME asd \- automatic software distribution .SH SYNOPSIS .B /usr/lib/asd/cdaemon .br .B /usr/lib/asd/dkinstall .br .B /usr/lib/asd/mkspool .br .B /usr/lib/asd/rmlocks .br .B /usr/lib/asd/udaemon .SH DESCRIPTION These programs constitute the innards of the automatic software distribution system invoked by .IR ship (8). .PP .I Mkspool creates an .SM ASD spool directory for its invoker (if necessary), puts a file named .F dummy in the directory to prevent .I cdaemon from deleting it, and prints the directory's name. .PP .I Udaemon examines its invoker's .SM ASD spool directory in lexical order for things to do. To forestall multiple daemons, it first makes an empty file named .BI L. pid in the spool directory and tries to link to it a file .FR lock . If the link fails, .BI L. pid is removed and .I udaemon exits. .PP Shipping instructions appear in pairs of files with .B .s and .B .d suffixes. .I Udaemon examines each status .RB ( .s ) file for destination names and places a network call to send the corresponding data .RB ( .d ) file to .I dkinstall at each destination. .I Dkinstall verifies the data and gives it to .IR inspkg , see .IR mkpkg (8). .PP A status file contains zero or more entries, each of which has one or more lines. The first line of an entry is a network address, with default network .B dk and default service .BR asd , possibly followed by a blank and a failure report. An entry with destination .L # is a comment and is ignored. Lines after the first begin with a tab, and contain output generated by the entry. If an entry has output, it is considered complete and will be processed no further. .PP .I Udaemon scans each status file once, and attempts to send the corresponding data file to the destination for each incomplete entry. If the attempt fails, a failure report is appended to the entry, and it remains incomplete. If the attempt succeeds, or the failure is severe, an error message or output from .I dkinstall is appended to the entry, which makes the entry complete. If an entry is completed successfully but there are no output lines, the entry is deleted. .PP Each instance of .I udaemon remembers which network addresses failed with non-severe errors; entries with the same address in later status files are given failure status `deferred for sequence.' .PP If at least one additional entry was completed, .I udaemon sends the new status file to the owner by .IR mail (1) after the whole file has been scanned. If no incomplete entries remain, both status and data files are removed. .PP .I Cdaemon examines every subdirectory of .FR /usr/spool/asd , deletes empty directories and, impersonating the owner, invokes .I udaemon for nonempty directories. .I Cdaemon should be run regularly by .IR cron (8) with super-user permissions. .PP .IR Rmlocks removes all lock files in subdirectories of .FR /usr/spool/asd . It should be called from .IR rc (8). .PP Entries in an .SM ASD spool directory may be made without regard to locks provided that everything is done in the right sequence: (1) call .IR mkspool ; (2) create the data file; (3) create the status file under a temporary name; (4) rename the status file to end with .BR .s ; (5) remove the .F dummy file, if present; and (6) call .IR udaemon . .PP Because .I mail will not send an empty file, a status file must have a comment entry if acknowledgment is desired after a successful .I udaemon run. .SH FILES .BI /usr/spool/asd/ "userid " user's .SM ASD spool directory .SH SEE ALSO .IR mkpkg (8), .IR ship (8)