Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 96 18:27:30 MET
From:      marino.ladavac@aut.alcatel.at
To:        phil@cs.strath.ac.uk (Philip Murray)
Cc:        questions@freebsd.org
Subject:   Re: execve won't load interpreters
Message-ID:  <9601181727.AA22300@atuhc16.atusks01.aut.alcatel.at>
In-Reply-To:  <9601181518.aa25321@bell.cs.strath.ac.uk>; from "Philip Murray" at Jan 18, 96 3:18 pm

next in thread | previous in thread | raw e-mail | index | archive | help

> Hi,
>    I would first like to say I am impressed with FreeBSD - it is good to be
> able to have a *REAL* OS at home (and its FREE)! But unfortunately I do have
> a problem.

>    I have been trying to set up some text filters for lpd (I even used
> one from the handbook) and discovered that lpd couldn't execve scripts.

> I then tested this myself and get an "Exec Format error" when trying to
> execve interpreted files. I see that the shells use their own code for
> detecting scripts but I assume lpd relies on execve to do it all.

> I am running FreeBSD 2.1 and get the error with both my modified kernel and 
> also with the original GENERIC kernel.

> I had a quick look at the source code and found some code to deal with
> interpreted files (in kern_exec.c) but I can't find the code that is meant
> to detect interpreted files (I'm afraid I don't know much about kernel hacking).

> Anyone have any ideas?

Unless something went *very* wrong, scripts are execve'd fine.  At least,
my lpd does it all the time.

BTW, you did put

#! /absolute/path/to/interpreter

as the first line of your script?  #! in particular is very important,
as it constitutes the magic number of interpreted "executable."

/Alby

> Phil.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9601181727.AA22300>