Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 May 2013 21:15:38 +0100
From:      Chris Rees <crees@FreeBSD.org>
To:        Jeremy Messenger <mezz.freebsd@gmail.com>
Cc:        Oliver Heesakkers <freebsd@heesakkers.info>, =?ISO-8859-2?Q?=A3ukasz_W=B1sikowski?= <lukasz@wasikowski.net>, FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: [BRAINSTORM] shebang fixing framework
Message-ID:  <CADLo838eubL0yFdUEDa6_n=aoeZVo_AM1zx%2B2tT%2Beywt4_UMuA@mail.gmail.com>
In-Reply-To: <CADLFttdLNigzNEYMvssZFtkhoM7jNrnEQSSaaVPKw8Lg_yieHQ@mail.gmail.com>
References:  <20130430103821.GJ3577@ithaqua.etoilebsd.net> <1786370.b1sXK5t6Pv@pcoliver.heesakkers.info> <518276B1.80000@wasikowski.net> <3801459.Q9n94ffT6F@pcoliver.heesakkers.info> <5182C3DE.7040006@wasikowski.net> <CADLFttdLNigzNEYMvssZFtkhoM7jNrnEQSSaaVPKw8Lg_yieHQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2 May 2013 21:00, Jeremy Messenger <mezz.freebsd@gmail.com> wrote:
> On Thu, May 2, 2013 at 2:51 PM, =A3ukasz W=B1sikowski <lukasz@wasikowski.=
net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo838eubL0yFdUEDa6_n=aoeZVo_AM1zx%2B2tT%2Beywt4_UMuA>