Friday, February 18, 2011

LD_LIBRARY_PATH: how to make sure nelwy installed binaries' locations are a part of the LD_LIBRARY_PATH

This was on a Suse Linux 11 64 bit machine.

I installed two thridparty softwares freetds and unixodbc. After the customary installation steps of unixodbc. I installed freetds with the following set of commands

./configure --with-unixodbc=/usr/local
make
make install

Both the softwares generated a few so files and placed it under /usr/local/lib ( could be lib64 as well). If it places in lib64 , then you will not need to worry about the next few steps. However in my case the binaries were put into /usr/local/lib

To make the binaries available in the LD_LIBRARY_PATH, I followed the below steps

vi /etc/ld.so.conf; add /usr/local/lib i.e: the path where both freetds and unixodbc binaries are installed
ldconfig ; this is run to include the newly added lib path into the LD_LIBRARY_PATH
ldconfig -p | grep libtdsodb; to check if I will be able to find the newly added nbinaries eg: libtdsodb using the LD_LIBRARY_PATH set by the system

Just to check if my database connections were working

cp *.ini /usr/local/etc/ ; these ini's are pre configured with the database ip addresses and the

connection details
To test if DB connects, use the below command

isql -v MSSQLTestServer sa admin
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>

Bullseye error while executing through hudson/jenkins job on windows

I was unable to execute any commands of cov01.exe on windows through hudson . whereas form the systems command prompt all commands worked fine. Through the hudson job , I was getting an error

Exception: cannot determine home directory

I could not find out the exact solution to this. But I did find a workaround. I had to set a few environment variables

set APPDATA=C:\Documents and Settings\build\Application Data
set HOMEDRIVE=C:
set HOMEPATH=\Documents and Settings\build

The problem seems to be because the Bullseye needs a home directory to start its operations which for some strange reason was not being set from the hudson job.

Wednesday, February 16, 2011

Increase the Number of open files

In Hudson/Jenkins, we were unable to open a new session through the browser. However what I noticed on looking at the hudson logs was that the sessions were running in the background. However we did find a SEVER error message which said the
"(Too many open files)"

When I ran an lsof | wc -l it was almost at 1247
however as you can see from the below command , the limit for number of open files was set to 1024

# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 139264
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 139264
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

To resolve this, and to increase the number of open files that are allowed in the system, I did the below..


edit the /etc/security/limits.conf and add the following.
* soft nofile 4096
* hard nofile 4096

This means that for every user ( indicated by *) , the maximumm number of open files would be 4096. Instead of specifying *, you can specify the user-name .
You will have to restart the service, and exit the session for the new ulimit values to be in place.

# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 139264
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 4096
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 139264
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


A FEW commands that I had run to understand the various system parameters. Putting it down here for future reference

lsof -p

cat /proc/sys/fs/file-max

sysctl -a

/etc/sysctl.conf

sysctl -p