Sunday, August 19, 2012

HP-UX cmmodnet: Network interface lan3 has already been in this state



Issue:-

Even though lan3 is running perfectly fine MCSG thinks it as down and fail over to standby lan. We will not be able to  fail back  to lan3 (primary lan)


# cmmodnet -e lan3

cmmodnet: Network interface lan2 has already been in this state.



cmviewcl output for this host.



# cmviewcl -v -n unixmemoirs-01



  NODE                STATUS       STATE

  unixmemoirs-01        up           running



    Network_Parameters:

    INTERFACE    STATUS                     PATH                NAME

    PRIMARY      down (Link and IP)         0/0/0/4/0/0/0       lan3

    PRIMARY      up                         0/0/0/3/0/0/0       lan2

    PRIMARY      up                         0/0/0/3/0/0/1       lan1



Syslog output.


Aug 19 17:06:22 unixmemoirs-01 syslog: cmmodnet -e lan3

Aug 19 17:06:22 unixmemoirs-01 cmnetd[21252]: Request to enable interface lan3

Aug 19 17:06:22 unixmemoirs-01 cmnetd[21252]: Attempt to enable network interface lan3 when it is already enabled.

 

Trouble shooting done :-

Verified interface status in lanadmin

Administration Status (value)   = up(1)
Operation Status (value)        = up(1)

Verified ifconfig status

# ifconfig la3
lan2: flags=2000000000001843<UP,BROADCAST,RUNNING,MULTICAST,CKO,TSO>



verified  link connectivity from  another interface in the same server

# linkloop -i 6 0x64315001e1d8

Link connectivity to LAN station: 0x64315000e1d8

-- OK

Verified link connectivity to another server

# linkloop -i3 0x68B599923388

Link connectivity to LAN station: 0x68B599924988

-- OK

#


Everything is fine. So what will be the issue. After long trouble shooting found out the issue. Outbound packet count not increasing.


Outbound Unicast Packets        = 250741234


Since the outbound packet count is not increasing cmcld thinks as link layer is down and marks lan3 as down and failover to standby lan.

Solution:

Reset lan3.

#lanadmin -r 3






 

Wednesday, August 15, 2012

HP-UX Printer prints multiple copies and prints coming out too slow



Newer printer scripts are having True End-of-Job  and Job Recovery  options as below

  Options:                          Current Settings:
  --------                          -----------------
  1) Default Queue                      [NO]
  2) Status Log                         [OFF]
  3) Network Address                    [PRINTER01]
  4) Additional printer changes . . .

  Modelscript used for this queue is net_ljM603

Select an item for change, or '0' to make the changes effective (q - quit): 4

        Modifiable Printer Parameters
        -----------------------------
        Settings may be changed by selecting the corresponding numbers.  You
        can make as many changes as you want until 'q' is selected.


    Options:                          Current Settings:
    --------                          -----------------
   1) Job Recovery                         [ON]
   2) True End-of-Job                      [ON]
   3) Banner Page                          [OFF]
   4) Default Printing Language            [AUTO]
   5) PostScript Level                     [Level 3]
   6) Banner Tray                          [2]
   7) Banner Paper Size                    [default]
   8) Duplex print                         [default]





If these options are turned on like above we will get multiple copies while printing and print jobs will get delayed. So we need to turn them off like below


  1) Job Recovery                         [OFF]
  2) True End-of-Job                      [OFF]

True-end-of-job means that the handshaking with the printer will not terminate until the last page of the job hits the output tray.  This is why printing get delayed

Job Recovery is a way to restart a job when it gets interrupted (network interrupts etc).  This is why you are getting multiple copies.

Tuesday, August 14, 2012

Dot space Dot Slash and sudo

              Today have a request to provide  sudo permission to an application script and another script which loads its environment variables 

But  I am not able to execute the script even though I have given permission in sudoers.

The steps to execute the script.

1) .  /opt/custom/etc/setup_env.sh (here is a space between dot and slash) or cd  /opt/custom/etc/  then . ./setup_env.sh (there is a space between dot and dot )
      
2) .  /opt/custom/bin/start_server serv1

The issues

    Setting environment variables  will not work as expected. lets see what happens when we execute it.


 why there is a space required between dot and slash or dot and dot.

    if we execute the  /opt/custom/etc/setup_env.sh directly it will set the environment variables for the script itself  (sub shell its running ) and exists. There will not be any variables set for the shell where we are executing the script.

But if we execute the  script  like this ".  /opt/custom/etc/setup_env.sh" it will set the environment variable for this current shell also.  That's why there is a space required.

2. If we execute  "sudo .  /opt/custom/etc/setup_env.sh"  sudo will complain command not found. Its because "." (dot) means current directory and there it search for the command and obviously it will not find it.

How to overcome this.

1. Append the application  environment variable paths in root's profile. Provide permission to required commands in sudoers

OR

2. Create a script like this if there are only some commands need to be executed. Then add  the  script in sudoers for that particular user.

cat /opt/custom/bin/start.sh
#!/usr/bin/sh
echo "Please give the name of the instance to start: \c"
read INSTANCE
. /opt/custom/etc/setup_env.sh  #dot space :)
/opt/custom/bin/start_server $INSTANCE

OR

3. Update to latest sudo , which will have the option sudo -E , so that it will preserve the environment of executing user ( provided the executing user have application environment set in  his path )

The -E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the -E option is specified and the user does not have permission to preserve the environment