Tag: linux

RHEL 5 booting stuck – GRUB Loading stage2… Press any key to continue

I have a HPE Proliant DL380 G7 that is running Red Hat Enterprise Linux 5 that was stuck on the following message

GRUB Loading stage2…
Press any key to continue

Removed the section shown in red on file /boot/grub/grub.conf

root@rhel5:/boot/grub # cat grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/rootvg/rootlv
# initrd /initrd-version.img
#boot=/dev/cciss/c0d0
default=0
timeout=5
#splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu

serial –unit=0 –speed=115200
terminal –timeout=10 console serial

title Red Hat Enterprise Linux Server (2.6.18-406.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-406.el5 ro root=/dev/rootvg/rootlv rhgb noquiet crashkernel=128@16M log_buf_len=3M elevator=noop nmi_watchdog=0
initrd /initrd-2.6.18-406.el5.img
title Red Hat Enterprise Linux Server (2.6.18-308.16.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-308.16.1.el5 ro root=/dev/rootvg/rootlv rhgb noquiet crashkernel=128@16M log_buf_len=3M elevator=noop nmi_watchdog=0
initrd /initrd-2.6.18-308.16.1.el5.img
title Red Hat Enterprise Linux Server (2.6.18-308.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-308.el5 ro root=/dev/rootvg/rootlv rhgb noquiet crashkernel=128M@16M log_buf_len=3M elevator=noop nmi_watchdog=0
initrd /initrd-2.6.18-308.el5.img

Deleted file in Linux but didn’t reclaim space in filesystem

The reason that the space in the filesystem wasn’t reclaimed is because the file was opened and in use by another application

root@linux:~ # lsof /bkpcvrd | grep deleted
dsmc 21215 root 11r REG 253,9 4268860136 1097761 /bkpcvrd/pbh020/export/pbh020_20111001.dmp.gz (deleted)
dsmc 30379 root 8r REG 253,9 4268860136 1097761 /bkpcvrd/pbh020/export/pbh020_20111001.dmp.gz (deleted)
dsmc 32691 root 9r REG 253,9 4268860136 1097761 /bkpcvrd/pbh020/export/pbh020_20111001.dmp.gz (deleted)

Check the directory where the file descriptors for the PID is

root@linux:/proc/21215/fd # ls -l
total 12
l-wx—— 1 root root 64 2011-10-04 10:09 0 -> /dev/null
l-wx—— 1 root root 64 2011-10-04 10:09 1 -> /root/nohup.out
lrwx—— 1 root root 64 2011-10-04 10:09 10 -> socket:/[32923523]
lr-x—— 1 root root 64 2011-10-04 10:09 11 -> /bkpcvrd/pbh020/export/pbh020_20111001.dmp.gz (deleted)
l-wx—— 1 root root 64 2011-10-04 10:09 2 -> /dev/null
l-wx—— 1 root root 64 2011-10-04 10:09 3 -> /opt/tivoli/tsm/client/ba/bin/dsmerror.log
l-wx—— 1 root root 64 2011-10-04 10:09 4 -> /opt/tivoli/tsm/client/ba/bin/dsmsched.log
lrwx—— 1 root root 64 2011-10-04 10:09 5 -> socket:/[31319408]
lrwx—— 1 root root 64 2011-10-04 10:09 6 -> socket:/[31319409]
lrwx—— 1 root root 64 2011-10-04 10:09 7 -> socket:/[33998182]
lrwx—— 1 root root 64 2011-10-04 10:09 8 -> socket:/[33083683]
lr-x—— 1 root root 64 2011-10-04 10:09 9 -> /usr/oradata/orapbh020/tbd1/LENEL_DATA.D001

You previously saw that the there is a link and in the end it says deleted. Type > in the number that was shown in that line

root@linux:/proc/21215/fd # > 11

List the other file descriptors

root@linux:/proc/30379/fd # ls -l
total 11
lrwx—— 1 root root 64 2011-10-04 10:09 0 -> /dev/console
l-wx—— 1 root root 64 2011-10-04 10:09 1 -> /dev/null
lrwx—— 1 root root 64 2011-10-04 10:09 10 -> socket:/[33912163]
lr-x—— 1 root root 64 2011-10-04 10:09 11 -> /usr/oradata/orapbh020/tbd1/LENEL_DATA.D001
l-wx—— 1 root root 64 2011-10-04 10:09 2 -> /dev/null
l-wx—— 1 root root 64 2011-10-04 10:09 3 -> /opt/tivoli/tsm/client/ba/bin/dsmerror.log
l-wx—— 1 root root 64 2011-10-04 10:09 4 -> /opt/tivoli/tsm/client/ba/bin/dsmsched.log
lrwx—— 1 root root 64 2011-10-04 10:09 5 -> socket:/[21055400]
lrwx—— 1 root root 64 2011-10-04 10:09 6 -> socket:/[31339242]
lrwx—— 1 root root 64 2011-10-04 10:09 7 -> socket:/[33078656]
lrwx—— 1 root root 64 2011-10-04 10:09 9 -> socket:/[32744402]

root@linux:/proc/32691/fd # ls -l
total 11
l-wx—— 1 root root 64 2011-10-04 10:09 0 -> /dev/null
l-wx—— 1 root root 64 2011-10-04 10:09 1 -> /opt/tivoli/tsm/client/ba/bin/nohup.out
lr-x—— 1 root root 64 2011-10-04 10:09 10 -> /bkpcvrd/pbh020/export/pbh020_20111002.dmp.gz
l-wx—— 1 root root 64 2011-10-04 10:09 2 -> /dev/null
l-wx—— 1 root root 64 2011-10-04 10:09 3 -> /opt/tivoli/tsm/client/ba/bin/dsmerror.log
l-wx—— 1 root root 64 2011-10-04 10:09 4 -> /opt/tivoli/tsm/client/ba/bin/dsmsched.log
lrwx—— 1 root root 64 2011-10-04 10:09 5 -> socket:/[33364746]
lrwx—— 1 root root 64 2011-10-04 10:09 6 -> socket:/[33364747]
lrwx—— 1 root root 64 2011-10-04 10:09 7 -> socket:/[33365181]
lrwx—— 1 root root 64 2011-10-04 10:09 8 -> socket:/[33365142]
lr-x—— 1 root root 64 2011-10-04 10:09 9 -> /bkpcvrd/pbh020/export/pbh020_20111003.dmp.gz

The space is now reclaimed

root@linux:~ # df -h /bkpcvrd
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-bkpcvrdlv
17G 8.2G 7.3G 53% /bkpcvrd

Listing the open files in the filesystem to see if there is still an open file with the deleted status

root@linux:~ # lsof /bkpcvrd | grep deleted
root@linux:~ #

Which package contains rstatd for Red Hat Enterprise Linux 5.5

The service rstatd is in package rusers-server

https://access.redhat.com/kb/docs/DOC-51169

After installing the package, set the service to start at boot

root@linux:~ # chkconfig rstatd on
root@linux:~ # chkconfig —list | grep rstat
rstatd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
root@linux:~ # chkconfig rusersd on
root@linux:~ # chkconfig —list | grep rusers
rusersd 0:off 1:off 2:on 3:on 4:on 5:on 6:off

Start the services

root@linux:~ # service rstatd start
Starting rstat services: [ OK ]
root@linux:~ # service rusersd start
Starting rusers services: [ OK ]

Check the status

root@linux:~ # service rstatd status
rpc.rstatd (pid 2269) is running…
root@linux:~ # service rusersd status
rpc.rusersd (pid 8147 6266 3464) is running…

Linux – Password has been used already. Choose another

root@linux:~ # passwd emerson
Changing password for emerson.
New Password:
Reenter New Password:
Password has been used already. Choose another.
Password changed

Linux is keeping the old password stored on /etc/security/opasswd. Delete the line containing the user that you’re trying to change the password

You can also check the file /etc/pam.d/common-password and look for a line with the parameter remember.

password required pam_pwhistory.so use_authtok remember=6 retry=3

Linux denying user access after reseting password

Depending of how you configured your Linux server, the Pluggable Authentication Module (PAM) won’t let you login.

To check the login attempts to see if it needs to be reset type faillog -u <username>

root@linux:~ # faillog -u username
Username Failures Maximum Latest
<username>       15        0

Reset the counter with the -r flag

root@linux:~ # /usr/bin/faillog -r username
Username Failures Maximum Latest
<username>        0        0

If you’re root but is not managing to become a user with su, you also need to reset the login counter

root@linuxserver ~ # su – username
su: incorrect password

root@linux:~ # /sbin/pam_tally —-user username —-reset
User <username> (685) had 36

root@linux:~ # su – username
username@linux:~ $

For RHEL 6, it uses pam_tally2

root@rhel64:~ # /sbin/pam_tally2 —-user username —-reset
Login Failures Latest failure From
username 9 02/13/14 09:22:10 /dev/pts/1

root@rhel64:~ # /sbin/pam_tally2 —-user username —-reset
Login Failures Latest failure From
username 0

Resizing an ext3 filesystem mounted on a logical volume in a Linux

My home directory got full

root@linux:~ # df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-homevol
101M 96M 94K 100% /home

Checking if the logical volume permits online resizing and if it was created with an older e2fsprogs version. Volumes created prior to SUSE Linux 10 SP2 are using an older e2fsprogs version and needs to be recreated

root@linux:~ # dumpe2fs -h /dev/mapper/rootvg-homevol | grep features
dumpe2fs 1.35 (28-Feb-2004)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file

We checked that the volume has the resize_inode property so to extend the filesystem, first we extend the logical volume

root@linux:~ # lvextend -L 200M /dev/rootvg/homevol
Extending logical volume homevol to 200.00 MB
Logical volume homevol successfully resized

You can see that the filesystem is not yet showing the new size

root@linux:~ # df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-homevol
101M 96M 95K 100% /home

Now we increase the filesystem with resize2fs

root@linux:~ # resize2fs /dev/rootvg/homevol
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/rootvg/homevol is mounted on /home; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/rootvg/homevol to 204800 (1k) blocks.
The filesystem on /dev/rootvg/homevol is now 204800 blocks long.

Checking the new size

root@linux:~ # df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-homevol
194M 94M 90M 52% /home

If you receive a message saying that you can’t resize a mounted filesystem, use ext2online

root@suselinux10:~ # resize2fs /dev/localVG/sys.opt
resize2fs 1.38 (30-Jun-2005)
/dev/localVG/sys.opt is mounted; can’t resize a mounted filesystem!

root@suselinux10:~ # ext2online /dev/localVG/sys.opt
ext2online v1.1.18 – 2001/03/18 for EXT2FS 0.5b

You can also pass the flag -r to resize the filesystem without using resize2fs and use lvresize instead of lvextend

root@linux:~ # lvresize -L +2g -r /dev/vgHQ0ascs/lv_sapmnt_exe
Size of logical volume vgHQ0ascs/lv_sapmnt_exe changed from 5.00 GiB (1280 extents) to 7.00 GiB (1792 extents).
Logical volume lv_sapmnt_exe successfully resized
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vgHQ0ascs-lv_sapmnt_exe is mounted on /export/sapmnt/HQ0/exe; on-line resizing required
old desc_blocks = 20, new_desc_blocks = 28
Performing an on-line resize of /dev/mapper/vgHQ0ascs-lv_sapmnt_exe to 7340032 (1k) blocks.
The filesystem on /dev/mapper/vgHQ0ascs-lv_sapmnt_exe is now 7340032 blocks long.

Install Chromium web browser on Fedora

Tom ‘spot‘ Callaway created a repository for the Chromium, the open source version of the Google Chrome web browser

To install, first create a file called /etc/yum.repos.d/chromium.repo with the following information

[fedora-chromium]
name=Chromium web browser and deps
baseurl=http://repos.fedorapeople.org/repos/spot/chromium/fedora-$releasever/$basearch/
enabled=1
gpgcheck=0

[fedora-chromium-source]
name=Chromium web browser and deps – Source
baseurl=http://repos.fedorapeople.org/repos/spot/chromium/fedora-$releasever/SRPMS/
enabled=0
gpgcheck=0

Then you run yum install -y chromium

root@shellcore:~ # yum install -y chromium
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package chromium.x86_64 0:5.0.355.0-0.1.20100315svn41615.fc12 set to be updated
–> Processing Dependency: chromium-libs = 5.0.355.0-0.1.20100315svn41615.fc12 for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libutility.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libbrowser.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libinstaller_util.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libchrome_gpu.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libdebugger.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libbase_i18n.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libbase.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libcommon_constants.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libipc.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libprofile_import.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libsyncapi.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libprinting.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: liballocator.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libapp_base.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: librenderer.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libglue.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libsandbox.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libworker.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libcommon.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libplugin.so()(64bit) for package: chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Running transaction check
—> Package chromium-libs.x86_64 0:5.0.355.0-0.1.20100315svn41615.fc12 set to be updated
–> Processing Dependency: v8 >= 2.1.4-1.20100315svn4129 for package: chromium-libs-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libv8.so.2()(64bit) for package: chromium-libs-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libGLEW.so.1.5()(64bit) for package: chromium-libs-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Processing Dependency: libminizip.so.1()(64bit) for package: chromium-libs-5.0.355.0-0.1.20100315svn41615.fc12.x86_64
–> Running transaction check
—> Package glew.x86_64 0:1.5.1-3.fc12 set to be updated
—> Package minizip.x86_64 0:1.2.3-23.fc12 set to be updated
—> Package v8.x86_64 0:2.1.4-1.20100315svn4129.fc12 set to be updated
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package        Arch    Version                                 Repository
Size
================================================================================
Installing:
chromium       x86_64  5.0.355.0-0.1.20100315svn41615.fc12     chromium  2.1 M
Installing for dependencies:
chromium-libs  x86_64  5.0.355.0-0.1.20100315svn41615.fc12     chromium   14 M
glew           x86_64  1.5.1-3.fc12                            fedora    109 k
minizip        x86_64  1.2.3-23.fc12                           fedora     24 k
v8             x86_64  2.1.4-1.20100315svn4129.fc12            chromium  895 k

Transaction Summary
================================================================================
Install       5 Package(s)
Upgrade       0 Package(s)

Total download size: 17 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 17 M
(1/5): chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_ | 2.1 MB     00:13
(2/5): chromium-libs-5.0.355.0-0.1.20100315svn41615.fc12 |  14 MB     01:18
(3/5): glew-1.5.1-3.fc12.x86_64.rpm                      | 109 kB     00:02
(4/5): minizip-1.2.3-23.fc12.x86_64.rpm                  |  24 kB     00:00
(5/5): v8-2.1.4-1.20100315svn4129.fc12.x86_64.rpm        | 895 kB     00:06
——————————————————————————–
Total                                           164 kB/s |  17 MB     01:44
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing     : v8-2.1.4-1.20100315svn4129.fc12.x86_64                   1/5
Installing     : glew-1.5.1-3.fc12.x86_64                                 2/5
Installing     : minizip-1.2.3-23.fc12.x86_64                             3/5
Installing     : chromium-libs-5.0.355.0-0.1.20100315svn41615.fc12.x86_   4/5
Installing     : chromium-5.0.355.0-0.1.20100315svn41615.fc12.x86_64      5/5

Installed:
chromium.x86_64 0:5.0.355.0-0.1.20100315svn41615.fc12

Dependency Installed:
chromium-libs.x86_64 0:5.0.355.0-0.1.20100315svn41615.fc12
glew.x86_64 0:1.5.1-3.fc12
minizip.x86_64 0:1.2.3-23.fc12
v8.x86_64 0:2.1.4-1.20100315svn4129.fc12

Complete!

The browser is installed and is located on /usr/bin/chromium-browser. On Gnome it’s located under Internet.

You can also go to google.com/chrome and download a rpm file to your system.

Building XML::Simple from Perl CPAN

Download XML::Simple from CPAN and then decompress and untar the downloaded file.

root@linux:/tmp # gunzip XML-Simple-2.18.tar.gz
root@linux:/tmp # tar xvf XML-Simple-2.18.tar
XML-Simple-2.18/
XML-Simple-2.18/t/
XML-Simple-2.18/t/1_XMLin.xml
XML-Simple-2.18/t/lib/
XML-Simple-2.18/t/lib/TagsToUpper.pm
XML-Simple-2.18/t/B_Hooks.t
XML-Simple-2.18/t/6_ObjIntf.t
XML-Simple-2.18/t/1_XMLin.t
XML-Simple-2.18/t/srt.xml
XML-Simple-2.18/t/4_MemShare.t
XML-Simple-2.18/t/3_Storable.t
XML-Simple-2.18/t/7_SaxStuff.t
XML-Simple-2.18/t/A_XMLParser.t
XML-Simple-2.18/t/0_Config.t
XML-Simple-2.18/t/subdir/
XML-Simple-2.18/t/subdir/test2.xml
XML-Simple-2.18/t/2_XMLout.t
XML-Simple-2.18/t/5_MemCopy.t
XML-Simple-2.18/t/8_Namespaces.t
XML-Simple-2.18/t/test1.xml
XML-Simple-2.18/t/desertnet.src
XML-Simple-2.18/t/9_Strict.t
XML-Simple-2.18/Changes
XML-Simple-2.18/MANIFEST
XML-Simple-2.18/lib/
XML-Simple-2.18/lib/XML/
XML-Simple-2.18/lib/XML/Simple/
XML-Simple-2.18/lib/XML/Simple/FAQ.pod
XML-Simple-2.18/lib/XML/Simple.pm
XML-Simple-2.18/META.yml
XML-Simple-2.18/maketest
XML-Simple-2.18/README
XML-Simple-2.18/Makefile.PL

root@linux:/tmp # cd XML-Simple-2.18
root@linux:/tmp/XML-Simple-2.18 # ls
Changes lib Makefile.PL maketest MANIFEST META.yml README t

Execute the script Makefile.PL to write the makefile

root@linux:/tmp/XML-Simple-2.18 # perl Makefile.PL
Checking installed modules …
XML::SAX is installed, it will be used by the test suite
Checking if your kit is complete…
Looks good
Writing Makefile for XML::Simple

Run make

root@linux:/tmp/XML-Simple-2.18 # make
cp lib/XML/Simple/FAQ.pod blib/lib/XML/Simple/FAQ.pod
cp lib/XML/Simple.pm blib/lib/XML/Simple.pm
Manifying blib/man3/XML::Simple::FAQ.3pm
Manifying blib/man3/XML::Simple.3pm

If you wish, you can skip to make install. Here I check if make test throw any error messages to my screen

root@linux:/tmp/XML-Simple-2.18 # make test
PERL_DL_NONLAZY=1 /usr/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
# Package Version
# perl 5.8.5
# XML::Simple 2.18
# Storable 2.13
# XML::Parser 2.34
# XML::SAX 0.12
# XML::NamespaceSupport 1.08
# XML::SAX::PurePerl 0.90
# XML::LibXML::SAX::Parser 1.50
# XML::LibXML::SAX 1.00 (default parser)
t/0_Config……..ok
t/1_XMLin………ok
t/2_XMLout……..ok
1/201 skipped: Tie::IxHash not installed
t/3_Storable……ok
t/4_MemShare……ok
t/5_MemCopy…….ok
t/6_ObjIntf…….ok
t/7_SaxStuff……ok
t/8_Namespaces….ok
t/9_Strict……..ok
t/A_XMLParser…..ok
t/B_Hooks………ok
3/12 skipped: Tie::IxHash not installed
All tests successful, 4 subtests skipped.
Files=12, Tests=496, 12 wallclock secs ( 1.75 cusr + 0.41 csys = 2.16 CPU)

Then I install the files

root@linux:/tmp/XML-Simple-2.18 # make install
Installing /usr/lib/perl5/site_perl/5.8.5/XML/Simple.pm
Installing /usr/lib/perl5/site_perl/5.8.5/XML/Simple/FAQ.pod
Installing /usr/share/man/man3/XML::Simple::FAQ.3pm
Installing /usr/share/man/man3/XML::Simple.3pm
Writing /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/XML/Simple/.packlist
Appending installation info to /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/perllocal.pod

CA XCOM for Linux

Here is a brief document to help you install or uninstall Computer Associates XCOM Data Transport for Linux

How to install XCOM

Check if there is a group named xcomadm on your server. If not, please create it.

root@linux:~ # groupmod xcomadm
groupmod: group ‘xcomadm’ does not exist

Check if the package is not installed. The name of the package is CA_XCOM.

root@linux:~ # rpm -qi -p CA_XCOM.xclx86.k2.6.motif2.2.rpm
Name        : CA_XCOM Relocations: (not relocatable)
Version     : r11                               Vendor: (none)
Release     : 0603                          Build Date: Sat 03 Jun 2006 04:30:04 PM BRT
Install Date: (not installed)               Build Host: usprsus1.ca.com
Group       : Applications/Productivity     Source RPM: CA_XCOM-r11-0603.src.rpm
Size        : 11887644                         License: commercial
Signature   : (none)
Summary     : A file transfer program.
Description :
CA-XCOM is a general purpose file transfer program.

root@linux:~ # rpm -qa | grep CA_XCOM
root@linux:~ #

Since it is not installed, let’s install the package. If you install the package using rpm, remember to check if you have the package called openmotif22.

root@linux:/dsmc/T3/software/files/xcom-linux # yum install CA_XCOM.xclx86.k2.6.motif2.2.rpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.atlantic.net
* updates: centos.mirror.nac.net
* addons: centos.aol.com
* extras: mirror.nyi.net
Setting up Install Process
Parsing package install arguments
Examining CA_XCOM.xclx86.k2.6.motif2.2.rpm: CA_XCOM-r11-0603.i586
Marking CA_XCOM.xclx86.k2.6.motif2.2.rpm to be installed
Resolving Dependencies
–> Running transaction check
—> Package CA_XCOM.i586 0:r11-0603 set to be updated
–> Processing Dependency: libXm.so.3 for package: CA_XCOM
–> Running transaction check
—> Package openmotif22.i386 0:2.2.3-18 set to be updated
–> Finished Dependency Resolution
Dependencies Resolved

================================================================================

Package        Arch    Version       Repository                           Size

================================================================================

Installing:
CA_XCOM        i586    r11-0603      CA_XCOM.xclx86.k2.6.motif2.2.rpm    4.5 M
Installing for dependencies:
openmotif22    i386    2.2.3-18      base                                1.3 M

Transaction Summary

================================================================================
Install      2 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 5.8 M
Is this ok [y/N]: y

Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing     : openmotif22                                       [1/2]
Installing     : CA_XCOM                                           [2/2]
Create Q, trusted, src, and trace directories
Make everything in /usr/spool/xcom and /usr/lib/xcom directories group xcomadm
Create the link for the program dealing with remotely initiated transfers
Set the permissions on the xcom directories /usr/spool/xcom/Q, /usr/spool/xcom/trace, /usr/spool/xcom/trusted, /usr/spool/xcom/ssl and /usr/spool/xcom/src
CA_XCOM install finished.

Installed: CA_XCOM.i586 0:r11-0603
Dependency Installed: openmotif22.i386 0:2.2.3-18
Complete!

Add the following lines to the /etc/services file

txpi              8044/tcp      # xcom
txpis             8045/tcp      # xcom (r11 only)

Create two files in /etc/xinetd.d called txpi and txpis

root@linux:~ # vi /etc/xinetd.d/txpi
# default: on
# description: The Unicenter CA-XCOM Data Transport Server.
service txpi
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/lib/xcom/xcomtcp
server_args = REMOTE 0
}

root@linux:~ # vi /etc/xinetd.d/txpis
# default: on
# description: The Unicenter CA-XCOM Data Transport Server.
service txpis
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/lib/xcom/xcomtcp
server_args = REMOTE 0 SSL
}

Start XCOM

root@linux:~ # /usr/sbin/xcomd
2008/09/28 21:01:53  PRG=xcomd PID=16368
XCOMU0088I xcomd started.

Making the daemon automatically start on startup

root@linux:~ # echo “xcom:3:once:/usr/sbin/xcomd” >> /etc/inittab
root@linux:~ # grep xcom /etc/inittab
xcom:3:once:/usr/bin/xcomd

Make xinetd reread its configuration file

root@linux:~ # pkill –HUP xinetd

Now check if there is a process listening on ports 8044 and 8045

root@linux:~ # netstat -an | grep 8044
tcp        0      0 0.0.0.0:8044                0.0.0.0:*                   LISTEN

root@linux:~ # netstat -an | grep 8045
tcp        0      0 0.0.0.0:8045                0.0.0.0:*                   EN

How to uninstall XCOM

Stop XCOM daemon

root@linux:~ # /usr/sbin/xcomd -s
XCOMU0079I xcomd: stop requested.
XCOMU0082I xcomd: stop request accepted.

Uninstall XCOM package

root@linux:~ # rpm -e CA_XCOM
Test if xcomd is running
xcomd not running, proceeding with uninstall.
Remove the program dealing with remotely initiated transfers
Remove the xcom directories
CA_XCOM uninstall finished.

sendmail – Warning: RunAsUser for MSP ignored, check group ids

Every time that I sent an email with an user, the system was displaying the message that could not chdir to the mail directory. I solved following the steps below:

user@linux:~ $ mail blackhole@domain.com
Subject: Test
Sending email to test
.
Cc:
user@linux:~ $ WARNING: RunAsUser for MSP ignored, check group ids (egid=503, want=51)
can not chdir(/var/spool/clientmqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.

The group ID 503 was from the user that was logged in and sending the mail. The problem in this system was that it needed setgid set in the sendmail binary file.

root@linux:~ # ls -l /usr/sbin/sendmail.sendmail
-rwxrwxrwx  1 root smmsp 757168 Apr 15  2008 /usr/sbin/sendmail.sendmail

root@anotherlinuxhost:~ # ls -l /usr/sbin/sendmail.sendmail
-rwxr-sr-x  1 root smmsp 757168 Apr 15  2008 /usr/sbin/sendmail.sendmail

root@linux:~ # chmod 2755 /usr/sbin/sendmail.sendmail
root@linux:~ # ls -l /usr/sbin/sendmail.sendmail
-rwxr-sr-x  1 root smmsp 757168 Apr 15  2008 /usr/sbin/sendmail.sendmail

Restarted sendmail and no error message is shown when sending a message.

root@linux:~ # service sendmail restart
Shutting down sm-client:                                   [  OK  ]
Shutting down sendmail:                                    [  OK  ]
Starting sendmail:                                         [  OK  ]
Starting sm-client:                                        [  OK  ]

user@linux:~ $ mail blackhole@domain.com
Subject: Test
Sending email to test
.
Cc:
user@linux:~ $