Wuhai’s Weblog

July 9, 2009

For ps output, why do long usernames get printed as numbers

Filed under: Linux — wuhai @ 5:16 am

I hit this issue recently, and it turns out to be in FAQ from procps:

Reference: http://procps.sourceforge.net/faq.html

The UNIX and POSIX standards require that user names and group names be printed as decimal integers when there is not enough room in the column. Truncating the names, besides being a violation of the standard, would lead to confusion between names like MichelleRichards and MichelleRichardson. The UNIX and POSIX way to change column width is to rename the column:

ps -o pid,user=CumbersomeUserNames -o comm

The easy way is to directly specify the desired width:

ps -o pid,user:19,comm

July 3, 2009

IBM Datastage – clear up project lock

Filed under: Uncategorized — wuhai @ 6:37 pm

As user ‘dsadmd’:

-bash-3.00$ $DSHOME/bin/uvsh
This directory is not set up for DataStage.
Would you like to set it up (Y/N)?Y
0. Ideal compatibility
1. IN2 compatibility
2. Prime Information compatibility
3. PICK compatibility
4. PI/open compatibility
5. Microdata Reality compatibility

Which way do you wish to configure your VOC ? 0
Your VOC is configured for Ideal compatibility
Creating file “VOC” as Type 3, Modulo 23, Separation 4.
Creating file “D_VOC” as Type 3, Modulo 2, Separation 1.
Loading your “VOC” file. (Each “*” = 10 records.)
***************************************************************************
Loading your “D_VOC” file. (Each “*” = 10 records.)
*
Creating file “&SAVEDLISTS&” as Type 1.
Creating file “D_&SAVEDLISTS&” as Type 3, Modulo 1, Separation 2.
Added “@ID”, the default record for Retrieve, to “D_&SAVEDLISTS&”.
Creating file “VOCLIB” as Type 2, Modulo 7, Separation 4.
Creating file “D_VOCLIB” as Type 3, Modulo 1, Separation 2.
Added “@ID”, the default record for Retrieve, to “D_VOCLIB”.
DataStage Command Language 8.1 Licensed Materials – Property of IBM
(c) Copyright IBM Corp. 1997, 2007 All Rights Reserved.
dsadmd logged on: Friday, July 03, 2009 10:14

> LIST.READU EVERY

> UNLOCK USER userno ALL
> UNLOCK INODE 28625085 ALL
> LIST.READU EVERY
> LO

The unlock command is not available by default in the projects. To create an entry to use unlock execute the following two commands:
>SET.FILE UV VOC UV.VOC
>COPY FROM UV.VOC TO VOC UNLOCK

June 24, 2009

IBM RaidManager clear controller logs

Filed under: Uncategorized — wuhai @ 5:51 am

# /usr/RaidMan/arcconf GETLOGS 1 DEVICE tabular
Controllers found: 1

ControllerLog
controllerID ………………… 0
type ……………………….. 0
time ……………………….. 1245822160
version …………………….. 1

driveErrorEntry
adapterID …………………… 0
channelID …………………… 0
deviceID ……………………. 1
numParityErrors ……………… 0
linkFailures ………………… 0
hwErrors ……………………. 0
slotNum …………………….. 1
enclIndex …………………… 0
abortedCmds …………………. 4
mediumErrors ………………… 2

Command completed successfully.

/usr/RaidMan/RaidMan.sh

Right click the controller, and select “Clear controller event log”

# /usr/RaidMan/arcconf GETLOGS 1 DEVICE tabularControllers found: 1

ControllerLog
controllerID ………………… 0
type ……………………….. 0
time ……………………….. 1245822424
version …………………….. 1

Command completed successfully.

June 20, 2009

Centos, Veritas vxfs, largefiles flag

Filed under: Veritas — wuhai @ 7:55 pm

[root@vxvmtest01p ~]# df -kh | grep -A 1 wuhai
/dev/vx/dsk/ch3dg/wuhaivol2
1.1G 100M 961M 10% /root/wuhaivol2
[root@vxvmtest01p ~]#

[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /root/wuhaivol2
largefiles

[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs -o nolargefiles /root/wuhaivol2

[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /root/wuhaivol2
nolargefiles

Note: It seems mkfs.vxfs does not work as expected, no matter whether the file system has largefiles or nolargefiles flag, it always displays largefiles as shown below.

[root@vxvmtest01p ~]# /sbin/mkfs.vxfs -t vxfs -m /dev/vx/dsk/ch3dg/wuhaivol2
mkfs -t vxfs -o bsize=1024,version=7,inosize=256,logsize=1024,largefiles /dev/vx/dsk/ch3dg/wuhaivol2 2301952

For unmounted file system:

[root@vxvmtest01p ~]# umount /root/wuhaivol2
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /root/wuhaivol2
UX:vxfs fsadm: ERROR: V-3-20279: /root/wuhaivol2 is not the root inode of a vxfs file system
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs -o nolargefiles /dev/vx/dsk/ch3dg/wuhaivol2
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /dev/vx/dsk/ch3dg/wuhaivol2
nolargefiles
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs -o largefiles /dev/vx/dsk/ch3dg/wuhaivol2
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /dev/vx/dsk/ch3dg/wuhaivol2
largefiles
[root@vxvmtest01p ~]# mount /root/wuhaivol2
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /dev/vx/dsk/ch3dg/wuhaivol2
largefiles
[root@vxvmtest01p ~]# /opt/VRTS/bin/fsadm -t vxfs /root/wuhaivol2
largefiles
[root@vxvmtest01p ~]#

June 18, 2009

Ubuntu 9.04 desktop – suddenly lost sound

Filed under: Linux — wuhai @ 10:37 am

No idea why it lost sound, spent hours on this, but it turns out to be an easy fix, after seeing

reference: http://idyllictux.wordpress.com/2009/04/21/ubuntu-904-jaunty-keeping-the-beast-pulseaudio-at-bay/

Just use alsamixer, make sure “Headphon” is not “MM” (it was before) by typing ‘m’.

June 16, 2009

Rackable Server Raid1 configuration – Megacli

Filed under: Server — wuhai @ 8:22 pm

By default, it comes with 2 logical drives. To create RAID1, use the following:

Control+Y
-CfgLdDel -L0 -a0
-CfgLdDel -L1 -a0
-CfgLdAdd -r1 ‘[252:0,252:1]‘ -a0
-LdGetProp -Cache -L0 -a0
(Adapter 0-VD 0 (target id: 0): Cache Policy: WriteThrough, ReadAheadNone, Direct, No WriteCache if bad BBU
-LDInit -Start -L0 -a0
-LDBI -ShowProg -L0 -a0

June 11, 2009

/proc/sys/vm/drop_caches

Filed under: Linux — wuhai @ 2:04 pm

BCU DB2 has the following errors:

“There are no pages currently available in bufferpool “4098″ .. when user trying to test run some datastage job:

STAGE_SUB_SEG.0: Fatal Error: Fatal: [IBM][CLI Driver][DB2/LINUXX8664] SQL1218N There are no pages currently available in bufferpool “4098″. SQL STATE=57011

DSTAGE-DB2CLI-0027 .. ‘SQLExecDirect: Error executing statement ‘SELECT DISTINCT ..’

# ipcs -a

—— Shared Memory Segments ——–
key shmid owner perms bytes nattch status
0×00000000 1451720704 db2inst1 767 40169352 1 dest
0×00000000 1452507140 db2inst1 701 131072 1 dest
0×00000000 1453785099 db2inst1 701 131072 1 dest

—— Semaphore Arrays ——–
key semid owner perms nsems
0×0000d431 65536 root 777 1
0×620e2284 32769 root 644 1
0×4d028e78 262146 root 600 8

—— Message Queues ——–
key msqid owner perms used-bytes messages
0×000037a8 0 root 666 0 0
0×73a679fb 1327038465 db2inst1 610 0 0
0×034d3a1c 1327071234 db2inst1 610 0 0
0×02b867d3 1324580875 db2inst1 610 0 0
0×444912ca 1324613651 db2inst1 610 0 0

> free -mo
total used free shared buffers cached
Mem: 29226 21933 7293 0 1008 19776
Swap: 32773 0 32773

> cat /proc/sys/vm/drop_caches
0

# echo 3 > /proc/sys/vm/drop_caches

# free -mo
total used free shared buffers cached
Mem: 29226 299 28927 0 0 64
Swap: 32773 0 32773

After the above change, file system cache dropped from 19776 to 64. And the job runs fine.

Then change the value back:

# echo 0 > /proc/sys/vm/drop_caches

June 6, 2009

ssh connection hang: PTY allocation request failed on channel 0

Filed under: Linux — wuhai @ 2:51 am

Tonight I was upgrading some drivers for 42 nodes cluster, and after rebooting servers, one node got the following ssh connection error message:

PTY allocation request failed on channel 0

It turns out I mistakenly comment out the wrong line in /etc/fstab file:
devpts /dev/pts devpts gid=5,mode=620 0 0

Just uncomment it and do “mount /dev/pts” will bring the system back ..

May 25, 2009

Solaris 10 ldapclient and Centos5 openldap-2.3.27-5

Filed under: LDAP, Solaris — wuhai @ 10:27 pm

ldapclient -v manual -a credentialLevel=anonymous -a defaultsearchbase=’dc=y,dc=com’ -a defaultServerList=ldapvip,ldap1,ldap2 -a serviceSearchDescriptor=passwd:ou=users,dc=y,dc=com?sub -a serviceSearchDescriptor=group:ou=Group,dc=y,dc=com -a serviceSearchDescriptor=netgroup:ou=Netgroups,dc=y,dc=com?sub -a serviceAuthenticationMethod=pam_ldap:simple

Copy pam.conf file over

scp /usr/lib/security/*mkhome*:

# ls -l /usr/lib/security/*mkhome*
lrwxrwxrwx 1 root root 36 Apr 23 2008 /usr/lib/security/pam_mkhomedir.so -> /usr/lib/security/pam_mkhomedir.so.1
-rwxr-xr-x 1 root root 12844 Apr 28 2008 /usr/lib/security/pam_mkhomedir.so.1

It seems pam_mkhomedir was compiled from: http://www.keutel.de/pam_mkhomedir/

cat /etc/pam.conf:

#
# Authentication management
#
# login service (explicit because of pam_dial_auth) #
login auth requisite pam_authtok_get.so.1
login auth required pam_dhkeys.so.1
login auth required pam_unix_cred.so.1
login auth required pam_dial_auth.so.1
login auth binding pam_unix_auth.so.1 server_policy
login auth required pam_ldap.so.1
#
# rlogin service (explicit because of pam_rhost_auth) #
rlogin auth sufficient pam_rhosts_auth.so.1
rlogin auth requisite pam_authtok_get.so.1
rlogin auth required pam_dhkeys.so.1
rlogin auth required pam_unix_cred.so.1
rlogin auth binding pam_unix_auth.so.1 server_policy
rlogin auth required pam_ldap.so.1
#
# rsh service (explicit because of pam_rhost_auth, # and pam_unix_auth for meaningful pam_setcred) #
rsh auth sufficient pam_rhosts_auth.so.1
rsh auth required pam_unix_cred.so.1
rsh auth binding pam_unix_auth.so.1 server_policy
rsh auth required pam_ldap.so.1
#
# PPP service (explicit because of pam_dial_auth) #
ppp auth requisite pam_authtok_get.so.1
ppp auth required pam_dhkeys.so.1
ppp auth required pam_dial_auth.so.1
ppp auth binding pam_unix_auth.so.1 server_policy
ppp auth required pam_ldap.so.1
#
# Default definitions for Authentication management # Used when service name is not explicitly mentioned for authentication #
other auth requisite pam_authtok_get.so.1
other auth required pam_dhkeys.so.1
other auth required pam_unix_cred.so.1
other auth binding pam_unix_auth.so.1 server_policy
other auth required pam_ldap.so.1
#
# passwd command (explicit because of a different authentication module) #
passwd auth binding pam_passwd_auth.so.1 server_policy
passwd auth required pam_ldap.so.1
#
# cron service (explicit because of non-usage of pam_roles.so.1) #
cron account required pam_unix_account.so.1
#
# Default definition for Account management # Used when service name is not explicitly mentioned for account management #
other account requisite pam_roles.so.1
#other account binding pam_unix_account.so.1 server_policy
other account sufficient pam_unix_account.so.1
other account required pam_ldap.so.1
#
# Default definition for Session management # Used when service name is not explicitly mentioned for session management #
other session required pam_unix_session.so.1
other session optional pam_mkhomedir.so.1 skel=/etc/skel/ umask=0022

#
# Default definition for Password management # Used when service name is not explicitly mentioned for password management #
other password required pam_dhkeys.so.1
other password requisite pam_authtok_get.so.1
other password requisite pam_authtok_check.so.1
other password required pam_authtok_store.so.1 server_policy
#
# Support for Kerberos V5 authentication and example configurations can # be found in the pam_krb5(5) man page under the “EXAMPLES” section.
#

ppp auth required pam_unix_cred.so.1
ppp auth required pam_unix_auth.so.1
krlogin auth required pam_unix_cred.so.1
krlogin auth required pam_krb5.so.1
krsh auth required pam_unix_cred.so.1
krsh auth required pam_krb5.so.1
ktelnet auth required pam_unix_cred.so.1
ktelnet auth required pam_krb5.so.1

VMware shared disk for guest cluster

Filed under: vmware — wuhai @ 7:56 am

refer: http://www.vmware.com/pdf/vi3_35/esx_3/vi3_35_25_u1_mscs.pdf

First use VI GUI to create shared disk, with scsi1:0, pick “Physical” since in my case both VCS guest nodes run on top of different ESX hosts. VI GUI can’t be used for the following:

vmkfstools -w /vmfs/volumes/vol_name/servername/servername_2.vmdk

Next Page »

Blog at WordPress.com.