fedora directory server on FreeBSD?

rocky

Member

Reaction score: 1
Messages: 97

I like OpenLDAP but my boss forces me to use Fedora Directory Server (http://directory.fedoraproject.org/). FDS sounds very good and easy to setup :)

Because FDS supports OpenSolaris I think it's reasonable to install it on FreeBSD, but I didn't find any way to do that.

Do you have any idea about this?

Thanks for your helps and suggetions.
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

Thank you, SirDice!

I have linux_base-fc8. After extracting the FDS-*.rpm to /compat/linux/opt using rpm2cpio and cpio, I executed /compat/linux/opt/fedora-ds/setup/setup and got the following error:

Code:
bin/slapd/server/dsktune: error while loading shared libraries: ../../../../lib/libstdc++.so.6: ELF file OS ABI invalid
The path of file (../../../../) shows that it's FreeBSD library (not a Linux library). Does this mean that I should install C-libraries for /compat/linux? And how?
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

How can I load the right version of glib for Linux in /compat/linux?

Code:
Can't load '/usr/local/lib/perl5/site_perl/5.8.9/auto/Mozilla/LDAP/API/API.so' for module Mozilla::LDAP::API: /usr/local/lib/compat/libc.so.6: version GLIBC_2.1.3 required by /usr/local/lib/perl5/site_perl/5.8.9/auto/Mozilla/LDAP/API/API.so not defined at /usr/local/lib/perl5/5.8.9/mach/DynaLoader.pm line 226.
There are two versions of glibc: in /usr/local/lib/compat/ and in /compat/linux/lib. The later one was installed by using a rpm package from Fedora Core 8 packages...
 

SaveTheRbtz

Member

Reaction score: 9
Messages: 83

Try this:
Code:
[PH34R] ~> sudo chroot /compat/linux /bin/bash
Then you can do everything like in linux:

Code:
bash-3.2# uname -a
Linux PH34R 2.6.16 FreeBSD 8.0-CURRENT #44 r192199M: Sat May 16 20:28:20 MSD 2009 i686 athlon i386 GNU/Linux
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

Great! I wonder why this tip is missed from FreeBSD handbook :)

I try it now...
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

Failed to create semaphore for stats file

SaveTheRbtz suggests me to use chroot to use linux /compat. That's cool but I still have some problems.

To start FDS inside chrooted-Linux, I run

Code:
/opt/fedora-ds/sbin/ns-slapd \
  -d 9 \
  -D /opt/fedora-ds/etc/dirsrv/slapd-fds2 \
  -i /opt/fedora-ds/var/run/dirsrv/slapd-fds2.pid \
  -w /opt/fedora-ds/var/run/dirsrv/slapd-fds2.startpid
The log message is as below.

Code:
[20/May/2009:13:35:17 +0700] Fedora-Directory/1.2.0 - debug level: trace+connections (9)
[20/May/2009:13:35:17 +0700] - defbackend_init
[20/May/2009:13:35:17 +0700] slapi_be_new - Added new backend name [default] type [default] nbackends [1]
[20/May/2009:13:35:17 +0700] - => str2entry_dupcheck
[20/May/2009:13:35:17 +0700] - <= str2entry_dupcheck 0x80a9ed0 ""
[20/May/2009:13:35:17 +0700] - => str2entry_dupcheck
[20/May/2009:13:35:17 +0700] - <= str2entry_dupcheck 0x80b3a30 "cn=config"
[20/May/2009:13:35:17 +0700] - => str2entry_dupcheck
[20/May/2009:13:35:17 +0700] - <= str2entry_dupcheck 0x80b3a30 "cn=monitor"
[20/May/2009:13:35:17 +0700] - => str2entry_dupcheck

% stuff cut

[20/May/2009:13:35:17 +0700] - => ids_sasl_init
[20/May/2009:13:35:17 +0700] - gethostbyname("icy") failed, error 0 (Success)
[20/May/2009:13:35:17 +0700] - sasl service fqdn is: (null)
[20/May/2009:13:35:17 +0700] - ids_sasl_getopt: plugin= option=plugin_list
[20/May/2009:13:35:17 +0700] - <= ids_sasl_init
[20/May/2009:13:35:17 +0700] - => str2entry_dupcheck
[20/May/2009:13:35:17 +0700] - <= str2entry_dupcheck 0x80ac758 "cn=schema"

% stuff cut

[20/May/2009:13:35:18 +0700] - => send_ldap_result 68::
[20/May/2009:13:35:18 +0700] - <= send_ldap_result
[20/May/2009:13:35:18 +0700] - => str2entry_fast
[20/May/2009:13:35:18 +0700] - <= str2entry_fast 0x811f988
[20/May/2009:13:35:18 +0700] - add_created_attrs
[20/May/2009:13:35:18 +0700] - => send_ldap_result 0::
[20/May/2009:13:35:18 +0700] - <= send_ldap_result
[20/May/2009:13:35:18 +0700] - descriptor limit changed from 11095 to 1024
[20/May/2009:13:35:18 +0700] - Fedora-Directory/1.2.0 B2009.139.99 starting up
[20/May/2009:13:35:18 +0700] - Failed to create semaphore for stats file (/opt/fedora-ds/var/run/dirsrv/slapd-fds2.stats). Error 38.(Function not implemented)
Everything seems to work except two issues

(a) the internal gethostbyname doesn't work. This may not be important because ns-slapd continues to run

(b) `ns-slapd` tried to create stat file to store its PID but it failed to do that (Failed to create semaphore for stats file) After exposing this message `ns-slapd` stopped working

I think this problem relates to the compatibility of running chrooted-Linux in FreeBSD. How to overcome this error?

Thanks for your helps.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,298
Messages: 29,745

rocky said:
(a) the internal gethostbyname doesn't work. This may not be important because ns-slapd continues to run
Make sure resolv.conf is setup properly inside /compat/linux.

(b) `ns-slapd` tried to create stat file to store its PID but it failed to do that (Failed to create semaphore for stats file) After exposing this message `ns-slapd` stopped working
/opt probably doesn't exist. Have you tried creating that directory structure (inside the /compat/linux chroot of course)? Also make sure the account the ns-slapd runs on is able to write there.
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

Thanks SirDice.

(a)

To get `gethostbyname` to work I changed in /etc/hosts. Of course I can use your tip (edit in /etc/resolv.conf) but that requires something in local DNS :)

(b)

In fact I copy the FC8 root from a native installation (see http://www.onlamp.com/pub/a/bsd/2000/11/16/Big_Scary_Daemons.html) to /home/fedora_core/ then chroot:

Code:
$ chroot /home/fedora_core8 /bin/bash
In /home/fedora_core8 the directory /opt/ , /opt/fedora-ds/ do exist.


You can read some thing in my `dmemsg` (from FreeBSD system) at http://viettug.org/attachments/download/190/dmesg_linux.txt :

Code:
linux: pid 2024 (netstat): ioctl fd=3, cmd=0x891d ('\M^I',29) is not implemented
linux: pid 2024 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2024 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2024 (netstat): ioctl fd=3, cmd=0x8942 ('\M^I',66) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x891d ('\M^I',29) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x8942 ('\M^I',66) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x891d ('\M^I',29) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2026 (netstat): ioctl fd=3, cmd=0x8942 ('\M^I',66) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x891d ('\M^I',29) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x8942 ('\M^I',66) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x891d ('\M^I',29) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x8970 ('\M^I',112) is not implemented
linux: pid 2027 (netstat): ioctl fd=3, cmd=0x8942 ('\M^I',66) is not implemented
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,298
Messages: 29,745

There is no linux kernel in linux_base-*, it's not needed.
On the fbsd side what's the output of sysctl compat.linux.osrelease?
You may need to set it to 2.6.16.
 

SaveTheRbtz

Member

Reaction score: 9
Messages: 83

Indeed kernel is not needed, but choosing distributive with kernel closer to 2.6.16 is better
Also don't forget to do something like this:

Code:
# vi /etc/fstab
linproc                         /compat/linux/proc linprocfs rw 0 0
linsys          /compat/linux/sys       linsysfs        rw 0 0
devfs                   /compat/linux/dev devfs rw 0 0
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

Thank you, SaveTheRbtz and SirDice.

I use FC8 that uses a new version. It seems hard to find another kernel which closes to 2.6.16.

My `compat.linux.osrelease` is 2.6.16. After mouting system files as SaveTheRbtz said I still have problems.

Not all Linux functions are supported by the FreeBSD. If this is true I think we can't get rid of the error...
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

SaveTheRbtz said:
as i know there are improvements in linuxulator in 8.0. May be you should try it?
Thanks SaveTheRbtz.

I need a production environment for my company so I am afraid that I can't do this on the main machine. I am also buiding FDS on native FreeBSD but I have some problems with compiling process (see http://forums.freebsd.org/showthread.php?p=24996)

Anyway on my laptop `ndis0` is often flicked and I should try the 8 branch then I have a change to run `linuxulator`. (I can't find where to download it). I will try it next week.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,298
Messages: 29,745

rocky said:
Anyway on my laptop `ndis0` is often flicked and I should try the 8 branch then I have a change to run `linuxulator`. (I can't find where to download it). I will try it next week.
Code:
cd /usr/ports/emulators/linux_base-f8 && make install clean
 

SaveTheRbtz

Member

Reaction score: 9
Messages: 83

maybe its easier to install fedora as second system setup 389ds there and than mount linux's partition as /compat/linux ?
 
OP
OP
rocky

rocky

Member

Reaction score: 1
Messages: 97

Thank you!

I tried
* linux_base-f8
* mount a FC8 linux installation under FreeBSD then chroot...

All failed with error "`foobar` is not implemented".

Temporarily relax myself ;)
 
Top