15.4 Accessing Serial Devices and USB Printers

15.4.1 Device Links
15.4.2 Device Nodes
15.4.3 Device Node Ownership
15.4.4 Hotdesking and Device Node Ownership
15.4.5 Setting Up Serial Devices
15.4.6 Setting Up USB Printers

This section provides information about how to manage serial devices and USB printers connected to a client.

15.4.1 Device Links

Device links are created under the dev directory. A link to each serial node is created in dev/term, and a link to each locally attached printer is created in dev/printers.

Typical device links are:

/tmp/SUNWut/units/IEEE802.080020cf428a/dev/term/manufacturer_name-67a
/tmp/SUNWut/units/IEEE802.080020cf428a/dev/printers/1608b-64

The device link for the first example is manufacturer_name-serial_numberindex, where index is an increasing alphabetical character, starting at a. If the manufacturer name is not available, the vendor and product ID numbers are used for the name of the device link.

Here is an example of the dev directory from a Sun Ray 3 Client, which has an onboard serial port.

# cd $UTDEVROOT/dev
# pwd
/tmp/SUNWut/units/IEEE802.002128587259/dev
# ls     
term 
# cd $UTDEVROOT/dev/term
# pwd
/tmp/SUNWut/units/IEEE802.002128587259/dev/term
# ls -l
lrwxrwxrwx   1 root     root          22 Jul 28 17:23 a -> ../../devices/serial:a       

15.4.2 Device Nodes

Note

USB-to-serial adapters are not accessible through the generated device nodes in an Oracle Solaris or Oracle Linux session. You must use USB redirection in a Windows session to access a serial device connected through a USB-to-serial adapter.

In the devices directory, device nodes are created for each serial or printer port on an attached USB device. The device nodes are created in the hub directory corresponding to the hub to which they are attached. The nodes are named as follows:

manufacturer_name,model_name@upstream_hub_port

If the USB device has multiple identical ports (for example, two serial ports), the name is followed by :n where n is a numerical index, starting at 1.

The following example is a typical device node:

/tmp/SUNWut/units/IEEE802.MACID/devices/usb@1/hub@1/manufacturer_name,model_name@3:1

Here are the definitions of the naming conventions.

Term

Definition

physical-topology

The physical-topology is hub@port/hub@port and so on. The port refers to the port on the parent hub into which the device or child hub is plugged.

printer-name-1, terminal-name-1

The printer and terminal name in the Sun Ray devices directory is manufacturer,model@port with a colon separating the numerical index when the string just described is not unique in the directory.

printer-name-2, terminal-name-2

The printer and terminal name in the Sun Ray dev directory is the manufacturer and serial number concatenated with an alphabetic index when the serial number is not unique.

15.4.3 Device Node Ownership

Some device nodes are owned by the user whose session is active on the client, while others might be owned by root or by other users that had previously active sessions on the client. Device permissions, access controls and ownership rules are determined by the class of device. For serial devices, only the user whose session is active on the client or the superuser have permission to use the attached device. If no user has an active session, superuser owns the serial device nodes. This rule might not be applicable for other classes of USB devices connected to the client.

15.4.4 Hotdesking and Device Node Ownership

The following description of the behavior of USB devices when sessions are connected and disconnected from a client applies only to serial devices. Other device classes may have different semantics regarding ownership and device lease times.

Changing the active session on a client changes the ownership of the device nodes to the user associated with the new session. A session change occurs whenever a user inserts or removes a smart card from a client or logs into a session.

In a failover environment, you can use the utselect or utswitch command to change a session. A session change causes all devices currently open by a non-root user to be closed after 15 seconds. Any input to or output from any affected device results in an error. For a serial device node, if the original session is restored within 15 seconds, the ownership is not relinquished, and input and output continue uninterrupted.

Devices currently opened by the superuser, including normal printing, remain unaffected by a session change.

15.4.5 Setting Up Serial Devices

To use serial attached devices with a client, you must attach them to the internal serial ports or through a USB-to-serial adaptor. You must use USB redirection in a Windows session to access a serial device connected through a USB-to-serial adapter.

Symbolic links to the serial port device nodes are located under $UTDEVROOT/dev/term. Built-in ports are named "a" or "b".

Serial ports become unowned during hotdesking, so you should make sure any serial port activity is stopped before removing your smart card or resetting the client.

Note

All serial ports except port A on the Sun Ray 170 support full handshaking and standard UNIX semantics. Port A on the Sun Ray 170 has no hardware handshaking pins, so it can't be used when a hardware handshake is required.

15.4.6 Setting Up USB Printers

This section provides instructions on how to setup PostScript and non-attached PostScript printers that are attached to the Sun Ray Client. For details on how to print from Windows while using the Windows connector, see Chapter 17, Windows Connector.

15.4.6.1 How to Set Up an Attached PostScript Printer (Oracle Solaris)

Sun Ray Software works with PostScript printers connected directly to a USB port on the Sun Ray Client. For non-PostScript printer support, refer to Section 15.4.6.3, “How to Set Up an Attached Non-PostScript Printer”.

Note

The printer naming conventions in Sun Ray Software differ from those in an Oracle Solaris operating environment.

Note

The lp subsystem opens the device node as superuser for each print request, so print jobs are not affected by hotdesking.

Starting a print queue on a printer attached to a Sun Ray Client, either directly or through an adapter, is the same process as starting a print queue in Oracle Solaris.

  1. On the Sun Ray Client where the printer is attached, log in to a new session as superuser (root).

  2. To determine the MAC address of the Sun Ray Client, press Stop-N or Ctrl-Pause-N.

    The alphanumeric string displayed below the connection icon is the MAC address.

  3. To locate the Sun Ray Client, type:

    # cd /tmp/SUNWut/units/*MAC_address
    # pwd
    /tmp/SUNWut/units/IEEE802.MACID
    

    The path to the extended MAC address for your particular Sun Ray Client is displayed.

  4. Locate the port for the printer by typing:

    # cd dev/printers
    # pwd
    /tmp/SUNWut/units/IEEE802.MACID/dev/printers
    # ls
    printer-node-name
    
  5. In the directory, locate the printer node.

  6. Add the new printer.

    1. Start the Oracle Solaris Print Manager.

      # /usr/sbin/printmgr &
      
    2. Click OK to choose files for repository.

    3. Go to Printer > New Attached Printer.

    4. Type the following information:

      • Printer name: printername

      • Description (optional)

      • Printer port

      • Printer make

      • Printer model

        Choose Other to type the printer port path name. To locate the printer port, refer to Step 4.

  7. Verify that the printer has been set up correctly.

    # lpstat -d printername
    

15.4.6.2 How to Set Up an Attached PostScript Printer (Oracle Linux)

Sun Ray Software works with PostScript printers connected directly to a USB port on the Sun Ray Client. For non-PostScript printer support, refer to Section 15.4.6.3, “How to Set Up an Attached Non-PostScript Printer”.

Note

The lp subsystem opens the device node as superuser for each print request, so print jobs are not affected by hotdesking.

The following generic instructions might vary slightly from one operating system implementation to another, but they should provide enough information to enable an administrator to set up basic printing services.

  1. On the Sun Ray Client where the printer is attached, log in to a new session as superuser (root).

  2. To determine the MAC address of the Sun Ray Client, press Stop-N or Ctrl-Pause-N.

    The alphanumeric string displayed below the connection icon is the MAC address.

  3. Locate the Sun Ray Client.

    # cd /tmp/SUNWut/units/*MAC_address
    # pwd
    /tmp/SUNWut/units/IEEE802.MACID
    

    The path to the extended MAC address for your particular Sun Ray Client is displayed.

  4. Locate the port for the printer.

    # cd dev/printers
    # pwd
    /tmp/SUNWut/units/IEEE802.MACID/dev/printers
    # ls
    printer-node-name
    
  5. In the directory, locate the printer node.

  6. Use the Oracle Linux administration tools to set up the printer.

    Choose Other so that you can provide the device node from Step 4.

  7. Verify that the printer has been set up correctly.

    # lpstat -d printername
    
  8. Create a soft link to the Sun Ray printer node in /dev/usb

    For example, if the device node is

    /tmp/SUNWut/units/IEEE802.mac-address/dev/printers/device_node,

    you would use the following command:

    # ln -s /tmp/SUNWut/units/IEEE802.mac-address/dev/printers/device_node /dev/usb/sunray-printer
    

    Use this soft link (/dev/usb/sunray-printer) as the Device URI while creating the print queue.

  9. Update /etc/cups/cupsd.conf to set the RunAsUser property to No.

  10. Restart the cups daemon.

    # /etc/init.d/cups restart
    

15.4.6.3 How to Set Up an Attached Non-PostScript Printer

Printers that do not use PostScript, such as engineering plotters, are best supported by third-party software. Low-cost inkjet printers require third-party software such as the following:

Check with the vendors for pricing and the precise printer models supported.