home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / unix-faq / programmer / application-principles next >
Encoding:
Text File  |  2001-08-27  |  40.7 KB  |  1,262 lines

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <unix-faq/programmer/application-principles_998814492@rtfm.mit.edu>
  3. Supersedes: <unix-faq/programmer/application-principles_996142223@rtfm.mit.edu>
  4. Expires: 9 Oct 2001 08:28:12 GMT
  5. X-Last-Updated: 2000/01/21
  6. From: Rich Kulawiec <rsk@gsp.org>
  7. Newsgroups: comp.unix.admin,comp.unix.misc,comp.unix.programmer,comp.unix.large,comp.answers,news.answers
  8. Subject: [DRAFT FAQ] The Well-Tempered Unix Application
  9. Summary: Guidelines for application developers
  10. Followup-To: poster
  11. Reply-To: rsk@gsp.org
  12. Organization: Fire on the Mountain
  13. Keywords: Unix, applications, installation, software, administration
  14. Approved: news-answers-request@mit.edu
  15. Originator: faqserv@penguin-lust.MIT.EDU
  16. Date: 26 Aug 2001 08:29:13 GMT
  17. Lines: 1240
  18. NNTP-Posting-Host: penguin-lust.mit.edu
  19. X-Trace: 998814553 senator-bedfellow.mit.edu 1914 18.181.0.29
  20. Xref: senator-bedfellow.mit.edu comp.unix.admin:125897 comp.unix.misc:52501 comp.unix.programmer:127040 comp.unix.large:3849 comp.answers:46747 news.answers:214044
  21.  
  22. Archive-name: unix-faq/programmer/application-principles
  23. Version: $Id: wtua,v 1.15 2000/01/21 11:57:58 rsk Exp $
  24.  
  25. Copyright Rich Kulawiec, 1997, 1998, 1999, 2000.
  26.  
  27. [ January 2000 update: currently being rewritten. ]
  28.  
  29. READ THIS NOTE:
  30.  
  31.     I receive an average of hundreds of mail messages per day.  If you
  32.     want to make sure that your update/correction/reply to this
  33.     article comes to my attention when I'm working on the next
  34.     version, please send your message as a reply to this article,
  35.     i.e. make absolutely certain that you preserve the "Subject:"
  36.     line.  If you don't do this, your reply may sit in one of my
  37.     numerous mail queues for months or even years.
  38.  
  39.     Please don't send an update more than once -- doing so only
  40.     adds to the queue that I have to process when doing updates.
  41.     If you want to make certain that I've received something, then
  42.     make a note of the information on the "Version:" line above.
  43.     If it has changed when you next see this article, and your
  44.     information isn't included, then I've missed it.  Otherwise,
  45.     it's safe to presume I've got it and it's queued for inclusion.
  46.  
  47.     The FAQ may be reproduced and propagated via http, ftp, gopher
  48.     or other common Internet protocols by anyone provided that (1)
  49.     it is reproduced in its entirety (2) no fee is charged for access
  50.     to it and (3) it's kept up-to-date.  This latter is probably best
  51.     accomplished by mirroring one of the FAQ archives -- that way
  52.     you'll get a new copy everytime I update it, which is
  53.     approximately monthly.   (If you do put it up on the web, I'd
  54.     like to know the URL, but that's not a requirement.  It just
  55.     would be nice.)
  56.  
  57.     Reproduction of this FAQ on paper, CDROM or other media which
  58.     are sold is permissible only with the express written consent
  59.     of its author.
  60.  
  61.     If you are reading a copy of this document which appears to be
  62.     out-of-date, there are a variety of methods that you can use to
  63.     retrieve the most current method.  If you are familiar with access
  64.     to the FAQ archives via mail, ftp, and www, then you already know how.
  65.     If not,     then send email to mail-server@rtfm.mit.edu with the command
  66.     "send usenet/news.answers/news-answers/introduction" in the message,
  67.     and a complete guide to FAQ retrieval will be mailed to you.
  68.  
  69. Q. Why does this document exist?
  70.  
  71. A. This is an attempt to spell out some general principles that Unix
  72. application developers should consider in order to make the products
  73. of their work portable, easy to install and maintain, and flexible.
  74. It's somewhat targeted toward developers of commercial software,
  75. although folks developing freely-available code may also find some
  76. guidance here.
  77.  
  78. Much of it is opinion -- but a lot of that opinion has been formed by
  79. people who have installed hundreds of software packages on dozens
  80. of varieties of Unix.  The intention here isn't to inflict capricious
  81. whims on software developers; the intention is to keep them from
  82. doing the same to system administrators.
  83.  
  84.  
  85. Q. What should I assume about current OS releases?
  86.  
  87. A. That they'll change. ;-)
  88.  
  89. More seriously, the Unix world is one of short release cycles; Sun's 
  90. Solaris 2.7 is now being widely deployed and we're already seeing
  91. reports on future beta releases.  Locking one's software into the
  92. specific features of a release is generally a Bad Thing.  There's
  93. also the question of deprecated releases (e.g. SunOS) and newly-emerging
  94. ones (e.g. SUSE Linux).  Generally speaking, the tradeoff is one of
  95. trying to exploit the unique features of OS's for maximum programmatic
  96. advantage vs. trying to keep code as simple and as portable as possible.
  97. Your editor strongly recommends the latter and suggests that necessary
  98. performance criteria can almost always be met by a combination of
  99. other means, e.g. better choice of algorithm, optimizing compilers,
  100. hardware upgrades, and so on.
  101.  
  102.  
  103. Q. What about all those standards?
  104.  
  105. A.  In general, software packages should attempt to comply as much as is
  106. practical with the prevailing Unix software standards: POSIX 1003.1,
  107. POSIX 1003.3, SVID, and XPG.  Unfortunately, these comprise a maze
  108. of overlapping and occasionally conflicting requirements.
  109.  
  110. One way out of that maze is to try, as much as possible, to avoid
  111. developing products which rely on features over which there is
  112. disagreement.  Obvious, and easier said than done, but when there
  113. are major differences of opinion among standardization efforts,
  114. it may be better to duck the issue rather than contest it.
  115.  
  116.  
  117. Q. What about the windowing system environment?
  118.  
  119. A. Applications should be compatible with currently shipping X-based window
  120. environments from various vendors, some of which are based on X11R4,
  121. some on X11R5, and some on X11R6.  In general, attempts to support
  122. and utilize the features of X11R6 are encouraged.
  123.  
  124. Applications should work with any window manager, e.g. olwm, twm, etc.
  125. Compliance with the ICCCM standard will assist with this.
  126.  
  127.  
  128. Q. What about the Networking environment?
  129.  
  130. A. Use of Internet standard protocols and mechanisms are *highly* encouraged.
  131.  
  132. This includes:
  133.  
  134.     SMTP    (See RFC 821, 822) for mail
  135.     NNTP    (See RFC's 977 and 1036) for news
  136.     Telnet    (See RFC's 854, 855) for interactive login
  137.     FTP    (See RFC 959) for file transfer
  138.     HTTP    (See RFC 2068) for WWW services
  139.     NTP    (See RFC's 1129, 1305) for time synchronization
  140.     DNS    (See RFC 1032, 1033) for hostname resolution
  141.     SSH    (See RFC ????)
  142.  
  143. Also, RFC 1123 ("Requirements for Internet hosts - application and support")
  144. should be studied and its requirements adhered to as much as possible.
  145.  
  146. Use of the NIS/NIS+ environment should be selectable; i.e. the installer
  147. of the software package should be presented with the option to
  148. utilize NIS/NIS+ services at the time of the installation.  No package
  149. should require explicit entries in the local system's /etc/hosts file.
  150. Kerberos support is encouraged.
  151.  
  152. Use of NFS is ubiquitous, and all software packages should operate with
  153. NFS in a transparent manner but should not *require* it.  Use of NFS 3.0
  154. features where they are available is a good idea.  In addition, software
  155. packages should cooperate with the automounter; in particular, there must
  156. be provisions to ensure that the physical mount point of the package
  157. (e.g. <servername>:/<directory>/<package-name>) may be different that
  158. logical automount point of the package (e.g. /home/<package-name>).
  159.  
  160. Two issues that often arise with NFS are:
  161.  
  162.     1. A "pwd" executed in an automounted directory will
  163.     show something like
  164.  
  165.         /tmp_mnt/server/export/foo
  166.  
  167.     even though the directory is really mounted on
  168.  
  169.         /import/foo
  170.  
  171.     2. If NFS is used with the default options that most Unixes
  172.     employ, UID 0 (root) maps to UID -1 (nobody, or 65534).
  173.     in other words, root access to an NFS-mounted filesystem
  174.     sometimes requires remounting the filesystem with different
  175.     options, or - if that can't be done - executing part of an
  176.     installation script/procedure on another machine.
  177.  
  178. Use of RFS and Andrew distributed filesystems should be optional,
  179. as these filesystems are not universally supported.  (This isn't
  180. a comment on the merits of those filesystems, by the way: it's just
  181. an observation on their propagation.)
  182.  
  183. An application which requires the of temporary "scratch" disk space
  184. should allow that space to be resident anywhere on the local
  185. (executing) machine.  The way that some programs do this (e.g.
  186. GNU's gcc) is to use the environment variables "TMPDIR" -- which gives
  187. the name of the directory to use for "scratch" space.
  188.  
  189. On that topic -- and on mkstemp()/mktemp() -- let me quote Paul D. Smith:
  190.  
  191.     ALL_ programs that attempt to creat temp files should honor
  192.     this variable.
  193.  
  194.     Also, _all_ programs that need temporary files should use the
  195.     mkstemp() function if available, or the mktemp() function if
  196.     not, to get a temporary filename.  This can help avoid
  197.     security problems, denial-of-service attacks, etc.
  198.  
  199. Paul goes on to mention that he thinks this is a POSIX function; I think
  200. so, too; are we right?  (I can't find my copy of the POSIX standard
  201. this afternoon.)
  202.  
  203. Applications should also work seamlessly with memory-resident filesystems
  204. (e.g. Sun's tmpfs). 
  205.  
  206. Use of interprocess communication facilities should be carefully done
  207. in order to avoid collision with port numbers assigned by the Internet
  208. Assigned Numbers Authority.  Ideally, applications should allow the 
  209. installer to specify port numbers used.  Applications which need
  210. to function in a firewalled environment should provide proxies.
  211.  
  212.  
  213. Q. What about licensing mechanisms?
  214.  
  215. A. Use of standard network-based licensing mechanisms, for example FlexLM,
  216. is HIGHLY encouraged.  (Although it needs to be noted that most FlexLM
  217. implementations rely on hostid locking for the license server.  This isn't
  218. a limitation of FlexLM: it's possible to give out keys which aren't locked
  219. to a particular machine by using the ANY keyword in the hostid field.
  220. However, vendors fear that people will set up license servers on multiple
  221. machines, and thus steal their products.  Thanks to Mark C. Henderson
  222. for pointing this out.)  Licensing methods which rely in any part on hostname,
  223. IP address, hostid, username, or userid are discouraged because
  224. they tend to cause nightmares for system administrators when they have
  225. to change machines, or subnets, or any of the other myriad things that
  226. are part of evolving networks.
  227.  
  228. All that said, consider that it's possible for sufficiently smart and
  229. motivated programmers/administrators to bypass just about any licensing
  230. mechanism.  Depending on what your product is, and what the intended
  231. user community is, it may be easier to just skip the entire exercise.
  232.  
  233. Q. What about the Unix environment in general?
  234.  
  235. A. While the user of a dedicated loginname/uid to provide administration within
  236. a package is acceptable, no loginname/uid should be mandated.  In other
  237. words, if a database application is designed to be administered by an
  238. end-user account, the loginname/uid/groupname/gid of that account
  239. must be selectable by the installer and no constraints should be
  240. placed upon it.
  241.  
  242. No package should require users to have a particular loginname/uid/gid
  243. in order to utilize any feature of that package.  (Obvious exceptions
  244. would include system administration tools that require root priviledges
  245. to execute certain commands, modify certain files, etc.)
  246.  
  247. Every application should make extreme attempts to avoid changes to
  248. the / or /usr filesystems; these are reserved for the Unix operating system,
  249. and are not appropriate installation locations for 3rd-party software.
  250. (This comment doesn't apply to /usr/local, which is the de facto standard
  251. for the installation of non-OS software.)
  252.  
  253. Applications which require daemons to be launched at boot time should NOT
  254. modify /etc/rc.local (or its equivalent) in order to accomplish this; they
  255. should generate the appropriate /bin/sh fragment and request that
  256. the installer manually edit the appropriate files -- or provide the
  257. option for the installer to examine the fragment and then have it
  258. installed in /etc/rc.local.  For System-V style systems, the install
  259. script could generate the appropriate startup script, allow the
  260. installer to examine it, and then install it in the appropriate
  261. directories (e.g. /etc/rc/rc1.d, /etc/rc/rc2.d, and so on).
  262.  
  263. (In fact, most Unixes and Linuxes are migrating to this sort of
  264. startup, so it's probably preferable to use this facility over
  265. the BSD one, if it's available.)
  266.  
  267. The reason for this is that it's difficult for an installation
  268. script to figure out enough about a particular machine's configuration
  269. to determine just where such startup code should be placed.  Allowing
  270. the installer to interact with this process and/or to handle this step
  271. semi-manually is often necessary.  This isn't to say that a
  272. non-interactive way of handling this can't be included too -- because
  273. that's handy for non-interactive installs.
  274.  
  275. Similar comments apply to /etc/inetd.conf, /etc/services, /etc/fstab,
  276. and other critical files.
  277.  
  278. All packages should be installable at any point in the directory structure.
  279. No packages should require the creation of hard links, symbolic links,
  280. directories, or files on client (diskless or dataless) client workstations.
  281. No hardwired pathnames should exist inside the application.  (That's
  282. what environment variables and "dotfiles" are for; see below.  There's
  283. debate on this point, I should note: some folks contend that
  284. "configurable at run time" is a bad idea or impossible for setuid
  285. programs.  I think that a setuid program can read everything it needs
  286. from a config file whose pathname is hardwired into it -- which
  287. means that it doesn't strictly adhere to this principle, but it
  288. comes pretty close.)
  289.  
  290. Timothy J. Lee points out (and I agree with him) that:
  291. "One point of annoyance with some programs is shared libraries, since if
  292. the program is not compiled with the correct rpath, the user must have 
  293. the LD_LIBRARY_PATH environment variable set to find all of the proper 
  294. shared libraries.  Freeware programs should take that into account and 
  295. set the rpath properly when linking.  Binary distributions are in a    
  296. tougher situation, especially if it is not known where the program will
  297. be installed."
  298.  
  299. Use of application-specific environment variables should be minimized;
  300. applications which require large numbers of per-user variables to be
  301. initialized should utilize a "dotfile" or a wrapper instead.  For example,
  302. the Foobar software package might use a .foobarrc which contains initialization
  303. information for that application.  Appropriate provisions for host-wide
  304. and site-wide instantiations of these files should be provided, e.g.
  305. the X11 .Xdefaults/"app-defaults"/command-line-option mechanism.
  306.  
  307. Wrappers are shell scripts (or Perl scripts, or other kinds of scripts)
  308. which set the appropriate environment variables and then call the
  309. real application.  For example, a package containing commands called
  310. "foo1", "foo2", and "foo3" might put the real executables in
  311.  
  312.     /usr/local/lib/foo-app/foo1
  313.     /usr/local/lib/foo-app/foo2
  314.     /usr/local/lib/foo-app/foo3
  315.  
  316. and install a shell script in /usr/local/bin, hardlinked to foo1,
  317. foo2, and foo3, which looks something like:
  318.  
  319.     #!/bin/sh
  320.  
  321.     FOOENV=/foo/bar
  322.     ANOTHERFOOENV=fred
  323.     export FOOENV ANOTHERFOOENV
  324.  
  325.     exec /usr/local/lib/foo-app/`basename $0`
  326.  
  327. This provides a single point-of-entry to all of the sub-applications
  328. in the package, avoids cluttering the user's environment, and makes
  329. life much easier for system admins.
  330.  
  331. Additionally, no application should modify a users's existing "dotfiles",
  332. e.g. ".cshrc", but should intead confine changes to an application-specific
  333. dotfile.
  334.  
  335. In any case, any application-specific environment variables should be carefully
  336. distinguished from those which might be utilized by another application.
  337. For example, FOOBAR_DIRECTORY is vastly preferable to DIRECTORY.
  338.  
  339. It is permissible for an application to use well-known, standard environment
  340. variables (e.g. EDITOR) but it should not create or modify these.
  341.  
  342. Use of non-standard printing mechanisms is highly discouraged.  Applications
  343. should spool using the standard lp or lpd print commands.  Ralf Fassel adds
  344. "In addition, the print command itself should be configurable, not only the
  345. printer name.  We have our own cross-platform mechanism to select the
  346. printer according to the document type.  Each vendor has its own mechanism,
  347. and it's a nightmare to set up all the /etc/printcap's or
  348. /var/spool/lp/interface files."  And I concur with him.
  349.  
  350. The executables within an application (binaries, shell scripts, Perl scripts,
  351. etc.) should be carefully scrutinized to ensure that their names do
  352. not overlap with standard Unix commands or with vendor-supplied Unix
  353. commands.  (Note: add list of commands in appendix)
  354.  
  355. The use of custom kernels should be avoided if possible; in particular,
  356. the use of special device drivers for reasons other than special hardware
  357. is highly discouraged, as this makes life very difficult for large sites,
  358. especially when they attempt to upgrade their OS version.
  359.  
  360. Under no circumstances should an application replace any of the
  361. normal commands (e.g. those in /usr/bin) with its own.  If for some
  362. reason, an application requires a modified version of such a command,
  363. it should reside in the application's own directory tree and should
  364. be clearly identified at the time of the installation.  (This lets
  365. users select which version of a command they wish to run based on $path.)
  366.  
  367. Applications should make no requirements on the filesystem/network
  368. architecture; in other words, a switched/routed network consisting
  369. of diskless, dataless, and dataful nodes with local and remote
  370. / and /usr partitions using hard-mounted and automounted filesystems
  371. should run the application seamlessly.  (But it should be noted
  372. that for some applications, NFS, due to its basic design, probably
  373. just won't work.)
  374.  
  375. Applications should preserve localization options when upgraded
  376. versions are installed.
  377.  
  378. Harald Kirsch notes -- and I think he's quite right -- that:
  379.  
  380. "No executable (or shell script) should try to guess the package's
  381. installation directory from argv[0] (or $0), because due to (soft)
  382. links or mounting, the directory part of the name might be totally
  383. misleading. Use environment variables instead."
  384.  
  385. Q. What about accounting and security mechanisms?
  386.  
  387. A. Use of standard Unix accounting methods is highly encouraged.
  388.  
  389. No application should require weakening of network security
  390. by mandating use of /etc/hosts.equiv, /.rhosts, or ~<user>/.rhosts.
  391.  
  392. Applications should utilize standard Unix security mechanisms, such
  393. as /etc/group, whenever possible.  This implies that applications
  394. understand the limits on these mechanisms, e.g. MAXGROUPS.
  395.  
  396. No assumptions about the current state of any user's umask should be made.
  397. The installation script should explicitly specify the permissions
  398. and ownerships of all files and directories; these should be set in
  399. order to provide the maximum possible data security without rendering
  400. the application non-functional.  In particular, no application should
  401. require write access for its users anywhere in its own directory tree.
  402.  
  403. The use of the setuid/setgid bits should be carefully limited.
  404. Setuid/setgid shell scripts be avoided if at all possible -- especially
  405. since some Unix implementations don't support them at all.
  406.  
  407. The location of "lockfiles" should be configurable, as should the
  408. mechanism (e.g. flock(), lockf(), etc.)  Frank da Cruz points out
  409. (and I think he's right, although I sure wish he wasn't) that
  410. "This is, of course, a hornet's nest.  Even if I configure an
  411. application to use the politically correct lockfile conventious du
  412. jour, they will change out from under the application I just installed
  413. when I install a new OS release or even another application (uucp
  414. lockfiles are the worst)."
  415.  
  416. So maybe I should back off a bit on my statement about lockfiles;
  417. is there a way out of this that doesn't put the application
  418. developer in the position of trying to outguess the installer?
  419.  
  420. Applications should not require the user to grant general 
  421. read/write/execute permission to his or her own directory tree.
  422.  
  423.  
  424. Q. Are there any other general comments?
  425.  
  426. A. If shell scripts are supplied as part of a package, the Bourne
  427. shell is preferred.
  428.  
  429. If source code is supplied as part of a package, ANSI C/C++
  430. is preferred.
  431.  
  432. Use of Perl should be carefully considered, as it is not yet shipped with
  433. all production Unix releases.  But it is easily available and since it's
  434. GPL'd, it can be included with software distributions.
  435.  
  436. Applications should suppport transparent data interchange between
  437. releases and platforms.  For example, a Sun running Solaris 2.7
  438. should be able to use the client side of a database package to
  439. interrogate a database server running on Red Hat Linux 5.2.
  440.  
  441. The use of flexible, informative, and easily customizable installation
  442. scripts such as the those supplied wilth Perl 5.0 or the GNU tools
  443. is highly encouraged.  (These scripts actively seek out system information
  444. and interact with the installer in order to confirm that the automated
  445. installation will be based on verified data.)  
  446.  
  447. Q. What about installation procedures?
  448.  
  449. A.  Application installation guides should clearly identify the following:
  450.  
  451.     Operating system requirements (including revision #)
  452.     Operating system options requirement (many OS's do not require
  453.         full installation, need to know which OS features must
  454.         be installed to support application)
  455.     Operating system patches required (should reference vendor's #)
  456.     Required kernel configuration/changes
  457.     Windowing system requirements
  458.     Required daemons/services (e.g. /etc/services, /etc/inetd.conf,
  459.             /etc/rc.local)
  460.     Required utilities
  461.     Supported hardware platforms
  462.     Supported hardware options (e.g. graphics)
  463.     Memory/disk/swap requirements for minimum functionality/full-blown
  464.         install, including use of temporary/scratch file system space.
  465.     Estimates of user data storage requirements based on usage.
  466.     Performance characterization in different local/network architectures
  467.         with suggestions for first-order performance tuning.
  468.  
  469.  
  470. Installation procedures should be informative and include provisions
  471. for soft failure in the event of a problem.  Logging of the installation
  472. process should be done in order to enable post-mortem analysis.
  473.  
  474. Installation procedures should be fully executable by the "application
  475. maintenance account", which will probably not be root, if it's at
  476. all possible to do so.  (And that's probably not possible for programs
  477. that need to work with more than one UID.)  Accordingly,
  478. any installation-related changes which require root access must be
  479. clearly identified (e.g. modififying /etc/group, /etc/services).
  480.  
  481. Any application procedures which must be executed by root should
  482. be scripts and *not* binaries -- in order to allow the system
  483. administrator to examine them before running them.  If for some
  484. reason, a binary executable is necessary, then full source code
  485. and a Makefile should be provided in order to enable compilation
  486. on the local machine.
  487.  
  488. Installation procedures should support a "deinstall" facility.
  489. Peter da Silva points out that "Ideally this should be a script that
  490. can be eyeball-executed in case the system isn't entirely stable
  491. when cleanup time arrives, rather than a binary."  I think what Peter
  492. means by that is that an admin who is trying to deal with a system
  493. whose state is confused or unknown would probably feel much better
  494. manually executing the commands in the script one by one, rather
  495. than having to execute the entire script -- or worse, a binary
  496. whose precise actions are unknown.
  497.  
  498. Installation procedures should work with local and remote devices,
  499. e.g. tape and cdrom.
  500.  
  501. Install procedures should be scriptable and executable in a
  502. non-interactive way.  Non-interactive install capability helps a
  503. system administrator who is setting up a large number of computers,
  504. each with the same package.  (Or, as Greg Lindahl put it, "[...] remember
  505. that some sites may want to install your product on 1,000 servers.
  506. Forcing them to reverse-engineer your installation procedure will
  507. not make friends.")
  508.  
  509.  
  510. Q. How should I track revision levels on my package?
  511.  
  512. A. This is a thorny question, to which the best answer is "simply".
  513. Your editor would like to recommend the following standard for all
  514. Unix software packages:
  515.  
  516.     <Release>.<Patchlevel>
  517.  
  518. e.g.
  519.  
  520.     foolib-4.13
  521.  
  522. would be release 4, patchlevel 13 of the foolib package.  Your editor
  523. finds revision numbers like 5.004_03 or 0.99.6 too cryptic to be useful
  524. to anyone but the packages' authors, and suspects that many of his
  525. colleagues feel the same way.  Your editor feels he has suddenly
  526. started writing like Miss Manners and needs to stop.  Now.
  527.  
  528.  
  529. Q. Is there a way to provide pointers to new version of packages?
  530.  
  531. A. The answer to this one -- in the case of freeware packages, like
  532. the ones that comprise Linux, comes from Hσvard Lygre:
  533.  
  534.     "I am running RedHat Linux on one of my servers, and see the
  535.     need for upgrading the software from time to time (especially 
  536.     as I am using development kernels, which need newer versions of a lot 
  537.     of the packages).   However, a lot of the time,  _none_ of the files  
  538.     included says anything about where new versions of the software can be
  539.     downloaded.
  540.  
  541.     As an example, I will use the net-tools package for linux.
  542.     This package contains programs like route, ifconfig, hostname etc.
  543.     I have previously downloaded a net-tools package, however, with the
  544.     development of new kernels, there was a need for the newest.
  545.     However, in _none_ of the README, INSTALL etc. files in the source
  546.     tree of the previous net-tools package, was there an ftp or http  
  547.     address.  There was the e-mail address of the author/maintainer,  
  548.     but that's not the kind of questions you like to be bothered with when
  549.     you are a developer!  Of course, I was able to find the package after 
  550.     doing a search, but that should really not be necessary.  When
  551.     the package provides README's INSTALL's etc., there should also be an
  552.     URL of where you can get the newest version."
  553.  
  554. My comment?  Yes, that would be awfully handy.  An option like "-u"
  555. for "emit the URL where this package can be found" would be very nice.
  556. On the other hand, web locations for packages change so often that
  557. it could also become a maintenance nightmare for the developer.
  558.  
  559. So I think that this *might* work if we all agree that the URL that's
  560. embedded is the one of the (primary) site where the software package
  561. could be found *as of the time it was downloaded*.  In other words,
  562. the URL given is understood to be "where I came from" which might
  563. not be the same as "where I can be found today".
  564.  
  565. Comments, anybody?
  566.  
  567.  
  568. Q. Whew!  Anything else?
  569.  
  570. A. Oh my yes.  I'm sure that while you're reading this my mailbox
  571. is filling up with comments.  But you'll have to wait until the
  572. next revision to read them. :-)
  573.  
  574.  
  575. Q. Did you do this by yourself?
  576.  
  577. A. Oh my no.  Among the people who have helped with comments and fixes
  578. and things that I needed to think about in earlier revisions are:
  579. Chris Siebenmann, Alan Rollow, Jonathan Spangler, Mark C. Henderson,
  580. Timothy J. Lee, Pete Forman, Paul D. Smith, Greg Lindahl, Peter da Silva,
  581. Frank da Cruz, D. J. Bernstein, Harald Kirsch, Ralf Fassel,
  582. Wim Vandeputte, Hσvard Lygre.
  583. .
  584.  
  585. If there's any usefulness in this document, it's because of their help.
  586. The mistakes are still my fault, though. ;-)
  587.  
  588.  
  589. ---------------------------------------------------------------------
  590. | NOTE: The following four appendices list common names for         |
  591. | configuration files, environment variables, file suffixes, and    |
  592. | file names.  I'm well aware that they're incomplete.  Additions   |
  593. | are quite welcome.                                                |
  594. ---------------------------------------------------------------------
  595.  
  596.  
  597. Appendix I: Configuration Files/Directories
  598.  
  599.  
  600. A number of UNIX programs utilize configuration files
  601. (or "dot files", so called because their names usually
  602. begin with a .) to customize their behavior.
  603. These files usually are located in a user's home (login)
  604. directory; some of them (and their purpose) are given below.
  605.  
  606. Note that some applications have taken to using "dot directories"
  607. because they have so much information to store -- often including
  608. state information that persists between instantiations of the
  609. application -- that it would clutter up the user's home directory.
  610. So intead it winds up in a subdirectory; for example, Netscape's
  611. web browser likes to keep things in ".netscape".
  612.  
  613. Application developers shouldn't necessarily count on these
  614. being present -- but may use them if they are.  They certainly
  615. shouldn't name their own files in conflict with these names; and they
  616. should avoid modifying these files if at all possible.
  617.  
  618.  
  619. .acrorc, .acrosrch        
  620. Used by Adobe Acrobat PDF reader.
  621.  
  622. .Arena
  623. Used by the Arena web browser
  624.  
  625. .article
  626. Location of saved (posted) articles; used by Pnews.
  627.  
  628. .bash_profile
  629. .bashrc
  630. Startup information for GNU bash shell.
  631.  
  632. .bash_history
  633. Command history for GNU bash shell.
  634.  
  635. .bookmarks
  636. Used by Sun's AnswerBook applications.
  637.  
  638. .cshrc
  639. Initialization for instances of csh.
  640.  
  641. .dbxinit
  642. Startup commands and aliases for the dbx debugger.
  643.  
  644. .dddinit
  645. Startup commands and aliases for the ddd debugger.
  646.  
  647. .desksetdefaults
  648. Startup options for Sun deskset tools.
  649.  
  650. .dtprofile
  651. Startup for CDE on Solaris.
  652.  
  653. .elmrc
  654. Initialization for the Elm mail client.
  655.  
  656. .errorrc
  657. Functions for error to ignore.
  658.  
  659. .exrc
  660. Initialization and macros for vi, edit, ex and view.
  661.  
  662. .fetchmailrc
  663. Configuration information for the fetchmail POP/IMAP client.
  664.  
  665. .forward
  666. Forwarding address for incoming mail, or the name of a
  667. program to which incoming mail should be sent.
  668.  
  669. .gimp
  670. .gimprc
  671. Used by the GNU Image Manipulation Program.
  672.  
  673. .gnupg
  674. GNU implementation of PGP.
  675.  
  676. .gopherc
  677. Start up info for gopher clients.
  678.  
  679. .history
  680. Saved command history across login sessions (csh).
  681.  
  682. .hostaliases
  683. Shorthand names for hosts.
  684.  
  685. .hushlogin
  686. Suppress printing of /etc/motd on login.
  687.  
  688. .indent.pro
  689. Initialization for indent.
  690.  
  691. .ircrc
  692. Startup of ircII
  693.  
  694. .kermrc
  695. Standard Kermit initialization file
  696.  
  697. .learnrc
  698. Used by learn to mark progress.
  699.  
  700. .less
  701. .lessrc
  702. Used by the "less" paginator.
  703.  
  704. .letter
  705. Location of saved (sent) letters; used by Pnews, rn, tin.
  706.  
  707. .lisprc
  708. Initialization for Franz Liszt (lisp) sessions.
  709.  
  710. .lynrc
  711. Initialization for the Lynx web browser.
  712.  
  713. .login
  714. Initialization for csh login sessions.
  715.  
  716. .logout
  717. Commands to execute at end of csh login sessions.
  718.  
  719. .mailcap
  720. MIME definitions used by various applications
  721.  
  722. .mailrc
  723. Berkeley mailer options and aliases (Mail).
  724.  
  725. .mh_profile
  726. MH mailer options.
  727.  
  728. .mhrc
  729. MH mailer aliases.
  730.  
  731. .muttrc
  732. Initialization for the mutt mail client.
  733.  
  734. .mykermrc
  735. Personal Kermit customization file
  736.  
  737. .newsrc
  738. News articles read; used by rn, vnews and readnews.
  739.  
  740. .netrc
  741. Remote login initialization for ftp.
  742.  
  743. .netscape
  744. .netscape-bookmarks.html
  745. Used by Netscape web browser
  746.  
  747. .openwin-init
  748. Startup info for Sun's OpenWindows.
  749.  
  750. .openwin-menu
  751. Menu for Sun's OpenWindows.
  752.  
  753. .pinerc
  754. Used by the "pine" mail client.
  755.  
  756. .plan
  757. User's planned absences, contact information, etc.; printed by finger.
  758.  
  759. .pnewsexpert
  760. Used by Pnews to track user expertise.
  761.  
  762. .procmailrc
  763. Initialization and configuration for the procmail mail filter.
  764.  
  765. .profile
  766. Initialization for login sessions using sh.
  767.  
  768. .project
  769. User's current work area (project); used by finger.
  770.  
  771. .qmail
  772. Used by the QMAIL mail package.
  773.  
  774. .raplayer
  775. .raplayer30
  776. Used by the RealAudio player.
  777.  
  778. .rhosts
  779. List of pairs of login names/machine names allowed access to
  780. this account without a password via rlogin, rsh, and rcp.
  781.  
  782. .signature
  783. User's signature and electronic address; appended by postnews and Pnews.
  784.  
  785. .smrc
  786. Used by Peter da Silva's Session Manager tool.
  787.  
  788. .ssh
  789. Used by the "secure shell".
  790.  
  791. .rnhead, .rnlast, .rnlock, .rnmac, .rnsoft
  792. Used by various versions of rn/trn/strn news-reading software.
  793.  
  794. .tcl  
  795. Tool Command Language script.
  796.  
  797. .tin
  798. Startup file for the "tin" news-reading client.
  799.  
  800. .tiprc
  801. Used by cu, tip.
  802.  
  803. .tgz
  804. Gzipped archive created by gnutar.
  805.  
  806. .tkman
  807. Used by the tkman program (TK interface to manual pages).
  808.  
  809. .vimrc
  810. Used by "vim", an implementation of the vi editor.
  811.  
  812. .workmanrc, .workmandb
  813. Configuration and database for the Workman audio CD player.
  814.  
  815. .Xauthority
  816. Used for security by X window system.
  817.  
  818. .Xdefaults
  819. Configuration info for X window systems and X applications.
  820.  
  821. .xinitrc
  822. Startup information for the X window system.
  823.  
  824.  
  825.  
  826. Appendix II: Environment Variables
  827.  
  828. An array of strings called the environment is made available
  829. to each process started by Unix.  These strings are used to provide
  830. information such as terminal type, default editor, preferred mailer,
  831. and so on.  Most users set their environment in either .login (if they
  832. use csh) or .profile (if they use sh).
  833.  
  834. Some common environment variables:
  835.  
  836. ABHOME
  837. Sun's AnswerBook.
  838.  
  839. ATTRIBUTION
  840. Format of attribution line in quoted article (rn/trn/xrn)
  841.  
  842. AUTHORCOPY
  843. Where Pnews saves posted articles.
  844.  
  845. BIN
  846. Number to be placed on the top of printer listings.
  847.  
  848. CANCELHEADER
  849. Format of file to pass to CANCEL (rn/trn/xrn)
  850.  
  851. DOTDIR
  852. Location of news-related files; used by rn/trn/xrn, Pnews, Rnmail.
  853.  
  854. EDITOR
  855. User's preferred editor.
  856.  
  857. EXINIT
  858. Startup commands read by ex, edit, view and vi.
  859.  
  860. FIRSTLINE
  861. Format of first line of article displayed (rn/trn/xrn)
  862.  
  863. GR_HOME
  864. Location of librariers for xmgr/xvgr data visualization tools.
  865.  
  866. GS_LIB
  867. GNU ghostscript library directory.
  868.  
  869. HELPDIR
  870. Help files for X windows applications
  871.  
  872. HIDELINE
  873. Regular expression describing article lines to suppress (rn/trn/xrn)
  874.  
  875. HOME
  876. User's home (login) directory.
  877.  
  878. HOSTALIASES
  879. Location of .hostaliases file
  880.  
  881. HTTP_PROXY
  882. Used by various web browsers to give host/port for HTTP proxy services.
  883.  
  884. INSTALL
  885. Flags to initialize install.
  886.  
  887. KILLGLOBAL
  888. Location of global kill file (rn/trn/xrn)
  889.  
  890. KILLLOCAL
  891. Location of per-newsgroup kill file(s) (rn/trn/xrn)
  892.  
  893. LD_LIBRARY_PATH
  894. Path to search for dynamically loadable libraries.
  895.  
  896. LESS
  897. Flags to provide to the GNU "less" pager.
  898.  
  899. MAIL
  900. Location of incoming mail.
  901.  
  902. MAILER
  903. Default mailing program to use.
  904.  
  905. MAILCALL
  906. What to say when there is new mail. (rn/trn/xrn)
  907.  
  908. MAILFILE
  909. Where to check for mail. (rn/trn/xrn)
  910.  
  911. MAILHEADER
  912. The format of the header file for replies. (rn/trn/xrn)
  913.  
  914. MAILPOSTER
  915. Shell command used by reply (via mail) command (rn/trn/xrn)
  916.  
  917. MAILRECORD
  918. Saved (sent) mail (Rnmail)
  919.  
  920. MANPATH
  921. Path to search for manual pages.
  922.  
  923. MBOXSAVER
  924. The shell command to save an article in mailbox format. (rn/trn/xrn)
  925.  
  926. MORE
  927. Flags to provide to the "more" pager.
  928.  
  929. MOZILLA_HOME
  930. Netscape's installed location.
  931.  
  932. NAME
  933. User's real name.
  934.  
  935. NEWSHEADER
  936. The format of the header file for followups. (rn/trn/xrn)
  937.  
  938. NEWSPOSTER
  939. The shell command to be used by the followup commands (rn/trn/xrn)
  940.  
  941. NEWSRC
  942. Location of news control file.
  943.  
  944. NNTPSERVER
  945. Name/IP address of host providing NNTP services.
  946.  
  947. NORMSAVER
  948. The shell command to save an article in the normal format (rn/trn/xrn)
  949.  
  950. OPENWINHOME
  951. Sun, installation directory of OpenWindows.
  952.  
  953. ORGANIZATION
  954. User's organization; used by Mail and news programs.
  955.  
  956. PAGER
  957. User's preferred pagination (terminal file display) program.
  958.  
  959. PAGESTOP
  960. Regular expression matching lines as page breaks (rn/trn/xrn)
  961.  
  962.     Are you beginning to get the idea that maybe rn/trn/xrn got
  963.     just a little carried away with environment variables?
  964.  
  965. PATH
  966. The sequence of directory prefixes that sh, csh, etc.,
  967. apply in searching for a file known by an incomplete path name.
  968. The prefixes are separated by : for sh, and
  969. by spaces for csh.
  970.  
  971. PERLLIB
  972. Perl library directory.
  973.  
  974. PIPESAVER
  975. Shell command to save via a pipe. (rn/trn/xrn)
  976.  
  977. PRINTER
  978. User's default printer.
  979.  
  980. RNINIT
  981. Initialization string for rn.
  982.  
  983. RNMACRO
  984. Location of files with macros and key maps. (rn/trn/xrn)
  985.  
  986. SAVEDIR
  987. Directory for saved news articles from rn/trn/xrn.
  988.  
  989. SAVENAME
  990. The name of the file to save to, if unspecified (rn/trn/xrn).
  991.  
  992. SHELL
  993. The file name of the user's login shell.
  994.  
  995. SUBJLINE
  996. Controls the format of lines displayed by "=" (rn/trn/xrn).
  997.  
  998. TERM
  999. Terminal type for which output is to be prepared.
  1000.  
  1001. TERMINFO
  1002. Location of the terminfo directory (System V curses).
  1003.  
  1004. TERMCAP
  1005. The string describing the terminal in TERM,
  1006. or the name of the termcap file (Berkeley curses).
  1007.  
  1008. TRNINIT
  1009. Initialization string for trn.
  1010.  
  1011. USER
  1012. The login name of the user.
  1013.  
  1014. VISUAL
  1015. Preferred screen editor; used by mail and news programs.
  1016.  
  1017. WORKMANDB
  1018. Location of data files for Workman CD player application.
  1019.  
  1020. WWW_HOME ~/web/home.html
  1021. Starting document for web browsers.
  1022.  
  1023. XAPPLRESDIR [DEPRECATED]
  1024. Replaced by XFILESEARCHPATH and XUSERFILESEARCHPATH.
  1025.  
  1026. XFILESEARCHPATH
  1027. Colon-separated list of directories to search for
  1028. system X resource files.
  1029. Can contain special tokens to facilitate i18n support.
  1030.  
  1031. XUSERFILESEARCHPATH
  1032. Colon-separated list of directories to search
  1033. for user-specific X resource files.
  1034. Can contain special tokens to facilitate i18n support.
  1035.  
  1036. YOUSAID
  1037. Format of attribution line in front of the quoted article (rn/trn/xrn).
  1038.  
  1039.  
  1040. Appendix III: File Suffix Conventions
  1041.  
  1042. Although UNIX allows users to store data and text in files
  1043. of practically any name, certain conventions have evolved
  1044. over the years.  Here is a quick list of the suffixes most often
  1045. encountered:
  1046.  
  1047. .a
  1048. Archive (ar) file.
  1049.  
  1050. .awk
  1051. Awk script.
  1052.  
  1053. .bib
  1054. Bibliographic data file.
  1055.  
  1056. .c
  1057. C source.
  1058.  
  1059. .cc
  1060. C++ source
  1061.  
  1062. .dvi
  1063. Device-independent text formatter output.
  1064.  
  1065. .f
  1066. Fortran (f77) source.
  1067.  
  1068. .h
  1069. Source code include file, usually C.
  1070.  
  1071. .html
  1072. HTML document
  1073.  
  1074. .ksc
  1075. Kermit script
  1076.  
  1077. .l
  1078. Lisp source; Lex source.
  1079.  
  1080. .me
  1081. Nroff/troff source using -me macros.
  1082.  
  1083. .mm
  1084. Nroff/troff source using -mm macros.
  1085.  
  1086. .ms
  1087. Nroff/troff source using -ms macros.
  1088.  
  1089. .n
  1090. Nroff source.
  1091.  
  1092. .o
  1093. Object (as output).
  1094.  
  1095. .p
  1096. Pascal source; Prolog source.
  1097.  
  1098. .pl
  1099. Perl program.
  1100.  
  1101. .s
  1102. Assembler (as) source.
  1103.  
  1104. .sh
  1105. Bourne (sh) shell script.
  1106.  
  1107. .tar
  1108. Archive created by tar.
  1109.  
  1110. .tex
  1111. TeX source.
  1112.  
  1113. .txt   
  1114. A plain text file
  1115.  
  1116. ,v
  1117. RCS delta file.
  1118.  
  1119. .w
  1120. A Wart preprocessor file (similar to Lex).
  1121.  
  1122. .y
  1123. Yacc source.
  1124.  
  1125. .Z
  1126. Compressed file.
  1127.  
  1128. .cf
  1129. configuration file, as in sendmail.cf
  1130.  
  1131. .z
  1132. packed file
  1133.  
  1134. .gz
  1135. gzipped file
  1136.  
  1137. .zip
  1138. zipped file
  1139.  
  1140. .C
  1141. C++ source, or compacted file (obsolete)
  1142.  
  1143.  
  1144.  
  1145. Appendix IV: File Name Conventions
  1146.  
  1147.  
  1148. Although UNIX allows users to store data and text in files
  1149. of practically any name, certain conventions have evolved
  1150. over the years.  Here is a quick list of the filenames most often
  1151. encountered, and what they're used by:
  1152.  
  1153. a.out
  1154. Default name of executable files produced by cc,
  1155. f77, pc, ld, and other compilers and loaders.
  1156.  
  1157. calendar
  1158. Location of user's schedule; used by calendar.
  1159.  
  1160. Configure
  1161. A shell script found in the top-level directory of software
  1162. distributions.  Usually refers to a Larry Wall-style interactive
  1163. configure, whose first appearance (I think) was in "rn".
  1164.  
  1165. configure
  1166. A shell script found in the top-level directory of software
  1167. distributions.  Usually refers to a GNU-style non-interactive
  1168. configure, found in things like "gcc".
  1169.  
  1170. core
  1171. *.core
  1172. core.*
  1173. Created by Unix when a program attempts an illegal operation;
  1174. useful with adb, dbx, gcore and pxp.  (More recent Unixes tend
  1175. toward the latter two forms.)
  1176.  
  1177. dead.article
  1178. Used by Pnews and postnews for interrupted articles.
  1179.  
  1180. dead.letter
  1181. Used by Mail and mail for interrupted letters.
  1182.  
  1183. gmon.out
  1184. Profiling information; used by gprof.
  1185.  
  1186. Imakefile
  1187. A meta-makefile which is used to create Makefiles via tools
  1188. such as xmkmf.
  1189.  
  1190. lex.yy.c
  1191. Output file from lex.
  1192.  
  1193. Makefile, makefile
  1194. Standard name for make command file.  See also cc.
  1195.  
  1196. mbox
  1197. Used by Mail and mail as default mailbox.
  1198.  
  1199. mon.out
  1200. Profiling information; see prof.
  1201.  
  1202. nohup.out
  1203. Output from background commands after logout; see nohup, sh, and csh.
  1204.  
  1205. strings
  1206. Quoted strings file from xstr.
  1207.  
  1208. tags
  1209. Function references in C source;
  1210. created by ctags and used by vi, ex, edit, and view.
  1211.  
  1212. typescript
  1213. Default name for script output.
  1214.  
  1215. xs.c
  1216. C source created by xstr.
  1217.  
  1218. y.output, y.tab.h, y.tab.c
  1219. Various yacc output files.
  1220.  
  1221. Administrivia:
  1222.  
  1223.     I receive an average of hundreds of mail messages per day.  If you
  1224.     want to make sure that your update/correction/reply to this
  1225.     article comes to my attention when I'm working on the next
  1226.     version, please send your message as a reply to this article,
  1227.     i.e. make absolutely certain that you preserve the "Subject:"
  1228.     line.  If you don't do this, your reply may sit in one of my
  1229.     numerous mail queues for months or even years.
  1230.  
  1231.     Please don't send an update more than once -- doing so only
  1232.     adds to the queue that I have to process when doing updates.
  1233.     If you want to make certain that I've received something, then
  1234.     make a note of the information on the "Version:" line above.
  1235.     If it has changed when you next see this article, and your
  1236.     information isn't included, then I've missed it.  Otherwise,
  1237.     it's safe to presume I've got it and it's queued for inclusion.
  1238.  
  1239.     The FAQ may be reproduced and propagated via http, ftp, gopher
  1240.     or other common Internet protocols by anyone provided that (1)
  1241.     it is reproduced in its entirety (2) no fee is charged for access
  1242.     to it and (3) it's kept up-to-date.  This latter is probably best
  1243.     accomplished by mirroring one of the FAQ archives -- that way
  1244.     you'll get a new copy everytime I update it, which is
  1245.     approximately monthly.   (If you do put it up on the web, I'd
  1246.     like to know the URL, but that's not a requirement.  It just
  1247.     would be nice.)
  1248.  
  1249.     Reproduction of this FAQ on paper, CDROM or other media which
  1250.     are sold is permissible only with the express written consent
  1251.     of its author.
  1252.  
  1253.     If you are reading a copy of this document which appears to be
  1254.     out-of-date, there are a variety of methods that you can use to
  1255.     retrieve the most current method.  If you are familiar with access
  1256.     to the FAQ archives via mail, ftp, and www, then you already know how.
  1257.     If not,     then send email to mail-server@rtfm.mit.edu with the command
  1258.     "send usenet/news.answers/news-answers/introduction" in the message,
  1259.     and a complete guide to FAQ retrieval will be mailed to you.
  1260.  
  1261. Copyright Rich Kulawiec, 1997, 1998, 1999.
  1262.