Category Archives: Linux, PostgreSQL, etc.

Notes about using Linux, MySQL, PostgreSQL and other free software, no matter if it’s open sourced or not.

Python 3.2.1 on OEL 6.1

--
-- Installing python 3.2.1 on OEL 6.1 from source
--
$ sudo yum install tk-devel gdbm-devel
$ mkdir python
$ cd python
$ export http_proxy=acme.proxy.com:80
$ wget http://www.python.org/ftp/python/3.2.1/Python-3.2.1.tgz
$ tar xvzf Python-3.2.1.tgz
$ cd Python-3.2.1
$ ./configure --prefix=/opt/python3.2
$ make
$ make test
$ sudo make install
$ sudo ln -s /opt/python3.2/bin/python3.2 /usr/bin/python32
$ sudo ln -s /opt/python3.2/bin/idle3.2 /usr/bin/idle-python32

-- cx_Oracle is (of course) mandatory library 
$ mkdir cx_Oracle
$ cd cx_Oracle
$ wget http://prdownloads.sourceforge.net/cx-oracle/cx_Oracle-5.1.tar.gz?download
$ tar xvzf cx_Oracle-5.1.tar.gz
$ cd cx_Oracle-5.1
$ sudo -s
# . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
# export LD_LIBRARY_PATH=$ORACLE_HOME/lib
# python32 setup.py build
# python32 setup.py install

-- lxml 2.3
-- libxml2 and libxslt1.1 libraries were already installed
-- on OEL 6.1, so it was as easy as downloading lxml from PyPI
-- and installing with:

$ tar xvzf lxml-2.3.tar.gz
$ cd lxml-2.3
$ python32 setup.py build
$ sudo python32 setup.py install

-- run test:
$ python32
>> from lxml import etree
>> print(etree.LXML_VERSION)
>> print(etree.LIBXML_VERSION)
>> print(etree.LIBXSLT_VERSION)

ArcServe agent 15 on OEL 6.1

Although ArcServe agent for Linux is not yet certified on Redhat 6.x (OEL 6.x) I decided to install and test the ArcServe agent v15.0 on my newly installed Oracle Enterprise Server 6.1 (x64, of course). Here is a mini how-to (I was installing from ArcServe 15 DVD):

# mount -t iso9660 /dev/cdrom /mnt/cdrom
# cd /mnt/cdrom/DataMoverandAgent/Linux
# ./install
Cannot identify your Linux distribution or it is not yet supported.

Important! You are installing UNIX and Linux Data Mover on a system that is running an operating system that is not currently supported by ARCserve. To check the latest list of supported operating systems, go to ca.com/support. If you continue, be aware that unexpected results could occur.
Do you want to continue? (YES/NO):(default: NO) YES

Simply select 2 (installig agent) and accept defaults, stop with the installation when you see the following warning:

The components you selected require this library file:
libstdc++-libc6.1-1.so.2.  Typically, Linux comes with this library
file. It is located in the /usr/lib path.  Before you rerun the
installation, install the file.

I already installed libstdc++-libc6.2-2.so.3 library on my OEL 6.1, hence all that is needed is a symbolic link that will hide the fact that newer libstdc++ library exists on the system:

$ sudo yum install compat-libstdc++-296.i686  // run in case if the proper "compat" library is not already installed on OEL6
$ cd /usr/lib
$ sudo ln -s libstdc++-libc6.2-2.so.3 libstdc++-libc6.1-1.so.2

Now, you can continue with the installation:

All CA ARCserve Backup agents can be configured for automatic startup 
and shutdown as part of your operating system startup and shutdown.
Do you want to enable automatic startup and shutdown of all backup agents? 
[y|n]:(default: y) y

Checking available space in /opt/CA                           ==> [ OK ]


Installation log file is                           ==> [ /tmp/ARCserveInstall070811-1055.log ]

    Common Agent Module                      (ABcmagt)       ==> [ INSTALL SUCCESSFUL ]
    Client Agent for Linux                   (ABagntux)      ==> [ INSTALL SUCCESSFUL ]

######################################################

    Installation log file is                      ==> [ /tmp/ARCserveInstall070811-1055.log ]
######################################################

Do you want to view the readme? [y|n]:(default: y) 

Local yum repository from OEL 6.1 DVD


$ sudo mkdir /mnt/OEL6.1
$ sudo mount -o loopback -t iso9660 /dev/cdrom /mnt/OEL6.1
$ cd /etc/yum.repos.d
$ sudo nano OEL61.repo

[OEL61]
name = Oracle Enteprise Linux 6.1 x64 DVD
baseurl = file:///mnt/OEL6.1/Server/
gpgcheck = 0
enabled = 1

$ sudo yum clean all

Loaded plugins: refresh-packagekit
Cleaning repos: OEL61
Cleaning up Everything

$ sudo yum list installed
$ sudo yum list available

Test install:

$ sudo yum install alacarte

Sudoers on Oracle Enterprise Linux

— Sticky note on how to allow OEL admins (dba’s?) to execute any command with sudo

$ su -
# visudo

At the end of file add the following:

## Allow users in group admin to run all commands
%admin ALL=(ALL) ALL

Add new group (admin) or use dba group if you want dba’s to have full access of the system:

# groupadd admin
# usermod -a -G admin alesk

Verify group membership for user:

# id alesk

Test sudo privilege, for example gain root shell:

$ sudo -s

ASRock mini – Part 6

One annoying problem that I got from time to time was NVIDIA driver not being able to initialize graphic card immediately after the start of X Server. The workaround that I used was to simply check radio button “Restart X” offered by X Server and I was back in the game. Tonight was the night to fix this annoyance once for all. First, I opened “System Log Viewer” and checked X.org5.log and found this piece of information:

(**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
(==) NVIDIA(0): RGB weight 888
(==) NVIDIA(0): Default visual is TrueColor
(==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
(**) May 16 20:10:05 NVIDIA(0): Enabling RENDER acceleration
(II) May 16 20:10:05 NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
(II) May 16 20:10:05 NVIDIA(0):     enabled.
(EE) May 16 20:10:05 NVIDIA(0): Failed to initialize the NVIDIA graphics device PCI:1:0:0. 
(EE) May 16 20:10:05 NVIDIA(0):     Please check your system's kernel log for additional error
(EE) May 16 20:10:05 NVIDIA(0):     messages and refer to Chapter 8: Common Problems in the
(EE) May 16 20:10:05 NVIDIA(0):     README for additional information.
(EE) May 16 20:10:05 NVIDIA(0): Failed to initialize the NVIDIA graphics device!

Next, I checked kern.log and found this interesting piece of the error stack:

May 16 20:10:03 ASROCK kernel: [   21.674176] vmap allocation for size 16781312 failed: use vmalloc=<size> to increase size.
May 16 20:10:03 ASROCK kernel: [   21.675430] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1076)
May 16 20:10:03 ASROCK kernel: [   21.675453] NVRM: rm_init_adapter(0) failed
May 16 20:10:04 ASROCK kernel: [   22.004608] vmap allocation for size 16781312 failed: use vmalloc=<size> to increase size.
May 16 20:10:04 ASROCK kernel: [   22.005910] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1076)
May 16 20:10:04 ASROCK kernel: [   22.005934] NVRM: rm_init_adapter(0) failed
May 16 20:10:04 ASROCK kernel: [   22.343136] vmap allocation for size 16781312 failed: use vmalloc=<size> to increase size.
May 16 20:10:04 ASROCK kernel: [   22.344431] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1076)
May 16 20:10:04 ASROCK kernel: [   22.344454] NVRM: rm_init_adapter(0) failed
May 16 20:10:04 ASROCK kernel: [   22.668109] vmap allocation for size 16781312 failed: use vmalloc=<size> to increase size.
May 16 20:10:04 ASROCK kernel: [   22.669346] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1076)
May 16 20:10:04 ASROCK kernel: [   22.669368] NVRM: rm_init_adapter(0) failed
May 16 20:10:05 ASROCK kernel: [   22.991828] vmap allocation for size 16781312 failed: use vmalloc=<size> to increase size.
May 16 20:10:05 ASROCK kernel: [   22.993177] NVRM: RmInitAdapter failed! (0x26:0xffffffff:1076)
May 16 20:10:05 ASROCK kernel: [   22.993199] NVRM: rm_init_adapter(0) failed

I fixed the problem by adding vmalloc=256M to grub boot loader:

$ sudo nano /etc/default/grub

then I changed:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash vmalloc=256M"

and

$ sudo update-grub

So far so good, I could not reproduce the error by rebooting machine. Here is my Vmalloc after I added vmalloc boot option:

$ cat /proc/meminfo | grep Vmalloc
VmallocTotal:     262144 kB
VmallocUsed:       77512 kB
VmallocChunk:     166908 kB