[BRAINSTORM] shebang fixing framework

Oliver Heesakkers freebsd at heesakkers.info
Thu May 2 18:29:10 UTC 2013


Op do 02 mei 2013 16:22:41 schreef Łukasz Wąsikowski:
> W dniu 2013-05-01 21:18, Oliver Heesakkers pisze:
> > Op di 30 apr 2013 12:38:21 schreef Baptiste Daroussin:
> >> For a while now: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/51152
> >> we
> >> are looking for a framework/helpers to help patching scripts shebang so
> >> that they fit where the interpreters is on FreeBSD.
> > 
> > (...)
> > 
> > In there you wrote a patch using /usr/bin/env. Why not stick with that?
> > I'm
> > quite fond of this technique as it's clean and portable.
> > 
> > Portability might not be that important when working on a fix for ports
> > alone, but still makes sense to me.
> 
> /usr/bin/env is not good in all the situation. Look at
> www.freebsd.org/cgi/query-pr.cgi?pr=177481 - /usr/bin/env is not working
> 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 include 
/usr/local/bin and /usr/local/sbin in its PATH, if it does your problem would 
probably dissapear.

But your problem shouldn't have existed in the first place.

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.



More information about the freebsd-ports mailing list