Skip to content

Printer configuration

ThinStation edited this page Nov 18, 2019 · 5 revisions

This page describes how to add printers:

  • option A: custom package (network printer)
  • option B: config on boot (network printer, usb printer and lpt)

Prerequisites (option A and B)


  • required build.conf packages
  • package lprng
  • package hpijs
  • package cups
  • package ghostscript
  • FileDevice Yes in cupsd.conf (only option B, by default in thinstation included)

Configuration option A (custom package)


  1. Create a custom package. The only files needed are etc/init.d/your_start_up_script and the corresponding systemd service file.

  2. Change the name of your_start_up_script to something appropriate (printers?).

  3. Add the following line to the init) case:

     lpadmin -p "<printer_name>" -v socket://<printer_ip> -m <printer_driver> -L "<printer_location>" -E
    

<printer_name>

  • What do you want to call your printer?

<printer_ip>

  • The IP address your printer resides at. If you include package terminal in build.conf, you can see what devices are available on the client by running the following in the terminal: lpinfo -v

<printer_driver>

  • The print driver to install with the printer. If you include package terminal in build.conf, you can view available drivers for your printer on the client by running the following in the terminal: lpinfo --make-and-model '<printer_make_and_model>' -m, where <printer_make_and_model> is something like "LaserJet 4240". This will print a list of drivers like the following:

      $ lpinfo --make-and-model "LaserJet 4240" -m
      gutenprint.5.2://hp-lj_4240/expert HP LaserJet 4240 - CUPS+Gutenprint v5.2.9
      foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/HP-LaserJet_4240-Postscript.ppd HP LaserJet 4240 Foomatic/Postscript
      drv:///hpcups.drv/hp-laserjet_4240-pcl3.ppd HP LaserJet 4240 pcl3, hpcups 3.13.9
      postscript-hp:0/ppd/hplip/HP/hp-laserjet_4240-ps.ppd HP LaserJet 4240 Postscript (recommended)
      postscript-hp:1/ppd/hplip/HP/hp-laserjet_4240-ps.ppd HP LaserJet 4240 Postscript (recommended)
    

    The driver is the portion of the line before the first space. E.g. gutenprint.5.2://hp-lj_4240/expert or postscript-hp:0/ppd/hplip/HP/hp-laserjet_4240-ps.ppd.

<printer_location>

  • Where is the printer located?

####Notes

  • If you include package terminal in build.conf, you can test the lpadmin command prior to adding it to your config file by running the command in the terminal on the thinstation client.
  • This is not the only way to add a network printer. Another possible method includes (on the thinstation client) adding a printer using the CUPS GUI (http://localhost:631) and creating a package from /etc/cups. This method does not require boot-time conf files.

Configuration option B (config on boot)


  1. Only define in thinstation.conf.buildtime or any config group:
Example network printer
  • CUPS_PRINTER_0_NAME="sample_network_printer_0"
  • CUPS_PRINTER_0_DEVICEURI="socket://ip_address"
  • CUPS_PRINTER_0_DRIVER="drv:///sample.drv/generpcl.ppd"
Example usb printer
  • CUPS_PRINTER_1_NAME="sample_usb_printer_1"
  • CUPS_PRINTER_1_DEVICEURI="file:///dev/usb/lp0"
  • CUPS_PRINTER_1_DRIVER="drv:///sample.drv/generpcl.ppd"
Example lpt printer
  • CUPS_PRINTER_2_NAME="sample_lpt_printer_2"
  • CUPS_PRINTER_2_DEVICEURI="file:///dev/lp0"
  • CUPS_PRINTER_2_DRIVER="drv:///sample.drv/generpcl.ppd"

Driver used "drv:///sample.drv/generpcl.ppd" is a generic pcl driver useful for laser printers, it can be modified with any other driver.