Today I ran emerge --depclean which removed dev-libs/libaio, which obviously was not in my world set. After doing that, samba-3.0.35 failed to start as it is linked against libaio.so.1:
2032 # ldd ` which smbd` | grep libaio
libaio.so.1 => /usr/lib/libaio.so.1 (0x00007f2733c0c000)
IMO dev-libs/libaio should not be something the user has to have in his/her world set. If samba depends on it, it should show up as a dependency (conditional on the async USE flag?).
BTW, this seems to be an issue with samba-3.0.x only, as samba-3.2.x (with the async USE flag) does work w/o libaio being installed.
I've emerged samba with
# emerge -pv samba
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] net-fs/samba-3.0.35 USE="acl async caps doc fam ldap pam python quotas readline syslog -ads -automount -cups -debug -examples -ipv6 -oav (-selinux) -swat -winbind"
This is on amd64 stable (except for samba-3.0.x ;)).
# emerge --info
Portage 22.214.171.124 (default/linux/amd64/2008.0/server, gcc-4.3.2, glibc-2.8_p20080602-r1, 2.6.29-gentoo-r5 x86_64)
System uname: Linux-2.6.29-gentoo-r5-x86_64-AMD_Athlon-tm-_64_Processor_3000+-with-glibc2.2.5
Timestamp of tree: Sat, 27 Jun 2009 01:00:17 +0000
ccache version 2.4 [enabled]
sys-devel/autoconf: 2.13, 2.63
sys-devel/automake: 1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2
CFLAGS="-O2 -march=k8 -msse3 -mfpmath=sse -pipe"
Steps to Reproduce:
1. Start samba-3.0.x w/o libaio being installed.
# /etc/init.d/samba restart
* samba -> start: smbd ...
/usr/sbin/smbd: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory [ !! ]
* samba -> start: nmbd ...
/usr/sbin/nmbd: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory [ !! ]
* Error: starting services (see system logs)
Samba should explicitly depend on dev-libs/libaio if the async USE flag is requested.
Can't reproduce this issue using amd64, can you provide full ldd output and build logs?
(In reply to comment #1)
> Can't reproduce this issue using amd64, can you provide full ldd output and
> build logs?
I've done some further research. From my rudimentary understanding of the matter, there are two aio libraries on linux: libaio with is specific to the Linux kernel, and librt which is a POSIX-compliant implementation provided by glibc.
Now the problem arises because the samba configure script is not very transparent to the user. When --with-aio-support is requested, then
1. if configure finds libaio, it uses that one and links smbd against it;
2. if configure does not find libaio, it falls back to librt;
So you can readily compile samba with USE=async without libaio. However, if you happen to have it installed and compile time, smbd is linked against it. Unfortunately, since libaio does not show up as a dependency in the ebuild, nothing prevents libaio from being unmerged by emerge --depclean, and then smbd won't start anymore (as in my case).
I guess there is nothing to be done here, since the real "problem" lies in samba's configure script, which ideally would let the user decide which library to use (then this could be reflected by two distinct USE flags, e.g. async-libaio and async-librt, and the appropriate dependency).