Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
System Administration
Showing results for 
Search instead for 
Did you mean: 

Issues with printer - lpsched: Insufficient memory to execute printer interface program.


Issues with printer - lpsched: Insufficient memory to execute printer interface program.


After migrating from an hp/UX B.11.11 U 9000/800 2371708204 unlimited-user license  to an  HP-UX B.11.31 U ia64 2687803869 unlimited-user license, we have trouble with the printers .


In the /var/spool/lp/log, we have this error :

/opt/hpnpl/bin/hpnpf -j IPRECUU192-1216+dnproadb -a1 -x IPRECUU192
hpnpf (read bytes from socket): Connection reset by peer
lpsched: Insufficient memory to execute printer interface program.

The issue is on multiple printers, random and whe it happens, the file stay blocked during few minutes and then multiple copies of the initial file are printed. It is as the server was trying to print it again and again , fail and then succeed so he prints all the copies ...


We suspect that it come from our way to create the printer or the model_script using for the printing.

In the HPUX 1.1.11 server, our method was to create a local printer with these commands

lpadmin –pIMPARxxx –mreseau_pcl –v/dev/null ; accept IMPARxxx; enable IMPARxxx

 The script reseau_pcl is a custom file

In the HPUX, 1131, the method is to create a network printer (it is still the same printer of course) with this commande

setnetlp -jd -p IMPARxxx-orm IMPARxxx-om reseau_pcl

The script reseau_pcl is the default file and not a custom file like in the old server .

I don't really know why we don't use a local printer in the new server but the fact is that when I try to create a local printer with the old method in the new server, the printer seems to be fine but I can't print anything with the command :

lp -d IMPARxxx file

When we try to print with hpnpf command we don't have any issues .

So I am trying to find an explanation to these errors and may be the good way to create a printer in the new server because I don't realy understand why with the local printer, it doesn't work ...


Thanks a lot for your help !





Bill Hassell
Honored Contributor

Re: Issues with printer - lpsched: Insufficient memory to execute printer interface program.

Some terminology and history:

LOCAL PRINTER: directly connected with a short Centronics cable, an HP-IB cable or RS-232 cable. Virtually obsolete today.

REMOTE PRINTER: an archaic protocol from the AT&T SysV days that uses port 515 over ethernet cable. No printer status or query capability. Susceptable to protocol lockups but implemented on virtually every printer with a network cable. This is the setup you mentioned above using lpadmin. Not recommended for any printer that supports port 9100 printing (also known as HP JetDirect protocol).

NETWORK PRINTER: The HP protocol defined about 1991 ( and added to new midrange printers as well as HP JetDirect adapters (LAN to USB or Centronics type interfaces). This is the recommended way to connect all printers. 

I do not recommend using any non-HP utilities (such as setnetlp) or 3rd party print spool managers, due to compatibility and support, and ease of use. You do need the HPNP fileset on all your HP-UX systems (standard for many years). Check with this command:

# swlist | grep -i jetdirect
  J4189-11001C  E.10.34  Hewlett-Packard JetDirect Printer Installer for Unix

Unfortunately, due to the recent splits (HP and HPE), support (and downloads) for HP-UX have disappeared. But you should have it on 11.31 and probably 11.23 and 11.11.

If you use SAM to add printers, it will call the HPNP menu program (hppi) to add printers with port 9100.

However, it is far, far simpler (and more reliable) to add printers using addqueue.
First, adding, modifying or deleting any type of printer requires the lp spooler to be stopped (lpshut). When lpshut is run, all active jobs are stopped in midstream with no recovery. When the spooler is restarted (lpsched), each interrupted job starts from the beginning.

I recommend that you inventory your printers with lpstat -v.
This will show you something like this:

device for dalsharp: /dev/null
device for lj2: /dev/null
    remote to: LJ-2 on

The dalsharp printer is port 9100 (jetdirect for short) while the lj2 printer uses the archaic port 515 protocol. For port 515 printers, determine whether they have port 9100 capability by consulting with the manufacturer. If not available, I recommend purchasing a JetDirect Print Server (LAN to USB) so it can be added with HPNP software. For really old printers, you'll need to look at eBay for a LAN-to-Centronics print server.

I recommend deleting all port 515 printers and use port 9100 print protocol, making sure that each printer supports port 9100 printing.

 The command to add a printer is:

/opt/hpnpl/bin/adqueue -q prn123 -h -i 257 -r off -t off -b off


-q specifies a name to use in HP-UX for this printer it can be the hostname but keep it short -- 8 chars or less, always lowercase.

-h is the IP address. I don't recommend hostnames simply because these are often defined by another group. The IP address always works.

-i specifies the model script to use. This is a number from 1 to 9999 and can be seen with the command:

/opt/hpnpl/bin/addqueue -l
Printer Id      Printer Model                   Model script
 1)             HP LaserJet IIISi               net_lj4x
 1)             HP PaintJet XL300               net_lj4x
 2)             HP Color LaserJet               net_lj4x
 3)             HP LaserJet 4                   net_lj4x
 9997)          Generic PCL3 Printer            net_genericpcl3printer
 9998)          Generic printer                 net_genericprinter
 9999)          Generic plotter                 net_genericplotter

All of these printers have out of production for many, many years. So for any printer, use -i 257 which specifies the net_ljx000 model script. If you have a custom script in the model directory, use -i 257, and then copy your custom script on top of the printer's script in model.orig.

NOTE: All printers less than $500 are probably unusable in HP-UX because they require a MAC or Windows raster converter and cannot print plain ASCII. Any printer that supports the HP protocol PCL (versions 1,2,3,4) or plain ASCII is OK but starting with PCL 5e, plain ASCII is no longer possible without the use of a special raster conversion driver, typically found only in Windows or Mac (or some Linux) systems.

Note that all the JetDirect utilities work quite well including hpnpf which has a trace capability. These utilities are:


all found in /opt/hpnpl/bin.
Look at the man pages for these tools.

Bill Hassell, sysadmin