Server Setup and Basic ConfigurationHylaFAX is composed of client and server applications. Client applications are programs that normal users invoke to send facsimile, query the status of facsimile servers, etc. Server applications are programs that reside only on the machine where the fax modems are present. HylaFAX™ is distributed so that the normal make install step done after the software is built will install both client and server applications. Client-only systems require a slightly different procedure that is discussed in the next chapter on ``Client Setup.'' This chapter discusses setting up a server machine for use.
A system acting as a HylaFAX™ server usually runs at least two server processes: the HylaFAX™ scheduler process faxq and the client-server protocol process hfaxd. Server systems may also use the HylaFAX™ front-door process faxgetty to monitor each modem on the system and possibly receive incoming facsimile calls. A send-only system would run faxq and hfaxd but (probably) not faxgetty. A system that was not going to use the transmit capabilities would not run faxq.
In addition to the server processes that operate all the time HylaFAX™ comes with two programs that are intended to be run periodically. The faxqclean program is responsible for purging unwanted files from the spooling area on a server and the faxcron script monitors the spooling area and performs routine maintenance tasks such as truncating log files. These programs are usually invoked by the system cron program.
The remainder of this chapter discusses the basic steps required to setup a HylaFAX™ server machine:
Installing HylaFAX™Most installations of HylaFAX™ will be done from a source code distribution. In this case installation on a server machine is done by running:
When working from a binary distribution the technique required to install the software programs varies based on the format used to distribute the materials. Each binary distributions of HylaFAX™ should include detailed installation instructions that reflect the exact contents of the distribution and any distribution-specific requirements.
Checking Your ModemOnce you have a modem to use with HylaFAX™ first make sure that the modem works for data use. One can not say this enough. If you can not use a communication program such as cu, tip, or kermit, with your modem, do not try to configure it for use with HylaFAX™. This means in particular that you should verify that you have a working cable between your host and modem and that this cable is suitable for use. That is, that the cable has the relevant signals for doing hardware flow control if that is necessary and that it passes the DCD and DTR signals appropriately.
Verify that the modem you are using is a fax modem. This can be done by communicating directly with the modem using a communication program such as cu; for example:
Selecting a Flow Control SchemeFlow control refers to the mechanism used to control the transfer of data between the host and the modem (there may also be a flow control scheme used in modem-to-modem communication but the discussion here is specific to the scheme used between the host and a modem). The rules to use for selecting a host-modem flow control method for facsimile use are:
|Beware that although a modem may properly implement hardware flow control when doing data communication, it may not support hardware flow control during facsimile communication. Consult the modem information for specifics on some modems.|
If a prototype configuration file for your modem is included in the HylaFAX™ distribution then the appropriate default flow control scheme should be defined for the modem.
|Note that some operating systems do not support RTS/CTS flow control unless carrier is present. In particular, some versions of SunOS and Solaris requires patches to correct this mis-behaviour; consult the sections below for system-specific guidance.|
|Versions of IRIX prior to 6.2 have a bug in the device driver for the on-board serial ports on IP20 and IP22 systems that causes RTS/CTS flow control to be turned off by HylaFAX™. Patch 475 (``RTS/CTS flow control busted when CLOCAL is set'') and its successors correct this problem and must be installed to use HylaFAX™ with hardware flow control. For complete details refer to the section below on IRIX-specific guidance.|
When in doubt or having trouble, configure the modem to use software flow control for fax use.
Choosing a TTY DeviceThere are two things to beware of in selecting a tty device file to use with your modem: flow control usage and port locking mechanisms.
On many systems different devices are used to select different flow control schemes and/or whether or not the system will monitor the DCD signal. For example, IRIX systems use ttym* and ttyf* device names to identify devices that monitor DCD but only the latter support RTS/CTS flow control. Similarly, the FAS driver for SCO uses a different names as does the standard HP-UX terminal driver.
On some systems inbound and outbound port use is interlocked by using a pair of devices, one for inbound use and another for outbound use. Typically this scheme works by stopping programs that use the inbound device until an inbound call is received (and DCD is raised by the modem). Outbound usage is also interlocked against applications waiting for the inbound device. HylaFAX™ provides no direct support for this because this scheme requires that a modem auto-answer incoming calls (something that is hard to make work with multi-mode--i.e. fax and data--modems). When faced with a system that uses this scheme most people elect to avoid the inbound device and run both incoming and outgoing traffic on the outbound device, using the built-in interlocking mechanism provided by HylaFAX™. In this case the appropriate device to use is typically named /dev/cu*, but check local conventions.
On some systems, especially SVR4-based systems, device special files are located in subdirectories. Thus a typical device name might be /dev/term/10. HylaFAX™ server processes often reference a modem by a device identifier that is derived from the device filename by removing the leading ``/dev/'' prefix and then converting any remaining ``/'' characters to ``_'' characters. Thus /dev/term/10 would have a device identifier of ``term_10''. Usually this work is transparent and device filenames can be interchanged freely with device identifiers. However because of this interchangability it is not possible to use device files that have names that include ``_'' in them, e.g. ``/dev/my_tty''.
Using faxsetup to Configure a Server MachineBefore any HylaFAX™ software can be used on a server machine the faxsetup script must be run. This interactive script verifies the installation of the HylaFAX™ software and also carries out a variety of one-time tasks that prepare the system for use. Running faxsetup is especially important when working from a binary distribution because it checks that parameters setup at the time the distribution was built are correct for the target machine where the software is to be run.
faxsetup carries out a variety of tasks and then writes configuration information to two files in the HylaFAX™ spooling area. The file etc/setup.cache in the spooling area contains the parameter settings used by HylaFAX™ command scripts while the etc/setup.modem file contains settings and shell functions used by command scripts that communicate with modems.
|The setup.cache and setup.modem files must be present for HylaFAX™ to function properly. If these files do not exist then HylaFAX™ server applications will terminate with an error message.|
The work done by faxsetup includes the items listed below. Note that faxsetup always prompts for permission before doing anything that might affect normal system operation (e.g. adding a new user to the password file).
Using faxaddmodem to Configure ModemsModems are configured for use with the faxaddmodem script. This is an interactive script that walks you through the configuration and installation of a new or existing modem. Even if you have a previous version of HylaFAX™ or FlexFAX installed it is a good idea to run faxaddmodem to update the configuration information for your modems after installing a new distribution.
faxaddmodem may be run directly from the command line or via the faxsetup script that is used to prepare a server machine for use with HylaFAX™.
The remainder of this section shows a sample configuration session and describes the work done. The session is shown on the left hand side in a fixed width font with user-supplied input in a bold font. Comments are shown to the right in a normal or italic font, separated by horizontal rules. Blank space is present in the session output where it is needed to fit comments on the page; in normal operation the output from faxaddmodem does not include this white space. faxaddmodem displays the current/default setting for a configuration parameter enclosed in ``''; the current value is accepted by typing a carriage-return.
This session was collected on a Silicon Graphics Indy machine running IRIX 5.3 and communicating with a USR Courier v.Everything modem.
|If your modem is configured to communicate with the host at a fixed speed, then use the -s option to lock the host-modem baud rate. Note also that faxaddmodem must be run as root.|
Collect server-specific configuration parameters. Per-modem configuration files contain parameters that pertain to the operation of the modem and parameters that control the function of the HylaFAX™ server software that controls the modem. The former parameters are termed modem-specific while the latter are referred to as server-specific. faxaddmodem collects server-specific parameters first and then modem-related parameters are setup based on the type of modem.
The configuration file for the HylaFAX™ scheduler is automatically
read to get default settings for parameters such as the area code.
If a configuration file already exists for a modem, the
server-specific parameters will be carried over to the new configuration,
but the modem-specific parameters will not.
The area code may be set to a null string or omitted
in locations where one does not exist.
|This is the phone number associated with the modem. By default this number is passed as an identity to peer fax machines (see below) and it may also appear on tag lines created by the fax server.|
Phone numbers should be supplied with a complete international dialing specification: ``+<country code> <local part>'' (the <local part> includes an area code where such a notion exists.)
|The local identification string is passed to peer fax machines during communication. If it is not specified, or set to a null string, then the canonical phone number of the fax modem is used instead.|
Beware that the facsimile communication protocol restricts the local identification string to numbers, blank, and the ``+'' symbol. In practice however, most facsimile machines will accept any ASCII string.
The dial string rules file holds rules
used to convert user-supplied
dialing strings (i.e. phone numbers) to a canonical format and to
prepare strings for delivery to a modem. The default rules do very
little. Specific dialing rules may be useful for your site or locale
based on how your modems are connected to the PTT. Consult the
section in the Advanced Server
Configuration chapter for more information.
|These parameters control the logging done by server processes.|
It is important that tracing during send and receive sessions include sufficient information to diagnose problems. For Class 1 modems this parameter is usually set to 0x4f so that HDLC frames are included in the logs. For Class 2 and Class 2.0 modems the default setting of 11 is typically ok. Consult the descriptions of ServerTracing and SessionTracing in the hylafax-config(4F) manual page.
The default parameter selected here makes
all received facsimile accessible
only to the fax user. It may be desirable to set this parameter to
0644 so that anyone can look at received facsimile.
Note that if sensitive information such as credit card access codes
are supplied by users that they will appear in the session logs kept
on the server machine. For this reason the default protection mode
for session logs protects them from public access.
This parameter is used during inbound call handling. It
specifies the number of rings to wait before answering the phone.
See the section on inbound call handling for a discussion of
the different schemes that are supported for handling calls.
This parameter is also related to inbound call handling. It controls
whether or not to enable support for inbound data calls and should
not be set without first understanding how to setup your system
for incoming data usage.
The TSI access control list file can be used to restrict inbound
facsimile access. The default parameter causes all inbound calls
to be accepted. This parameter is discussed more below.
|Tag lines are an optional feature that cause each page of an outbound facsimile to be marked with a line of text. A proper description of the tag line support is provided in the Tagline Configuration section of the next chapter.|
Note that in the United States some form of identification of the sender of a facsimile is required by law; properly configured tag lines are an acceptable form of identification. Beware that the default tag line includes the phone number defined above; make sure this number is correct!
This parameter controls the time that a HylaFAX™ server process
will wait before removing a UUCP lock file whose owner appears
to be gone. The default parameter forces these stale lock files
to be left around for just 30 seconds.
This is an appropriate value to use on systems where applications
that use UUCP lock files are known to be well behaved.
|More parameters associated with inbound facsimile jobs; consult the section below.|
The syslog facility controls where HylaFAX™ directs server tracing-related messages. By setting this parameter to a non-standard value HylaFAX™ messages can easily be recorded in a file separate from the normal system messages. Consult the Troubleshooting chapter, for more information.
This parameter should only need to be set on Silicon Graphics
systems. Consult the section on
IRIX-specific guidance for
a description of why this parameter might be used.
|This completes the collection of server-related parameters; the remaining steps identify and configure the modem for use. If the displayed parameters are unacceptable, typing something other than yes or a carriage return will cause faxaddmodem to prompt for new/changed parameter settings.|
Setup modem-specific configuration parameters. faxaddmodem probes the modem to find out what type it is and what capabilities it has. The modem identity is then matched against a set of prototype configuration files to come up with modem-specific parameters that are appropriate to the modem and the style of flow control that is to be used between the host and modem. If the modem is not supported by an existing prototype configuration then faxaddmodem will prompt to get values for parameters.
Use the -s option to avoid probing.
|Modems that support multiple classes can be configured to use any supported class. By default Class 2.0 is considered better than Class 2 which is preferred over Class 1.|
|The flow control scheme requested is one of xonxoff for software flow control, rtscts for hardware flow control, or default for a setting that is appropriate for the modem and the tty device.|
Beware of using an improper flow control scheme for the selected tty device. On systems where faxaddmodem understands how tty device names reflect flow control characteristics, selecting a flow control scheme not supported by the device will cause faxaddmodem to prompt for confirmation and/or to change the device name or the flow control scheme.
|The modem-specific configuration parameters are obtained from prototype configuration files that reside in the config subdirectory of the HylaFAX™ spooling area. These parameters have been taken from working systems and should provide a functioning configuration based on the modem type and the selected flow control scheme.|
If no prototype configuration file exists for a modem then faxaddmodem will prompt for settings. There are generic prototype configuration files for Class 1, Class 2, and Class 2.0 modems. Because there are many configuration parameters for modems it may be preferrable to use a normal text editor instead of faxaddmodem when constructing a configuration file for an unsupported modem, To do this simply accept the default parameters and then edit the generated configuration file before starting up a server for the modem. Once a working configuration file is created it is simple to create a prototype file from it; consult the faxaddmodem(1M) or hylafax-config(4F) manual pages for information on doing this.
|At this point faxaddmodem compares the parameters setup for the modem against the parameters setup for the HylaFAX™ scheduler process. If any parameters are incompatible it prompts to see if they should be used to create a new file for the scheduler.|
Starting Outbound ServiceOutbound service is carried out by the HylaFAX™ scheduler process, the faxq(1M) program. There is one faxq process for all modems on a system. The faxq program learns about modems that can be used for outbound jobs by messages it receives on a FIFO special file located in the HylaFAX™ spooling area on the server machine. These messages come from two sources: from the faxmodem program that is used to manually enable a modem for use, or from faxgetty processes that are setup to run on each tty device where a fax modem resides.
Specifying modems with faxmodem is useful when HylaFAX™ is to be used in a send-only configuration. Doing this however limits the functionality of the scheduler because it will not know the true state of each modem; e.g. when a modem is in use by an outbound application such as uucp or tip. Instead faxq will assume that each modem is ready for use except when it is actively being used by HylaFAX™ to transmit a facsimile or alpha-numeric page.
A modem specified with faxmodem is identified by the tty device it is attached to. Thus, to notify the scheduler that two modems are available for use, the following might be used:
Modem capabilities are specified through faxmodem with the syntax used by Class 2 and Class 2.0 modems. This makes it easy to setup a Class 2/2.0 modem: all you need to do is make a simple query to the modem to get the capabilities string to pass to faxmodem. For example, for a Class 2.0 modem the following commands would be used:
For a Class 2 modem the commands are slightly different:
For a Class 1 modem an entirely different procedure is needed because the modem only implements a small portion of the facsimile protocol. This means that the capabilities are mostly dependent on the HylaFAX™ software and not on the modem. The only information needed from the modem is which signalling rates are supported for transmitting fax data; this is obtained with:
When faxq is used in conjunction with faxgetty no modems need to be specified using faxmodem. If modems are specified however; faxq will just treat the modems as ready for use until it receives more up to date information from the faxgetty processes.
Setting up Inbound ServiceTo setup HylaFAX™ for inbound facsimile or data service a modem configuration file must be setup and a faxgetty program must be started to listen for input on the tty device. The configuration file setup is usually done at the same time that outbound service is configured; i.e. when faxaddmodem is run. A faxgetty server for the modem should be setup to be run by the init(1M) process according to local system conventions. For System V-based systems this is done by editing the /etc/inittab file to spawn faxgetty on the appropriate port. For example, if a modem is to be started on /dev/ttyf2 the following line might be appropriate:
cua0 "/usr/local/sbin/faxgetty /dev/cua0" dialup on
In general it is desirable to run faxgetty because faxgetty informs the HylaFAX™ scheduler process whenever modems are in use and because it identifies modems' capabilities (passing them on to the scheduler so that it can make informed scheduling decisions). faxgetty also includes support for screening calls based on caller-ID information (consult the section ``Caller-ID Support'') and for automatically routing calls based on distinctive ring when these services are provided by the local PTT (consult the section ``Distinctive Ring Support'') . For this additional functionality, and because faxgetty does a reliable job of reseting and configuring recalcitrant modems, it may even be desirable to run faxgetty on non-fax modems.
The following sections discuss HylaFAX™ support for servicing particular types of inbound calls.
Facsimile ServiceIn normal operation HylaFAX™'s faxgetty process will automatically answer inbound phone calls and receive facsimile. Received facsimile are written to files in the recvq directory in the spooling area on the server machine. Facsimile data is stored as a TIFF Class F (TIFF/F) file and protected according to the RecvFileMode configuration parameter specified in the modem configuration file. The RecvDataFormat configuration parameter can be used to control the encoding of data stored in these files; consult the section on ``Transcoding of Received Facsimile'' for more information on this facility. The maximum number of pages that will be received in a single call can also be controlled with the MaxRecvPages configuration parameter. Finally, HylaFAX™ provides an access control list mechanism for restricting recived facsimile according to the TSI string passed as part of the facsimile protocol; consult the section on ``Rejecting Junk Facsimile'' for more information.
Data ServiceBy default HylaFAX™ does not enable support for inbound data calls. Data service is not enabled so that naive users do not accidentally setup inbound access to their system before proper password controls are in place. To enable inbound data service the modem configuration file must be setup to accept data calls and to invoke the normal system getty program to process the incoming call. Normally this involves enabling the use of adaptive-answer functionality and the setup of the GettyArgs parameter in the configuration file.
Adaptive answer is the ability for a modem to determine whether an incoming phone call is for data, fax, or voice use. If a modem supports a good adaptive-answering facility then it should be enabled with the ModemSetupAACmd and the faxgetty process will automatically service fax, data, or voice calls as identified by the modem. Most Class 2 and Class 2.0 modems provide adaptive-answer support that distinguishes data calls from fax calls and the prototype configuration files that come with HylaFAX™ automatically enable it if it is provided by the modem. Most Class 1 modems do not provide adaptive-answer support, but HylaFAX™ provides adaptive-answer support in the server. Consult the section on ``Adaptive Answer Support'' in the next chapter for help on configuring adaptive-answer support.
Setting up the GettyArgs parameter requires an understanding of how to automatically startup the system getty program. HylaFAX™ will invoke the getty program when a data call is recognized and set up the standard input, output, and error descriptors to point to the appropriate tty device. The getty program should not reopen or reinitialize the modem before doing its work. Some getty programs are incapable of this and are unsuitable for use with HylaFAX™. The parameters passed to the getty program must also identify the speed to use to communicate with the local modem. Some getty programs want to automatically detect this rate based on the CONNECT message that a modem sends to the host when a connection is established; these programs are unsuitable for use with HylaFAX™. A getty program used with HylaFAX™ must be able to handle a fixed speed for host-modem communication, with the speed specified on the command line.
For System V-style getty programs the appropriate parameters are typically of the form:
For BSD-style systems, GettyArgs is usually of the form:
hfaxd is normally started up when the faxsetup program is run. faxsetup also arranges for hfaxd to be automatically started up each time a server machine is booted; either standalone by a script invoked by the init process or indirectly by the inetd process. The preferred way to run hfaxd is in a standalone mode as this gives optimal performance.
When hfaxd is started the command line arguments specify which of several client-server protocols it should offer. hfaxd currently has support for three protocols:
It is also possible to have the inetd program startup hfaxd. In this case only a single protocol can be requested since inetd advertises service and establishes the network connection. For example, the following entry might be used in the inetd.conf file to startup hfaxd to service SNPP requests:
It is possible to run hfaxd in a standalone mode as well as indirectly from inetd so long as this is done for separate protocols. Doing this however is of questionable value since it is much more efficient for a single standalone hfaxd process to support multiple protocols than to have multiple unrelated hfaxd processes.
|Beware that hfaxd must either be started up by the super-user or be installed setuid-root for proper operation.|
Besides arranging for hfaxd to get started up when a server machine is booted, it is necessary to specify which client machines and users can have access to a HylaFAX™ server machine. This is specified by the contents of the etc/hosts file in the HylaFAX™ spooling area on the server machine. The contents of this file is specified in the hosts(4F) manual page. The default etc/hosts file that comes with HylaFAX™ permits anyone to have access through the localhost network interface; i.e. the hosts file contains:
|The etc/hosts file must be owned by the fax user and be mode 0600 or hfaxd will not permit client access.|
Setting up Periodic Maintenance WorkHylaFAX™ comes with two programs that need to be run periodically on the server machine: faxqclean(1M) and faxcron(1M).
The faxqclean program is responsible for removing old document and job description files from the spooling area on a server. These files are created when outbound jobs are created but are removed in a delayed fashion to permit clients to resubmit jobs without retransmitting all the information to the server and to allow imaged documents to be reused in unrelated facsimile transmissions. faxqclean is also responsible for archiving outbound jobs that have completed.
|The faxqclean program in version 4.0 does not support job archiving; but consult the manual page to verify this (in case someone has done some local improvements).|
faxqclean must be run by the super-user. A sample entry for the cron program that runs faxqclean once each hour might be:
Modem Configuration IssuesBeware that when faxgetty processes control a modem they may leave the modem in a state suitable for sending and receiving facsimile. That is, they may leave the modem running in Class 1, Class 2, or Class 2.0. This may have implications for data communication programs such as tip, cu, and uucp. For example, it may be necessary to force the modem into Class 0 (for data communication) when placing a call:
|Note that when HylaFAX™ places an outbound facsimile call it automatically forces the modem into Class 1, 2, or 2.0 before issuing ModemDialCmd. Thus the old FlexFAX trick of changing the class in the ModemDialCmd parameter should not be used.|
System-specific GuidanceThis section contains some setup-related issues that are dependent on the operating system installed on the target machine. The information included here is by no means exhaustive; it reflects feedback from users accumulated over multiple HylaFAX™ versions and/or operating system releases.
The tty device that is used must reflect whether hardware or software flow control is to be used. Under IRIX, modem devices (i.e. those that monitor DCD) come in two flavors: ttyf* devices support RTS/CTS flow control while ttym* devices support XON/XOFF flow control. If you want to use hardware flow control to communicate with your modem you should use a ttyf* device, otherwise use a ttym* device. If you fail to use the correct device you may still get the correct flow control (because later versions of IRIX actually permit flow control to be switched irrespective of the device used), but you are likely to collide with other modem users such as cu, uucp, ppp, and slip that still use the old-style device names (so UUCP lock files may be created for a different name than the one HylaFAX™ is using).
|USR modems work under IRIX 5.x only when patch 475 or a successor is installed and ClocalAsRoot is set to Yes in the modem configuration file.|
Versions of IRIX prior to 6.2 have a bug in the device driver for the on-board serial ports on several systems that causes RTS/CTS flow control to be turned off as a side effect of setting the CLOCAL flag on the associated tty device. Patch 475 (``RTS/CTS flow control busted when CLOCAL is set'') and its successors correct this problem and must be installed to use HylaFAX™ with RTS/CTS flow control (install the appropriate successor to patch 475). Also, when this patch is installed the ClocalAsRoot modem configuration parameter must be set to Yes for proper operation (see hylafax-config(4F) for a detailed explanation of what this parameter does). If you do not have the appropriate patch installed on your system then you will either see flow control-related problems when transmitting facsimile or possibly some other problems related to modems dropping DCD when carrier is lost.
|The DPS-based PostScript imager program distributed with HylaFAX™ is available only in COFF format. Because IRIX 6.2 does not support COFF executables this program cannot be used with HylaFAX™. A Ghostscript-based RIP should be used under IRIX 6.2.|
The font metric files required by client applications are contained in the dps_eoe.sw.dpsfonts image that is part of the standard IRIX distribution.
Some versions of Solaris (2.3 is known to do this) silently truncate or discard syslog messages longer than about 120 characters.
Use the /dev/cua/* devices and not the /dev/term/* devices.
When using ttymon to service inbound data calls set the GettyArgs parameter to something like the following:
GettyArgs: "-g -h -d /dev/cua/a -l 38400 -m ldterm,ttcompat"
|Be certain you are not running a ttymon with sac when using HylaFAX™. Disable all ports that are to be used by HylaFAX™ with admintool or pmadm(1m).|
GettyArgs: "-g -h -t 60 -l ff_%s"
MACHDEPLIBS = -lm -lmallocto
MACHDEPLIBS = -lm -lmalloc -libertyLibiberty is available with the gcc compiler.
LC++OPTS = -fpermissive
|Advanced server configuration.||HylaFAX™ table of contents.|