Location of perl in #! of Mailscanner scripts

John Rudd jrudd at ucsc.edu
Sat Apr 8 16:37:12 IST 2006


On Apr 5, 2006, at 5:44 PM, grant beattie wrote:

> On Wed, Apr 05, 2006 at 01:48:39PM -0400, Bob Jones wrote:
>
>> Hey all,
>>
>>     So, a little issue here with the install.sh script of the
>> distribution for Solaris/BSD/Other Linux/Other Unix.  We have 
>> installed
>> a new distribution of perl in a nonstandard location (let's say
>> /opt/perl for this discussion).  So, when I go to install Mailscanner
>> with the install.sh script I give it the flag --perl=/opt/perl and
>> everything installs fine.
>>
>>     Next I go to run Mailscanner and it goes kablooey.  I get to
>> looking around and I see why.  Even though I specified an alternate
>> location of perl in the install script, all the Mailscanner perl 
>> scripts
>> (e.g. /opt/Mailscanner/bin/MailScanner ) point to #!/usr/bin/perl.
>> Shouldn't the install script change these headings to the specified 
>> perl
>> or am I missing something?  I can't just put a link in /usr/bin as the
>> legacy perl is needed for other things.
>
> the generally accepted ``#!/usr/bin/env perl'' would be better here
> so it would Just Work even if you don't do --perl=blah...
>
> grant.
>

I don't think that helps much when you've got multiple copies of perl 
installed, and you need a specific one to be invoked for mailscanner.  
(which is what I inferred from the original poster (OP)).

A symlink doesn't help (as one person suggested) because that's 
_effectively_ the same as saying "de-install the other copy of perl" -- 
if you need your legacy perl sitting around, you can't really do that.  
You need /usr/bin/perl to be the old perl, and /opt/perl/bin/perl to be 
the new perl (hopefully gleaning the right paths from the OP).  And you 
need /opt/perl/bin/perl to be what mailscanner uses for all of its 
routines.

Using "/usr/bin/env perl" doesn't tell the system _anything_ about 
which perl to use, so you're going to (seemingly) randomly end up with 
one perl ... hopefully the same one every time, and hopefully the one 
you need it to be.

No, the right thing is exactly what the OP requested: if you specify a 
perl binary to the install routine, then everything in the mailscanner 
dist. that has a #! invocation line should have that in its invocation 
line.  No exceptions.




More information about the MailScanner mailing list