Linux (CUPS) Spooler Troubleshooting

Step 1:Check Error logs

Command:    tail -f /var/log/cups/error_log 

I [08/Mar/2017:16:58:03 +0300] [Job ???] Request file type is text/plain.
 I [08/Mar/2017:16:58:03 +0300] [Job 7] Adding start banner page "none".
 I [08/Mar/2017:16:58:03 +0300] [Job 7] Adding end banner page "none".
 I [08/Mar/2017:16:58:03 +0300] [Job 7] File of type text/plain queued by "emdadm".
 I [08/Mar/2017:16:58:03 +0300] [Job 7] Queued on     
 "TEST_LABEL_PRINTER" by "emdadm".

Linux (CUPS) Spooler Commands

Step 2:To view the status of all print queues:

Command:    lpc status

Example:

serddad1:~ # lpc status
 TEST_LABEL_PRINTER:
 printer is on device 'socket' speed -1
 queuing is enabled
 printing is enabled
 1 entries
 daemon present

PROD_LABEL_PRINTER:
 printer is on device 'socket' speed -1
 queuing is enabled
 printing is enabled
 1 entries
 daemon present

Step 3:To check the status of a single print queue and view a list of pending jobs:

Command:  lpc status printer_name,  lpstat -P printer_Name,

lpstat -pprinter_name

Example:

serddad1:~ # lpc status TEST_LABEL_PRINTER
 TEST_LABEL_PRINTER:
 printer is on device 'socket' speed -1
 queuing is enabled
 printing is enabled
 1 entries
 daemon present
 serddad1:~ # lpstat -P TEST_LABEL_PRINTER
 TEST_LABEL_PRINTER-1 root 17408 Tue Feb 28 14:38:09 2017
 serddad1:~ # lpstat -pTEST_LABEL_PRINTER
 printer TEST_LABEL_PRINTER is idle. enabled since Thu Mar 9 14:30:20 2017

Step 4:To remove a single print job:

Command:  cancel printer_name-id(check output of lpstat -P TEST_LABEL_PRINTER)  ,

Example:

serddad1:~ # cancel TEST_LABEL_PRINTER-1

Step 5:To remove all print jobs in a queue:

Command: cancel -a  printer_name

Example:

serddad1:~ # cancel -a TEST_LABEL_PRINTER

Step 6:To enable  a queue:

Command:cupsenable  printer_name

Example:

serddad1:~ # cupsenable TEST_LABEL_PRINTER

Step 7:To disable  a queue:

Command:cupsdisable  printer_name

Example:

serddad1:~ # cupsdisable TEST_LABEL_PRINTER

Step 8:To enable all queues:

Command:

lpstat -p | grep disabled | awk '{print $2}' | xargs cupsenable

Example:

serddad1:~ #lpstat -p | grep disabled | awk '{print $2}' | xargs cupsenable

Step 9:To print a test job:

Command:

echo test_page | lpr -P printer_name

Example:

serddad1:~ #echo test_page | lpr -P  TEST_LABEL_PRINTER

Step 10:To restart/refresh the cups service:

Command:

service cups restart

How to extend a LVM swap volume?

In this case, increase by 20G:

 

Summary of commands;

cat /etc/fstab | grep swap

swapoff /dev/system/swap

lvextend -L +20G /dev/system/swap

mkswap /dev/system/swap

swapon /dev/system/swap

free -g

 

Details of above commands are below;

sdevhana01:~ # free -g

total       used       free     shared    buffers     cached

Mem:          1009         10        999          0          0          0

-/+ buffers/cache:          9        999

Swap:           31          0         31

sdevhana01:~ # cat /etc/fstab | grep swap

/dev/system/swap     swap                 swap       defaults              0 0

sdevhana01:~ # swapoff /dev/system/swap

sdevhana01:~ # free -g

total       used       free     shared    buffers     cached

Mem:          1009         10        999          0          0          0

-/+ buffers/cache:          9        999

Swap:            0          0          0

sdevhana01:~ # vgs

VG     #PV #LV #SN Attr   VSize   VFree

  system   1   2   0 wz–n- 269.83g 35.83g

sdevhana01:~ # lvextend -L +20G /dev/system/swap

Extending logical volume swap to 52.00 GiB

Logical volume swap successfully resized

sdevhana01:~ # mkswap /dev/system/swap

mkswap: /dev/system/swap: warning: don’t erase bootbits sectors

on whole disk. Use -f to force.

Setting up swapspace version 1, size = 54525948 KiB

no label, UUID=14a35aeb-6e1a-4848-a7ca-eb315e905d31

sdevhana01:~ # swapon /dev/system/swap

sdevhana01:~ # free -g

total       used       free     shared    buffers     cached

Mem:          1009         10        999          0          0          0

-/+ buffers/cache:          9        999

Swap:           51          0         51

sdevhana01:~ #

Usage vi editor in HP-UX

Important cursor Movement keys

keys Effect
l Move one character right
h Move one character left
j Move one line down
k Move one line up
Move one character right
G Go to last line of the file
nG Go to line number n in the file
$ Go to end of current line
^ Go to start of line
w Go to beginning of next word
b Go to beginning of previous word
e Move to end of word
H Go to first line of screen
M Go to middle line of screen
L Go to last line of screen
( Go to beginning of sentence
) Go to end of sentence
{ Go to beginning of paragraph
} Go to end of paragraph

Text Deletion Commands

Command Effect
x Delete character at current cursor location.
nx Delete n characters starting at current cursor location.
X Delete previous character from the current cursor location.
nX Delete n previous characters from the current cursor location.
dd Delete current line.
db Delete previous word.
dw Delete from current cursor location to the end of word.
dG Delete to the end of file including current line.

HP-UX networking related tools and commands

FILES
  • /etc/hosts – Hosts configuration file (resolve hosts and IPs)
  • /etc/rc.config.d/netconf – IP address, routeing address and hostname stored in this file
SCRIPTS
  • /etc/init.d/net start – Use to start, stop network service     OR
  • /sbin/init.d/net 
HPUX Commands
  1. (a) Display lan interface info
    1.       lanscan
  2. All in one lan configuration utility (lan0 is first Ethernet interface) to configure and view the system IP address:
    1.  ifconfig lan0 – Display IP info such as IP address netmask etc.
    2.  ifconfig lan0 up – Up network interface (allow traffic)
    3.  ifconfig lan0 down – Down network interactive (deny traffc)
    4.  ifconfig lan0 192.168.1.1 netmask 255.255.255.0 up – Setup/change IP adddress
  3. Displaying host name
    1.      hostname
  4. Arp administration (cache)
    1.   arp -a  
  5. Display routing table/info:
    1. netstat -nr
  6.   Define new route:
    1. route add default 192.168.1.254 1
  7. HP’s LAN diagnostic tool
    1. lanadmin
  8. Test a remote host connectivity
    1. ping host.mycorp.com
  9. Setup various lan properties, dns client, NIS client configuration etc using GUI tool:
    1. sam
    2. set_parms
  10.  Check dns connectivity
    1. nslookup http://www.google.com