Configuring printer services (add , remove,modify ) A - Z solaris 10

# svcs -a | grep ’print’    ==> to check the status of the print service

# svcadm enable svc:/application/print/server:default    ==> to enable print
                                service

# svcadm disable svc:/application/print/server:default    ==> to disable print
                                service

# svcs -a | grep ’print/server’

# /usr/sbin/printmgr &        ==> to configure local or network printer
                    with Solaris OS Print Manager



Setting the System’s Default Printer
# lpadmin -d printername    ==> to set a system’s default destination
                    printer

# lpstat -d    ==> to verify if the system’s default destination printer
            has been set

# lp <filename>        ==> to send a print request



Removing a Client’s Printer Configuration
# lpadmin -x printername    ==> to delete a printer from the system



Starting and Stopping the LP Print Service

The LP print service is started by the lpsched daemon and is shut down by the lpshut command.


# svcadm enable application/print/server    ==> to start lpsched daemon

# svcadm disable print/server    ==> to stop the print server service

# svcs -a | grep print



To submit a print job to the default printer or to another printer
Using lp

$ /usr/bin/lp filename

$ /usr/bin/lp -d printername filename


Using lpr

$ /usr/ucb/lpr filename

$ /usr/ucb/lpr -P printername filename



To submit a print request that uses the POSIX style

$ /usr/bin/lp -d hostname:printername filename    ==> hostname - print server
                            name

$ /usr/ucb/lpr -P hostname:printername filename



LP Print Service Administration Commands
 accept   Permits print requests to be queued for the specific printers

 reject      Prevents print requests from being queued for the specific printers

 enable      Activates the specified printers

 disable  Deactivates the specified printers

 lpmove   Moves print requests from one printer destination to another



Accepting Print Jobs
# /usr/sbin/accept destination(s)

# accept printername    ==> to permit print requests to be queued on the
                specified printer



Rejecting Print Jobs
To prevent print requests from queuing & stop users from submitting requests to the printer queues

# /usr/sbin/reject -r “reason" destination(s)

# reject -r "Replacing Toner Cartridge" printername


Enabling Printers


To activate printers, which enables printing of requests submitted to the print queues

# /usr/bin/enable destination(s)

# enable printername



Disabling Printers


To deactivate specified printers, which disables them from printing print requests waiting in the print queues

# /usr/bin/disable -c | -W -r “reason” destination

# disable -W -r “Printer down for maintenance” printername


$ lpstat -a    ==> to view the printer status by a user
$ lpstat -t    ==> to view the printer status by a user



Moving Print Jobs
To move one or all print requests from one printer destination to another printer destination.

# /usr/sbin/lpmove source_destination target_destination


Example:

1. Become the root user on the print server.

2. Use the reject command to prevent any further print requests from
   being sent to the print queue. This step notifies users that the printer
   is not accepting requests.

# reject -r “PrinterC is down for repairs” printerC

destination “printerC” will no longer accept requests


3. Use the lpstat command to display the print queue to see how
   many print requests are to be moved. This step is needed to identify
   print request identification numbers (IDs) only if selected print
   requests are going to be moved to another printer.

# lpstat -o

printerC-29 sys41!user1 61426 Jan 07 12:30
printerC-30 sys41!user1  9560 Jan 07 12:30
printerC-31 sys42!user2   845 Jan 07 12:30
printerC-32 sys42!user2   845 Jan 07 12:30
printerC-33 sys42!user2   845 Jan 07 12:30


4. Use the lpstat command to verify that the destination printer is
   accepting print requests.

# lpstat -a printerA

printer printerA accepting requests since Tue Jan 1


5. Move the print requests.

a. For example, to move all print requests from printerC over to printerA

# lpmove printerC printerA

move in progress ...
total of 5 requests moved from printerC to printerA

b. For example, to move one or more individual print requests
   from printerC to printerA

# lpmove printerC-32 printerC-33 printerA

total of 2 requests moved to printerA


6. If all print requests were moved from printerC, in step 5a,
   printerC has a reject automatically applied to it. When
   printerC is available again, use the accept command to allow print
   jobs to queue to printerC.

# accept printerC

destination “printerC” now accepting requests



Removing a Server’s Printer Configuration

1. Log in as the root user on the print server on which the printer is
   configured.

2. Stop queuing print requests on the printer.

# reject printername

3. Stop the printer.

# disable printername

4. Delete the printer from the print server.

# lpadmin -x printername

This action deletes configuration information for the printer from the print server’s /etc/lp/printers directory and /etc/printers.conf file.



            CONFIGURING A PRINTER
The host name and IP address of the print server must exist in the local systems /etc/inet/hosts file.


1. Log in as the root user and open two terminal windows. In one of the windows, use the tty command to identify the pseudo-terminal device it uses. Use this device name as the port for the new printer.

# tty


2. In the other terminal window, run the Solaris OS print manager.

# /usr/sbin/printmgr &


3. In the Select Naming Service panel, verify that files is selected, and click OK. From the print manager menu, select the Show Command Line Console option. Position the Command Line Console in a convenient location.


4. From the Printer menu, select the New Attached Printer option.

5. Fill in the fields according to the Table. To name your printer, use a name different from that of your system.


Field               Selection or Entry

Printer name        Your choice.
Description         Your choice.
Printer Port        Select the Other option. Enter the device name of
                    the terminal window found in Step 1.
Printer Make        Lexmark.
Printer Model       Lexmark Optra E310.
Printer Driver      Foomatic/Postscript (recommended).
Fault Notification   Write to superuser.
Default Printer     Select the box.
Always Print Banner Do not select the box.
User Access List    No change.


6. Click OK when you are finished. Notice the command-line entries that appear on the console window.


7. Test your printer configuration by printing the /etc/inet/hosts file to the default printer. Observe the output on the other terminal window.

# lp /etc/inet/hosts

You should see the contents of the /etc/inet/hosts file converted to the format a Lexmark Optra E310 would expect, scroll through the other window.


8.  From the Printer menu, select the Add Access to Printer option.


9.  Fill in the fields according to the Table.

Field           Selection or Entry

Printer name    Enter the name of a printer on another system.
Printer server  Enter the name of the system on which the
                preceding printer is defined. Ensure this system
                name and IP address are in your /etc/inet/hosts
                file.
Description     Your choice.
Default printer Do not select the box.


10. Click OK when you are finished.

Notice the command-line entries that appear in the console window.


11. Test your new configuration by printing the /etc/inet/hosts file to
    the remote printer. Observe the output on the other system.

# lp -d printername2 /etc/inet/hosts

You should see the contents of the /etc/inet/hosts file converted to the format a Lexmark Optra E310 would expect, scrolling through the other window.


12. In an available terminal window, use the lpstat command to
    display the current status information of the printers on your system.

# lpstat -t


13. Disable print output for your default printer.

# disable printername1


14. Send the following four files to your default printer:
    /etc/inet/hosts, /etc/inittab, /etc/dfs/dfstab, and
    /etc/skel/local.profile.

# lp /etc/inet/hosts
# lp /etc/inittab
# lp /etc/dfs/dfstab
# lp /etc/skel/local.profile


15. Check the print queue to find the request ID for each job.

# lpstat -o

The four print jobs should be listed with sequential numbers.


16. Use the request IDs to cancel two of the requests. Verify the result.
    Use the following syntax to cancel the requests:

# cancel printername1-# printername1-#

# lpstat -o

Two of the print jobs should be gone.


17. Cancel the other two jobs by indicating the user who sent them.
    Verify the result. For example:

# cancel -u root
# lpstat -o


18. Enable printing for your default printer.

# enable printername1


19. Set your default printer to reject requests, and display a reason for
    doing so. For example:

# reject -r “Printer is down for maintenance” printername1


20. Attempt to send a job to the default printer. Observe the messages
    displayed.

# lp /etc/inet/hosts

Your message should say printername1: Requests are not being accepted.


21. Use the lpstat command to display the reason that the printer is
    not accepting requests. Use the following syntax:

# lpstat -a printername1

Your message should say printername1: your reason from step 20.


22. Set your default printer to again accept requests.

# accept printername1


23. Test your printer configuration by printing the /etc/inet/hosts
    file to the default printer. Observe the output on the other terminal
    window.

# lp /etc/inet/hosts


24. Before removing the printers, prevent any further print requests
    from being queued:

# reject -r "removing printer" printername1
destination “printername1” will no longer accept requests

# reject -r "removing printer" printername2
destination “printername2” will no longer accept requests


25. Remove both printers.

# lpadmin -x printername1
# lpadmin -x printername2