LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-19-2012, 09:52 PM   #1
jetbright
LQ Newbie
 
Registered: Sep 2012
Posts: 3

Rep: Reputation: Disabled
How to run a software based on an old glibc in a chroot jail?


I need to run sybase-11.0.3.3 or 11.9.2 on centos5.

Because the glibc-2.5-24 of centos5 is too newer for sybase-11 and the known “seg fault” problem, I make a plan to install and run sybase11 in a chroot jail on centos5.

And in the chroot jail, there is a glibc-2.2.93 from Redhat8.0.

I've made many researches.

I've succeeded once (sybase11.0.3.3 running ok ), then I deleted the virtual machine since I thought all things were ok.

But after that, I've never succeeded and I still got the “segmentation fault” when booting the sybase server.

I think that something detail was important in that success, but I didn’t notice it.

Any help would be greatly appreciated.

Here’s my steps:

>>>On Redhat8.0:

(1)Install and run a sybase-11.0.3.3 instance. All things are ok.
# ldd $SYBASE/bin/dataserver
/lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0×40013000)
libm.so.6 => /lib/i686/libm.so.6 (0x4001a000)
libc.so.6 => /lib/i686/libc.so.6 (0×42000000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0×40000000)

>>>On CentOS5:

(2)Make a chroot jail:/home/dbroot. In the jail, there are these dirs:
/bin, /lib, /sbin, /var/lib/rpm, /usr/lib, /usr/bin, /dev, /proc, /sys, /tmp
mount -o bind /proc /home/dbroot/proc
mount -o bind /dev /home/dbroot/dev
mount -o bind /sys /home/dbroot/sys

(3)Move these dirs with all their subdirs & files from Redhat8.0 to CentOS jail(/home/dbroot):
/bin, /lib, /sbin, /var/lib/rpm, /usr/lib, /usr/bin

(4)Configure /etc/chroot.conf and /etc/pam.d/login to make sybase loginning into jail.

(5)In the jail, install sybase11
# chroot /home/dbroot
# ldconfig
# rpm -ivh sybase-11.0.3.3.rpm
# ldd /opt/sybase/bin/dataserver
/lib/libNoVersion.so.1 => /lib/libNoVersion.so.1 (0x006a4000)
libm.so.6 => /lib/i686/libm.so.6 (0×00446000)
libc.so.6 => /lib/i686/libc.so.6 (0×42000000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x005d3000)

All seems to be right, the dataserver is based on just the same libraries as those on Redhat8.0.

(6)Login as sybase, of cause it’s into $jail/opt/sybase(/home/dbroot/opt/sybase) now.
$ export LD_POINTER_GUARD=0 (LD_POINTER_GUARD=1 is tried also, no help)
$ sybinit

I still get the “segmentation fault” when trying to boot the server.

It’s so unreasonable!
Login this jail, the /lib that sybase can find only is in jail($jail/lib).
And the only glibc that sybase can address is the glibc-2.2.93 in $jail/lib.
It’s impossible for sybase to find glibc-2.5-24 of CentOS5 out of the jail.
Then, what’s wrong?
 
Old 09-19-2012, 11:49 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by jetbright View Post
Then, what’s wrong?
Try adding
Code:
mount -o bind devpts /home/dbroot/dev/pts
It might be trying to open the pseudo terminal.
 
Old 09-20-2012, 03:57 AM   #3
jetbright
LQ Newbie
 
Registered: Sep 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I have tried to mount devpts, it's no help yet.
 
Old 09-20-2012, 12:04 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Can you run
Code:
$ strace sybinit
and maybe see what happens before the SEGFAULT?
 
Old 09-22-2012, 02:49 AM   #5
jetbright
LQ Newbie
 
Registered: Sep 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
I've succeeded.

I found the reason is "number of opened files". If it's great than 1024, the sybase server cannot be booted. To execute "$ ulimit -n 1024", it's ok.

Further more, I think if ulimit "number of opened files" to be great than 1024, it's possible to boot sybase, the point is what other kernel parametres must be adjusted together?

Thanks for David1357's help very much.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run firefox in a chroot jail? jlangelier Linux - Security 5 07-20-2012 03:24 PM
[SOLVED] Chroot jail or Root jail bayprince Linux - Newbie 3 07-25-2011 07:43 PM
[SOLVED] chroot jail problem: 'empty' jail MatrixS_Master Linux - Security 4 03-27-2010 06:25 AM
run postfix in a chroot jail in rhel 5 the_gripmaster Linux - Server 2 06-28-2007 01:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration