1 @c remember to put in the autoload stuff!!!! see the .el files
3 @c This file is included as an appendix in gnats.texi.
5 @cindex installing GNATS
6 @cindex configuring GNATS
7 @cindex setting up GNATS
10 @xref{Locations,,Where the tools and utilities reside}.
12 There are several steps you need to follow to fully configure and
13 install @sc{gnats} on your system. You need @code{root} access in order
14 to create a new account for @code{gnats} and to install the @sc{gnats}
15 utilities. You may need @code{root} access on some systems in order to
16 set mail aliases in place and to allow this new account access to
17 @code{cron} and @code{at}.
19 If you are updating an older version of @sc{gnats} rather than installing
20 from scratch, see @ref{Upgrading,,Upgrading from older versions}.
22 To build @sc{gnats}, you must:
26 Run @code{configure}, with correct options if the defaults are
27 unsuitable for your site. @xref{Configure and make,,Configuring and
28 compiling the software}. Default installation locations are in
29 @ref{Locations,,Where @sc{gnats} lives}.
32 Compile the @sc{gnats} programs on your system. @xref{Configure and
33 make,,Configuring and compiling the software}.
36 Install the @sc{gnats} tools and utilities locally, and install the user
37 tools on every machine in your local network. @xref{Installing
38 utils,,Installing the utilities}.
41 Set up mail aliases for @sc{gnats}. @xref{Aliases,,Setting up mail
45 Install the @sc{gnats} user tools (@code{query-pr}, @code{nquery-pr}, @code{edit-pr},
46 @code{send-pr}) around your network. @xref{Installing tools,,Installing
50 Install the @sc{gnats} daemon @file{gnatsd}.
53 Update the local configuration files
56 config categories submitters responsible gnatsd.conf
60 in @w{@file{@var{GNATS_ROOT}/gnats-adm}}. @xref{Local
61 configuration,,Changing your local configuration}.
64 Create a distribution of @code{send-pr} for submitters outside your
65 organization. @xref{mkdist,,Configuring @code{send-pr} for the outside
70 * Configure and make:: Configuring and compiling the software
71 * Installing utils:: Installing the utilities
72 * Aliases:: Setting up mail aliases
73 * Installing the daemon:: Installing the daemon
74 * Installing tools:: Installing the user tools
75 * Upgrading:: Upgrading from older versions
78 @node Configure and make
79 @section Configuring and compiling the software
80 @cindex unpacking the distribution
81 @cindex configuring and compiling the software
82 @cindex compiling the software
83 @cindex @code{configure}
88 First, unpack your distribution. We provide source code in a @code{tar}
89 file which was compressed using @code{gzip}. The code can be extracted
90 into a directory @var{unpackdir} using
95 tar zxvf gnats-@value{VERSION}.tar.z
98 The sources reside in a directory called @file{gnats-@value{VERSION}}
99 when unpacked. We call this the @dfn{top level} of the source
100 directory, or @dfn{srcdir}. The sources for the @sc{gnats} tools are in
101 the subdirectory @file{gnats-@value{VERSION}/gnats/*}. Lists of files
102 included in the distribution are in each directory in the file
105 @cindex lisp file installation
106 @cindex Emacs lisp file installation
108 You may wish to alter the installation directory for the Emacs lisp
109 files. If your Emacs lisp library is not in
110 @w{@file{@var{prefix}/lib/emacs/lisp}}, edit the files
113 @var{srcdir}/gnats/Makefile.in @emph{and}
114 @var{srcdir}/send-pr/Makefile.in
118 Change the variable @samp{lispdir} from @samp{$(datadir)/emacs/lisp} to
119 the directory containing your Emacs lisp library. For information on
120 @var{prefix}, see @ref{prefix,,@var{prefix}}.
123 Run @code{configure}. You can nearly always run @code{configure} with
127 ./configure --with-full-gnats
131 and the ``Right Thing'' happens:
135 @sc{gnats} is configured in the same directory you unpacked it in;
138 when built, @sc{gnats} runs on the machine you're building it on;
141 when installed, files are installed under @file{/usr/local}
142 (@pxref{Locations,,Where @sc{gnats} lives}).
145 @sc{gnats} operates by default behavior (@pxref{default behavior,,Default
149 @cindex @code{configure}
150 The full usage for @code{configure} is:
153 configure [ --with-full-gnats ]
154 [ --prefix=@var{prefix} ]
155 [ --exec-prefix=@var{exec-prefix} ]
156 [ --with-gnats-root=@w{@var{GNATS_ROOT}} ]
157 [ --with-gnats-server=@w{@var{hostname}} ]
158 [ --with-gnats-service=@w{@var{service-name}} ]
159 [ --with-gnats-user=@w{@var{username}} ]
160 [ --with-gnats-port=@w{@var{port-number}} ]
165 @cindex @code{with-full-gnats}
166 @item --with-full-gnats
167 All programs are to be built; this includes the user utilities, the
168 administrative utilities, and the internal utilities. Use this when
169 configuring the utilities for the machine where @sc{gnats} is to run.
170 Omit it when building only the user utilities for other machines on your
171 network; see @ref{Installing tools,,Installing the user tools}.
174 @item --prefix=@var{prefix}
175 All host-independent programs and files are to be installed under
176 @var{prefix}. (Host-dependent programs and files are also installed in
177 @var{prefix} by default.) The default for @var{prefix} is
178 @w{@file{/usr/local}}. @xref{Locations,,Where @sc{gnats} lives}.
180 @cindex @var{exec-prefix}
181 @item --exec-prefix=@var{exec-prefix}
182 All host-dependent programs and files are to be installed under
183 @var{exec-prefix}. The default for @var{exec-prefix} is @var{prefix}.
184 @xref{Locations,,Where @sc{gnats} lives}.
186 @cindex @var{GNATS_ROOT}
187 @item --with-gnats-root=@w{@var{GNATS_ROOT}}
188 The database and its data files are to be installed into
189 @w{@var{GNATS_ROOT}}. The default for @w{@var{GNATS_ROOT}} is
190 @w{@file{@var{prefix}/lib/gnats/gnats-db}}. @xref{Locations,,Where
193 @cindex --with-gnats-server
194 @item --with-gnats-root=@w{hostname}
197 @cindex --with-gnats-service
198 @item --with-gnats-root=@w{@var{service-name}}
201 @cindex --with-gnats-user
202 @item --with-gnats-user=@w{@var{username}}
205 @cindex --with-gnats-port
206 @item --with-gnats-port=@w{@var{port-number}}
210 Give verbose output while @code{configure} runs.
213 @xref{Using configure,,Using @code{configure},configure,Cygnus
216 @cindex building in a different directory
218 You can build @sc{gnats} in a different directory (@var{objdir}) from the
219 source code by calling the @code{configure} program from the new
225 @var{srcdir}/configure @dots{}
229 By default, @code{configure} compiles the programs in the same directory
230 as the sources (@var{srcdir}). Emacs lisp files are byte-compiled if
231 @code{make} can find Emacs on your local system.
241 from the directory where @code{configure} created a @file{Makefile}.
242 (This may not be the same directory as the source directory.) These
250 Create @samp{info} files using @code{makeinfo}.
254 @node Installing utils
255 @section Installing the utilities
256 @cindex installing the utilities
258 The following steps are necessary for a complete installation. You may
259 need @code{root} access for these.
263 Install the utilities by
267 make install install-info
270 These targets indicate:
274 Installs all programs into their configured locations
275 (@pxref{Locations,,Where @sc{gnats} lives}).
278 Installs @samp{info} files into their configured locations
279 (@pxref{Locations,,Where @sc{gnats} lives}).
282 After you have installed @sc{gnats}, you can remove the object files with
288 @cindex @code{autoload} commands
289 @cindex loading @code{.el} files
290 @cindex Emacs functions
292 Place the following lines in the file @file{default.el} in your Emacs
293 lisp library, or instruct your local responsible parties to place the
294 lines in their local editions of @file{.emacs}:
297 (autoload 'edit-pr "gnats"
298 "Command to edit a problem report." t)
299 (autoload 'view-pr "gnats"
300 "Command to view a problem report." t)
301 (autoload 'unlock-pr "gnats"
302 "Unlock a problem report." t)
303 (autoload 'query-pr "gnats"
304 "Command to query information about problem reports." t)
305 (autoload 'send-pr-mode "send-pr"
306 "Major mode for sending problem reports." t)
307 (autoload 'send-pr "send-pr"
308 "Command to create and send a problem report." t)
311 Emacs lisp files are byte-compiled if @code{make} can find Emacs on your
316 @cindex creating an account for @sc{gnats}
317 Create an account for a user named @sc{gnats}. This user must have an
318 entry in the file @file{/etc/passwd}. The home directory for this
319 account should be the same directory you specified for @var{GNATS_ROOT}
320 in the file @file{Makefile.in}. Also, the default @code{PATH} for this
321 user should contain @w{@file{@var{exec-prefix}/bin}} and
322 @w{@file{@var{exec-prefix}/lib/gnats}}.
327 Allow the new user @code{gnats} access to @code{cron} and @code{at}. To
328 do this, add the name @code{gnats} to the files @w{@file{cron.allow}} and
329 @w{@file{at.allow}}, which normally reside in the directory
330 @w{@file{/var/spool/cron}}. If these files do not exist, make sure
331 @code{gnats} does not appear in either of the files @w{@file{cron.deny}}
332 and @w{@file{at.deny}} (in the same directory).
335 For the following steps, log in as @code{gnats}.
339 Edit the files @file{categories}, @file{responsible}, and
340 @file{submitters} in the directory @w{@file{@var{GNATS_ROOT}/gnats-adm}}
341 (@pxref{Local configuration,,Changing your local configuration}) to
342 reflect your local needs. Be sure to run @code{mkcat} after you update
343 the @file{categories} file (@pxref{mkcat,,Adding a new problem
344 category}). @emph{Note:} these templates are not installed if they
345 already exist, i.e. if you are upgrading. @xref{Upgrading,,Upgrading
346 from older versions}.
349 If you wish to install the @sc{gnats} user tools on other machines on
350 your network, see @ref{Installing tools,,Installing the user tools}.
353 @cindex @code{crontab}
355 Create a @code{crontab} entry that periodically runs the program
356 @code{queue-pr} with the @samp{--run} option. For example, to run
357 @w{@samp{queue-pr --run}} every ten minutes, create a file called
358 @file{.mycron} in the home directory of the user @code{gnats} which
362 0,10,20,30,40,50 * * * * @var{exec-prefix}/lib/gnats/queue-pr --run
366 (Specify the full path name for @code{queue-pr}.) Then run
373 See the @code{man} pages for @code{cron} and @code{crontab} for details
374 on using @code{cron}.
378 @section Setting up mail aliases
382 The following mail aliases must be placed in the file
383 @w{@file{/etc/aliases}} on the same machine where the @sc{gnats} tools
384 are installed. You may need @code{root} access to add these aliases.
388 @cindex @code{gnats-admin} alias
389 Create an alias for the @sc{gnats} administrator. This address should
390 point to the address of the person in charge of administrating
394 gnats-admin: @var{address}
399 @cindex incoming alias for Problem Reports
400 @cindex alias for incoming Problem Reports
401 @cindex @code{queue-pr -q}
402 Create an alias to redirect incoming Problem Reports. This alias should
403 redirect incoming mail via a @dfn{pipe} to the program @w{@samp{queue-pr
404 -q}}. For example, if Problem Reports coming to your site are to arrive
405 at the address @samp{bugs@@your.company.com}, create an alias to the
409 bugs: "| @var{exec-prefix}/lib/gnats/queue-pr -q"
413 This places incoming Problem Reports in
414 @w{@file{@var{GNATS_ROOT}/gnats-queue}}.
417 @cindex @var{site} alias
418 @cindex mail alias for your @emph{site}
419 @cindex alias for your @emph{site}
420 Create an alias for your site. This alias should be the same nametag
421 indicated by the variable @w{@samp{GNATS_SITE}} in the file
422 @w{@file{@var{GNATS_ROOT}/gnats-adm/config}} (@pxref{config,,The
423 @code{config} file}), with an added suffix @samp{-gnats}. This alias,
424 @w{@samp{@var{GNATS_SITE}-gnats}}, should point toward the local
425 submission address. For instance, if your site is Tofu Technologies,
426 the presence of @sc{gnats} on your @var{site} would be aliased as the
427 following (the previous example is also shown):
430 bugs: "| @var{exec-prefix}/lib/gnats/queue-pr -q"
435 The report submission utility @code{send-pr} automatically appends the
436 @samp{-gnats} to any arguments you specify (@pxref{send-pr,,Submitting
437 Problem Reports}). The @code{send-pr} which was installed when you
438 typed @w{@kbd{make install}} has a default argument of @var{GNATS_SITE},
439 your site, so that when your local users simply type @kbd{send-pr} mail
440 is sent to your local @sc{gnats}. Part of the installation process a
441 Submitter Site follows when installing @code{send-pr} is to set up an
442 alias for the Support Site from whom this submitter received
443 @code{send-pr}. In other words, anyone you distribute @code{send-pr} to
444 is instructed to make an alias
447 tofu-gnats: bugs@@tofu.com
451 You may also wish to forward a copy of each incoming Problem Report to a
452 log. This can be accomplished with something like:
455 bug-q: "| @var{exec-prefix}/lib/gnats/queue-pr -q"
456 bug-log: @var{GNATS_ROOT}/gnats-adm/bugs.log
461 This configuration archives incoming Problem Reports in the file
462 @w{@file{@var{GNATS_ROOT}/gnats-adm/bug.log}}, and also feeds them to the
463 program @code{queue-pr}. (Remember, @file{bug.log} needs to be
464 world-writable, and should be pruned regularly; @pxref{Management,,
465 @sc{gnats} Administration}.)
468 If you want your users to be able to query the database by mail, use the
472 query-pr: "| @var{exec-prefix}/lib/gnats/mail-query"
476 The @code{mail-query} program uses @samp{--restricted} to search on the
477 database, and by default only searches for PRs that aren't closed
478 (@pxref{query-pr,,Querying the database}).
482 @c ---------------------------------------------------------------
483 @node Installing the daemon
484 @section Installing the daemon
486 @cindex using @sc{gnats} over a network
488 By default, the daemon and clients are set to use port 1529. Add the line
491 support 1529/tcp # GNATS
495 to your @file{/etc/services} file. If you want a different port,
496 or a different service name or port, configure @sc{gnats} with
499 --with-gnats-service=@var{servicename}
500 --with-gnats-port=@var{portnumber}
503 In your @file{inetd.conf} file, add the line
506 support stream tcp nowait gnats /usr/local/lib/gnats/gnatsd gnatsd
510 adjusting the path accordingly. To make inetd start spawning the @sc{gnats} daemon
511 when connected on that port, send it a hangup signal (@code{HUP}).
513 By default, the server for the @sc{gnats} daemon is assumed to be one with the
514 name of @samp{gnats}. If you'd like something else, use
517 --with-gnats-server=@var{hostname}
520 In the @file{gnats-adm} directory, you'll want to edit @file{gnatsd.conf}.
521 It lists the hosts allowed to access your server. Or, if you're using
522 Kerberos, it shows the sites that don't require Kerberos authentication.
523 The format is reserved for future revision; only the first field is
531 The second field may be used for things like controlling what
532 categories, submitter-id'd PRs, etc., can be accessed from that site.
533 In the file that logs syslog messages (@file{/var/adm/messages}, for
534 example) you'll find the notification of denied access.
537 @c ---------------------------------------------------------------
538 @node Installing tools
539 @section Installing the user tools
541 @cindex using @sc{gnats} over a network
542 @cindex configuring @sc{gnats} on a network
544 When you install the @sc{gnats} utilities, the user tools are installed
545 by default on the host machine. If your machine is part of a network,
546 however, you may wish to install the user tools on each machine in the
547 network so that responsible parties on those machines can submit new
548 Problem Reports, query the database, and edit existing PRs. To do this,
549 follow these steps @emph{on each new host}. You may need root access on
554 Make sure that the directory where @sc{gnats} resides is mounted to each
555 system that will need access to it, so @var{GNATS_ROOT} will be the same
556 for each host. (You can do this with symbolic links as well.)
559 Either mount the disk which contains your source directory, or make a
560 copy of the @sc{gnats} source code tree in a separate directory on each
561 system you wish to build on.
564 Run @code{configure}, @emph{without} specifying
565 @w{@samp{--with-full-gnats}}, and using the same argument (if any) for
569 --with-gnats-root=@var{GNATS_ROOT}
572 that you specified when building the @sc{gnats} utilites
573 (@pxref{Configure and make,,Configuring and compiling the software}).
574 You may use different values for the other options to @code{configure}.
575 Again, @emph{do not} use @w{@samp{--with-full-gnats}} at this point, as
576 that creates all the @sc{gnats} programs. Without this option,
577 @code{configure} only instructs the resulting @file{Makefile} to create
581 @emph{You may need @code{root} access on each host for the following steps.}
584 @cindex creating an account for @sc{gnats}
585 Create an account for a user named @sc{gnats} on the new host. This user
586 must have an entry in the file @file{/etc/passwd}. The user ID for
587 @code{gnats} must be the same as on the main @sc{gnats} host.
593 make all info install install-info
597 This builds and installs the @code{gnats} user tools @w{@code{query-pr}},
598 @w{@code{edit-pr}}, and @w{@code{send-pr}} on the new host, and installs
599 them in @w{@file{@var{exec-prefix}/bin}} on the new host (@emph{Note:}
600 the value for @var{exec-prefix} on the new host may be different from
601 the value you used when building the @sc{gnats} utilities;
602 @pxref{exec-prefix,,@var{exec-prefix}}). The programs @code{pr-edit}
603 and @code{pr-addr} are installed into
604 @w{@file{@var{exec-prefix}/lib/gnats}}.
606 @code{info} files are created as well, and are installed into
607 @w{@file{@var{prefix}/info}}. The Elisp files @file{gnats.el} and
608 @file{send-pr.el} (and possibly @file{gnats.elc}
609 if @code{make} was able to compile them using Emacs) are installed into
610 @w{@file{@var{prefix}/lib/emacs/lisp}} unless you change the
611 @samp{lispdir} variable in @file{Makefile.in} (@pxref{Configure and
612 make,,Configuring and compiling the software}).
614 @cindex @code{autoload} commands
615 @cindex loading @code{.el} files
616 @cindex Emacs functions
618 Add the following lines to the file @w{@file{default.el}} in the Emacs
619 lisp repository on the new host, or instruct your responsible parties
620 who use these hosts to add them to their @file{.emacs} files:
623 (autoload 'edit-pr "gnats"
624 "Command to edit a problem report." t)
625 (autoload 'view-pr "gnats"
626 "Command to view a problem report." t)
627 (autoload 'unlock-pr "gnats"
628 "Unlock a problem report." t)
629 (autoload 'query-pr "gnats"
630 "Command to query information about problem reports." t)
631 (autoload 'send-pr-mode "send-pr"
632 "Major mode for sending problem reports." t)
633 (autoload 'send-pr "send-pr"
634 "Command to create and send a problem report." t)
638 Copy the file @w{@file{@var{prefix}/lib/gnats/@var{site}}} from the
639 original host to the new host (which may have a different value for
640 @var{prefix}). This is the list of valid categories that
641 @w{@code{send-pr}} uses (@pxref{Locations,,Where @sc{gnats} lives}).
642 @var{site} is your local site, the value of @w{@samp{GNATS_SITE}} in the
643 @file{config} file (@pxref{config,,The @code{config} file}).
647 @c ---------------------------------------------------------------
649 @section Upgrading from older versions
650 @cindex upgrading from older versions
652 If you are upgrading from a previous release of @sc{gnats}, you probably
653 do not want to delete your current configuration files or your current
654 database. The new @sc{gnats} can be installed around the older version.
660 Specify your current @var{GNATS_ROOT} on the command line to
661 @code{configure} when you build the new tools, with
664 configure --with-full-gnats --with-gnats-root=@var{GNATS_ROOT}
668 (@xref{Configure and make,,Configuring and compiling the software}.)
671 Remove the directory @w{@file{gnats-bin}} from @w{@var{GNATS_ROOT}}; it is
675 Update your current mail aliases to reflect that @w{@code{queue-pr}} now
676 resides in @w{@file{@var{exec-prefix}/lib/gnats}} rather than
677 @w{@file{@var{GNATS_ROOT}/gnats-bin}} (@pxref{Locations,,Where @sc{gnats}
681 Change the default @code{PATH} for the @code{gnats} user to search the
682 directories @w{@file{@var{exec-prefix}/bin}} and
683 @w{@file{@var{exec-prefix}/lib/gnats}}.
686 Reinstall the @sc{gnats} user tools on all other hosts on your network
687 (@pxref{Installing tools,,Installing the user tools}).
690 Redistribute @code{send-pr} to your Submitter Sites
691 (@pxref{mkdist,,Configuring @code{send-pr} for the outside world}).
692 This is not absolutely necessary, as @sc{gnats} can read Problem Reports
693 generated by older versions of @code{send-pr}. It should be done
694 eventually, however, as @w{@code{send-pr}} is improved over older
697 @c FIXME - anything else?