Bug 6736 - re2c path fail
Summary: re2c path fail
Status: RESOLVED INVALID
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: sa-compile (show other bugs)
Version: 3.3.2
Hardware: All Linux
: P2 major
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-24 00:18 UTC by bugs
Modified: 2011-12-28 14:42 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description bugs 2011-12-24 00:18:04 UTC
When called via cron, using perl script sa-compile fails due to path ENV for re2c when it is installed from source to _default_ location, being  /usr/local/bin
this is due to:
(at around lines 115)

unless (qx(re2c -V)) {
  print "$0 requires re2c for proper operation.\n"
    or die "error writing: $!";
  exit 1;
}

I have corrected this by inserting   $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
at the top of file.
Comment 1 Kevin A. McGrail 2011-12-27 22:17:46 UTC
This sounds like a local configuration error.  You should likely be either A) editing your profile to include /usr/local/bin in your path or B) using cron's ability to set the path by adding commands such as:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
MAILTO=root
HOME=/

Regards,
KAM
Comment 2 bugs 2011-12-28 04:14:51 UTC
Crons path already includes
PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

This is not a bash issue, under bash it works, under perl it does not.
Comment 3 bugs 2011-12-28 04:23:48 UTC
/etc/cron.daily/saupdate.pl

#!/usr/bin/perl

#<snipped unrelated>

system("/usr/bin/sa-compile")

#<snipped unrelated>

exit;
Comment 4 Kevin A. McGrail 2011-12-28 14:42:54 UTC
(In reply to comment #3)
> /etc/cron.daily/saupdate.pl
> 
> #!/usr/bin/perl
> 
> #<snipped unrelated>
> 
> system("/usr/bin/sa-compile")
> 
> #<snipped unrelated>
> 
> exit;

Again, this is likely not an SA issue.  You are wrapping the call to sa-compile and not providing it with the path you want due to your local configuration.

The simplest fix is a ln -s to re2c in /usr/bin.