Automount for 0.3.x

3rd Party Package Requesting

Postby critor » Tue Dec 21, 2004 8:01 am

Thanks for your work Tom.


I've restarted everything from scratch and it's the same for me again.

I can make autofs/automount work easily with zipslack, but it doesn't want to work with Freesco with the same kernel and binaries.
The program just exits without saying anything about what it does not like!

automount uses libdl.so.5 and libc.so.5 (which seems to be present)
The .so files compiled with it aren't shown, that's why I thought the program shall have the path to those modules (as it calls them) stored somewhere when compiled.
So, may be there's a problem here although I've allready tried severall compiling options, and severall locations for those files.


So what can we do next?

- understand and fix what's wrong

or

- use another version of autofs programs that may be more clever or more verbose (but it seems 4.x version won't compile with our old compilation binaries...)

or

- use something else than autofs/automount: I've heard of AMD or am-utils, which wouldn't require a module inserted in kernel... but some of them are only for 2.2.x or 2.4.x kernels I think...

or

- abort (this is not for me, sorry ;)


Every little hint/help will be appreciated :)
Thanks.
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby tom » Tue Dec 21, 2004 9:32 am

I think that this might be a case of automount needing the full version of libc.so.5 (from zipslack).

Take a look at <a href='http://forums.freesco.org/support/index.php?act=ST&f=25&t=11695&hl=' target='_blank'>THIS</a> thread.

I tried compiling statically using LDFLAGS=-static. I didn't see any error messages but it was the same size as the dynamically linked one so I guess it didn't work. It didn't work on Freesco either.

I'll try upgrading libc.so.5 tonight when I get home.

Tom
User avatar
tom
Junior Advanced Member
 
Posts: 115
Joined: Sun Oct 27, 2002 4:39 pm

Postby tom » Wed Dec 22, 2004 12:55 am

Well, libc.so.5 wasn't the problem either. After some more digging around, I realized that automount writes it's messages in the system log (/var/messages) hehe, that's the most obvious place and the first place I should've looked :blush1:

here's what it writes in my syslog:
Dec 22 06:01:25 - automount[4032]: starting automounter version 3.1.7, path = /m
isc, maptype = file, mapname = /etc/auto.misc
Dec 22 06:01:25 - automount[4032]: Map argc = 1
Dec 22 06:01:25 - automount[4032]: Map argv[0] = /etc/auto.misc
Dec 22 06:01:25 - automount[4032]: cannot open lookup module file (Not an ELF fi
le)


It looks like it's not finding the modules correctly

my configure statement was
Code: Select all
./configure --prefix=/pkg/usr/local/autofs


the LIBDIR is {PREFIX}/lib/autofs so I put the modules in /pkg/usr/local/autofs/lib/autofs

That didn't work so I tried /pkg/usr/local/autofs/lib and /pkg/lib and /usr/lib/autofs with no luck.

If anyone else wants to play with it, you can download the non-working package from my ftp.

pkg -i <a href='ftp://toms.homelinux.org/packages/03x/test/autofs_3.1.7_tom' target='_blank'>ftp://toms.homelinux.org/packages/03x/tes...utofs_3.1.7_tom</a>

I'm not sure what to try next. I guess I'll sleep on it (or lose sleep on it). <_<

Tom
User avatar
tom
Junior Advanced Member
 
Posts: 115
Joined: Sun Oct 27, 2002 4:39 pm

Postby tom » Wed Dec 22, 2004 1:09 am

I guess the request has been made. Let's start a new topic in the compiling section instead of posting back here.

Tom
User avatar
tom
Junior Advanced Member
 
Posts: 115
Joined: Sun Oct 27, 2002 4:39 pm

Postby Lightning » Wed Dec 22, 2004 2:56 am

I agree this thread should go to the compiling section. But for some simple advice that will probably solve your problem.
When compiling do not take the directory structure so literal. such as using the /pkg/usr/local directory. If you want to use a prefix for packages use /usr/local or in most cases don't do anything and just use the source codes default and do NOT specify a PATH for libraries. This is because in the 03x series /usr/local /usr/share /usr/lib are allavailable for installing packages. If you want to specify a bin and or sbin directory so that executables are in the PATH just use /usr/bin and /usr/sbin which are both in the PATH for FREESCO. But in general most aplication can just be moved to one of these directories without making any special compiling option.

Then bearing in mind that you have actually taken the above suggestions when you install this package into FREESCO you would install any binaries that need to be in the PATH that were installed in Slackware /usr/bin to /pkg/bin in FREESCO which also is the same as /usr/bin just linked differently and the same for anything in /usr/bin into /pkg/bin. Then take everything that installed into /usr/local and install it in /pkg/usr/local

At this point what you have left is libraries. These it makes no difference if they installed into /lib /usr/lib /usr/local/lib /usr/share/lib. They ALL go into /pkg/lib, with one exception. If in slackware your package installed into /usr/local/my-app and it also installed it's own libraries into /usr/local/my-app/lib then those libraries would remain in /pkg/usr/local/my-app/lib and not be moved to the /pkg/lib directory.

If you follow these steps it will probably run.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12081
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby critor » Thu Aug 04, 2005 9:32 pm

I've had some free time, so I've taken a new look at this thread's problem.

Remember: we are trying to make an autofs/automount package for FreeSco.

With the same binaries and kernel, we've got something that works under ZipSlack, but not on FreeSco.


I've retried with FreeSco's last release (0.3.4) and autofs-3.1.3 and the problem remains the same:
automount aborts with the message "automount[4032]: cannot open lookup module file (Not an ELF file)".

I've taken a look at automount's sources.

The error happens when automount tries to load library lookup_file.so:
* dlopen(fnbuf, RTLD_NOW);

On FreeSco, I've putten that file in /pkg/usr/lib/autofs, and there is the symlink /usr/lib/autofs (so same location as on ZipSlack)

I've added some debug messages, and fnbuf contains the string "/usr/lib/autofs//lookup_file.so".

I don't know why there are 2 "/" after autofs, but the path is ok...
dlopen still fails... and dlerror returns the error string "not an ELF file".
So the problem is not compilation...


Even if I move, rename or delete lookup_file.so, dlerror still returns "not an ELF file" (instead of "file not found" or something like that...)



Don't you think there is something strange here?
Do you have any ideas on what the problem could be, or what other tests I could to in order to investigate the problem?


Thanks.


Download autofs-3.1.3 sources here: <a href='ftp://ftp.kernel.org/pub/linux/daemons/autofs/v3/autofs-3.1.3.tar.gz' target='_blank'>ftp://ftp.kernel.org/pub/linux/daemons/au...fs-3.1.3.tar.gz</a>
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby Lightning » Fri Aug 05, 2005 2:53 pm

Do you have the autofs.o module loaded ?
This module is included in the modules-?.zip file.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12081
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby critor » Fri Aug 05, 2005 5:14 pm

Yes Lightning, autofs.o module is loaded and lsmod shows it.
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby Lightning » Fri Aug 05, 2005 10:14 pm

It looks to me like there is a typo in the module.c at line 108 where there are two / slashes and there should just be one, which could cause some problems loading the lookup module. It's worth looking at anyway, because that is where the parse_sun.o module is looked for. :confused:
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12081
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA

Postby critor » Sat Aug 06, 2005 3:50 am

Thanks for your advice! :) And thanks for allways being there for everybody ;-)

I'm leaving for some days, but I'll try that as soon as possible.
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby critor » Sat Aug 13, 2005 1:31 pm

I'm back.


I've made the test, and automount fails, wether there is a single or double-slash ("/") in the path.


I've made a little test-program in C. It just tries to open a .so file with the dlopen function.



Here is the source.

sotest:
#include <stdio.h>
#include dlfcn.h>

void main(int argc, char** argv)
{ printf("%s = %i\n", argv[1], dlopen( argv[1], RTLD_NOW));
}


gcc needs the parameter "-ldl".
dlopen returns 0 if anything is wrong.


With ZipSlack, the program succesfully loads mount_afs.so for example (that file comes with autofs).


With FreeSco, whatever path I give to the program (absolute, relative, with or without symbolic links, existing file or not...) it fails and the following message is displayed:

sotest: '/usr/lib/' is not an ELF file
sotest: '/lib/' is not an ELF file
<the path I gave>=0


Of course a directory is not an ELF file...
The problem seems to become a little more technical...


Any idea of what's happening?
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby critor » Mon Aug 15, 2005 8:42 am

some more things to help you think about the problem:
Please, I really need your help...


I've looked at the man page for dlopen.

When given a not absolute path (not beginning with /), dlopen will look for the file in the following places:
* LD_LIBRARY_PATH (seems to not be set)
* /etc/ld.so.cache
* /usr/lib
* /lib

So now I understand (a little) why I've got an error (previous post) with /usr/lib and /lib directories.


Now, the problem is that dlopen (with FreeSco) does not seem to behave at all as the man page describes...
It is looking in /usr/lib and /lib although I've given an absolute path!!!

Note, that it does not say "/usr/lib/mount_afs.so is not an ELF file", but "/usr/lib is not an ELF file".

Could it be that dlopen's parameter is forgotten/erased/modified while the function is running?...

If parameter value is changes to "", this would mean a relative (not absolute) path, and produce a messages "/usr/lib/ is not an ELF file". And with automount, it would log the error in /var/messages (as described in earlier posts) "is not an ELF file".


This looks like a C-side-effect-bug (modifying a char* string), but once again everything works well with ZipSlack and the same binaries!!!


Can anybody help me understand? - Thanks.
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby critor » Tue Aug 16, 2005 4:36 am

it seems I have to make questions and answers on my own...


I just managed to make automount binary work correctly!
guess what I've done...

I've just installed the bash package, package which comes with a new libc.so.5 (if I've well understood)


Will I now have answers about "why", now that the problem is allmost solved?
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

Postby Peppe/Sweden » Tue Aug 16, 2005 1:52 pm

Critor , you?re amazing.

Are you going to make a package of this or is there another one up for the challange?

If there isn?t a package made in the near future - I would very much like a "how -to" exactly how you made it work.

Once again , Thank you for your work! :colgate:
[COLOR=blue] You mean that I don?t fly airplanes , I don?t have a grilfriend and don?t have a dog ? Buuh , I grow up to be a real loser! (The Kid , walt disney) [COLOR=blue]
User avatar
Peppe/Sweden
Junior Advanced Member
 
Posts: 161
Joined: Wed Feb 05, 2003 4:41 pm

Postby critor » Tue Aug 16, 2005 2:11 pm

Thank you.


I'm working on the package currently...
But it's my 1st package, and that autofs/automount needs a lot of things...

* To run correctly, the automount program seems to need the complete version of libc.so
* Autofs comes with a rc-file written for bash (so either we install bash, or we convert it for ash)
* That rc-file needs the cut program which isn't included in FreeSco
* And a kernel module is needed too...


The simplest way is of course to install everything, but that will never fit on a floppy!!!


Currently, I'm working on the rc-script file, cause it is not working.
In that sript, there are 2 releases... one for redhat-like, and one for debian-like...
FreeSco seems to need an hybrid script (with some redhat lines, and some debian lines...).

My current problem, is that the touch program in FreeSco fails if the tested file doesn't exist and don't create it... (unlike the touch program in ZipSlack)

Any idea on how to do that?...


When I'm finished debugging that script, I'll try to convert it for ash.


And then, we may try packaging with minimal requirements...
User avatar
critor
Newbie
 
Posts: 14
Joined: Mon Aug 02, 2004 2:55 pm

PreviousNext

Return to 3rd Party Package Requesting

Who is online

Users browsing this forum: No registered users and 6 guests

cron