SA Bugzilla – Bug 6736
re2c path fail
Last modified: 2011-12-28 14:42:54 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.
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
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.
/etc/cron.daily/saupdate.pl #!/usr/bin/perl #<snipped unrelated> system("/usr/bin/sa-compile") #<snipped unrelated> exit;
(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.