Technical article 116652

UNIX, Adding a large number of printers at the same time may generate a warning from the lpsched print scheduler.

OpenServer 5UnixWare 7Open UNIX 8

Written · Last revised

Problem

Adding a large number of printers (40 or more) at the same time may generate the following warning from lpsched:

UX:lpadmin: WARNING: The LP print service can't take another printer.

The printer configuration has been saved on disk nonetheless. To fix this problem, stop the LP print service (/usr/lib/lpshut) and restart it (/usr/lib/lpsched) to have it recognize the new printer.

If the printer is being added within a looping script and enabled and accepted at the same time then these subsequent commands will fail with:

UX:enable: ERROR: Destination "lptest267" is unknown to the LP print service.

UX:accept: ERROR: Destination "lptest267" is unknown to the LP print service.

An example script to add a large number of printers:

i=0
while [ $i -lt 300 ]
o
touch /tmp/lptest$i
/usr/lib/lpadmin -p lptest$i -v /tmp/lptest$i
enable lptest$i
accept lptest$i
i=`expr $i + 1`
done

Cause

The lpsched daemon has internally run out of memory used to add new
printers.  The actual number of printers added before reaching this
state depends on how long the scheduler has been running and what
work it has been doing.

The lpadmin command will still succeed in adding the printer configuration files but it is unknown to the scheduler until lpsched it stopped and restarted.

Therefore, further commands such as "enable" and "accept" run on the newly added printer will fail until the scheduler is restarted.

Solution

Stop and restart the print scheduler after adding the printers:

/usr/lib/lpshut
/usr/lib/lpsched
as the error message indicates.

If this is scripted within a loop then split the additional printer commands out into a separate loop to run after the printers have been added and after the print scheduler has been restarted, for example:

# Add the printer in the first loop
i=0
while [ $i -lt 300 ]
do
touch /tmp/lptest$i
/usr/lib/lpadmin -p lptest$i -v /tmp/lptest$i
i=`expr $i + 1`
done
# Stop and restart the scheduler so that all printers are seen
/usr/lib/lpshut
/usr/lib/lpsched
# enable and accept the printer in the second loop
i=0
while [ $i -lt 300 ]
do
enable lptest$i
accept lptest$i
i=`expr $i + 1`
done
NOTES:    There may also be other limitations within the system which prevent
          creation of a large number of printers, for example the maximum
          number of subdirectories on UnixWare (one for each printer under
          /etc/lp/printers).  This is controlled by the MAXLINK kernel
          parameter, which defaults to 1000 and can be tuned up to 32767.

From the Xinuos technical article database, record 116652. Reproduced with permission. The original is at www.sco.com/ta/116652, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.