From owner-freebsd-questions Thu Jan 18 09:29:04 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA20693 for questions-outgoing; Thu, 18 Jan 1996 09:29:04 -0800 (PST) Received: from Relay1.Austria.EU.net (relay1.Austria.EU.net [192.92.138.47]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA20680 for ; Thu, 18 Jan 1996 09:28:44 -0800 (PST) From: marino.ladavac@aut.alcatel.at Received: from atusks01.aut.alcatel.at by Relay1.Austria.EU.net with SMTP id AA06736 (5.67b/IDA-1.5 for ); Thu, 18 Jan 1996 18:28:16 +0100 Received: from atuhc16 by atusks01.aut.alcatel.at (4.1/SMI-4.1/AAA-1.29/main) id AA22300; Thu, 18 Jan 96 18:27:32 +0100 Message-Id: <9601181727.AA22300@atuhc16.atusks01.aut.alcatel.at> Received: by atuhc16 (1.38.193.4/16.2) id AA16791; Thu, 18 Jan 1996 18:27:30 +0100 Subject: Re: execve won't load interpreters To: phil@cs.strath.ac.uk (Philip Murray) Date: Thu, 18 Jan 96 18:27:30 MET Cc: questions@freebsd.org In-Reply-To: <9601181518.aa25321@bell.cs.strath.ac.uk>; from "Philip Murray" at Jan 18, 96 3:18 pm Mailer: Elm [revision: 70.85] Sender: owner-questions@freebsd.org Precedence: bulk > 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.