hpoj reference: ptal-init

The ptal-init script may be called by your system's startup and shutdown sequences to automatically start and stop the hpoj daemons (ptal-mlcd, ptal-printd, and ptal-photod).

It also serves as a convenient tool for managing (adding and removing) devices of all connection types (parallel, USB, or JetDirect) which should be controlled by the hpoj daemons.

Click here for more information on setting up basic device connectivity with the hpoj package.

Syntax

The ptal-init command-line syntax is as follows:
	ptal-init command [-q[uiet]|-v[erbose]]
Where:

Notes

ptal-init contains a special comment line telling the RedHat chkconfig to start ptal-init in runlevels 2, 3, 4, and 5, and stop it in other runlevels, with a start order of 59 and a kill order of 61. This assumes that lpd's start and kill orders are both 60, because ptal-printd needs to be started before lpd. When installing hpoj on other distributions that lack chkconfig and/or start/stop lpd in a different order, then you may need to manually integrate ptal-init into your system's startup and shutdown sequences.

"ptal-init setup" has a list of known possible wildcard patterns to match parallel and USB printer device nodes on various platforms. If necessary you may update this list by editing the definition of @parWildcards and/or @usbWildcards near the top of the ptal-init script.

ptal-init is derived from ptal-init.in by the ./configure script, after substituting in the $prefix (installation base path) variable.

ptal-init erases and re-creates the socket/pipe directories needed by ptal-mlcd and ptal-printd. Previous hpoj versions expected these directories in /dev, but they are now located in /var/run, because some platforms have a read-only /dev file system. For backwards compatibility it attempts to create a symlink from /dev/ptal-printd to /var/run/ptal-printd so you don't necessarily need to re-create print queues when upgrading from an earlier hpoj version.

If either the directory /var/lock/subsys or /var/lock exists, ptal-init creates and deletes the file ptal-init in that directory. This is needed for the SysV init system in RedHat and possibly other distributions.

Notes on the setup command

"ptal-init setup" walks you through the following steps, prompting you for confirmation or other information when necessary: For Linux, "ptal-init setup" attempts to run the commands "/sbin/modprobe lp" and "/sbin/modprobe printer" when asked to probe for parallel- and USB-connected devices, respectively. ptal-init does not do this otherwise when just starting the daemons. Consequently, you may find that devices are found by "ptal-init setup" but not after a reboot, if these kernel modules don't otherwise get loaded, for example, from a "hotplug" script.

When probing a device, "ptal-init setup" performs the following actions:

In most cases, ptal-mlcd now properly handles situations where you have more than one instance of the same model connected locally, with the following caveats:

Device configuration file format

hpoj device configuration files, which ptal-init manages, are stored in the directory /usr/local/etc/ptal. For each configured device, there is a file in this directory whose name is the PTAL device name, such as mlc:par:OfficeJet_Series_700, mlc:usb:PSC_750, or hpjd:my-jdex.my-domain.com:3. libptal applications such as ptal-devid or libsane-hpoj use the presence and names of these files to determine the list of configured devices. ptal-init uses the contents of each file to determine what daemons, if any, it should start for the corresponding device and what command-line parameters to pass.

The following rules govern the format of device configuration files:

In addition, the default device name (if set) is stored in the file /usr/local/etc/ptal/default-device.

The ptal-start.conf and ptal-stop.conf files used in hpoj-0.8 are now obsolete.