From owner-freebsd-ports@FreeBSD.ORG Thu May 2 20:16:10 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 26252AAF for ; Thu, 2 May 2013 20:16:10 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id EE31B137C for ; Thu, 2 May 2013 20:16:09 +0000 (UTC) Received: by mail-ie0-f178.google.com with SMTP id b11so1120908iee.37 for ; Thu, 02 May 2013 13:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=uxJH64MBpghtSoQ6EZMiwdespCZb/U3JFYP4Bg/Hts8=; b=GTw/rLv3QfbOlLND3M2aYII4JL5niRQQHWVswTCGJenoRPP+MV0J70Lmt+dy71s1Rs P0UTXmPYHjeL0M7sQ0iznGY5lg+LnTtgQINZe1z/Jbwiw2gyqbZ116QxAeKgAxF6m0aO 6xo3QFEzlP4SAIJ2iwTMFDoxwUMYvbJqL3PbGA6zFmiydVrlVt4ixLvL0bojMjCse9rq EBEfjTgkZHvIs4Sq6ss00tJOjwWgP26KWF67CGafGLqIKRyetx8rJC6kCaNO67FzAmcp oYdcBoYbBJYM+brSSaG1A4M2MswRi4zEqB0fuuxgFlP7D5QXUlvFU/u6JsSIYgBbhgqO 8utA== X-Received: by 10.50.114.131 with SMTP id jg3mr3827059igb.75.1367525769369; Thu, 02 May 2013 13:16:09 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.64.58.52 with HTTP; Thu, 2 May 2013 13:15:38 -0700 (PDT) In-Reply-To: References: <20130430103821.GJ3577@ithaqua.etoilebsd.net> <1786370.b1sXK5t6Pv@pcoliver.heesakkers.info> <518276B1.80000@wasikowski.net> <3801459.Q9n94ffT6F@pcoliver.heesakkers.info> <5182C3DE.7040006@wasikowski.net> From: Chris Rees Date: Thu, 2 May 2013 21:15:38 +0100 X-Google-Sender-Auth: _zamyay-b2wJKupPyLksXML_hyk Message-ID: Subject: Re: [BRAINSTORM] shebang fixing framework To: Jeremy Messenger Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Cc: Oliver Heesakkers , =?ISO-8859-2?Q?=A3ukasz_W=B1sikowski?= , FreeBSD Ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2013 20:16:10 -0000 On 2 May 2013 21:00, Jeremy Messenger wrote: > On Thu, May 2, 2013 at 2:51 PM, =A3ukasz W=B1sikowski wrote: >> W dniu 2013-05-02 20:29, Oliver Heesakkers pisze: >> >>> Op do 02 mei 2013 16:22:41 schreef =A3ukasz W=B1sikowski: >> >>>> /usr/bin/env is not good in all the situation. Look at >>>> www.freebsd.org/cgi/query-pr.cgi?pr=3D177481 - /usr/bin/env is not wor= king >>>> when using 'service' to start daemons. We should change PATH used by >>>> 'service' to include /usr/local/bin and /usr/local/sbin or stop using >>>> /usr/bin/env to start rc.d scripts. >>> >>> >>> A question that arises from reading that pr is why service doesn't incl= ude >>> /usr/local/bin and /usr/local/sbin in its PATH, if it does your problem= would >>> probably dissapear. >> >> That would probably be the best fix. >> >>> I have no /usr/bin/perl symlink, in the pure-ftpd port directory I do: >>> >>> make extract >>> head -n1 work/pure-ftpd-1.0.36/configuration-file/pure-config.pl.in >>> #! @PERL@ >>> >>> >>> After installation the shebang reads: >>> #! /usr/local/bin/perl >>> >>> and I can use service to start or stop the daemon without any hacking. >> >> That is interesting. service(8) clearly states that PATH is set to >> /sbin:/bin:/usr/sbin:/usr/bin, so perl interpreter in /usr/local/bin >> should not work (like it doesn't in my case). > > The gdm's RC script has to set (export) PATH to make everything work. > Changing service in this way is undesirable, because it is designed to emulate the environment on startup, which is in /etc/rc . I'm not sure if modifying /etc/rc is a good idea either, because base shouldn't care what PREFIX is set to, and hardcoding /usr/local is inconsistent if PREFIX is changed. All I can suggest is that something like; PATH=3D"$PATH:%%PREFIX%%/bin:%%PREFIX%%/sbin" be put into affected rc files. We could even create a macro for this.... Chris