SA Bugzilla – Bug 5617
sa-compile fails when run from cron - can't find re2c
Last modified: 2007-08-20 09:43:23 UTC
I have a nightly cron set up to run this command: /usr/local/bin/sa-update && /usr/local/bin/sa-compile When sa-compile is run this way via cron, the sa-compile portion of this fails with the following error: re2c -i -b -o scanner1.c scanner1.re Can't exec "re2c": No such file or directory at /usr/local/bin/sa-compile line 281, <$fh> line 2622. command failed! at /usr/local/bin/sa-compile line 282, <$fh> line 2622. This appears to be caused by the following line in the sa-compile code: 'my $cmd = "re2c -i -b -o scanner$_.c scanner$_.re";'. When jobs are run from cron under our FreeBSD setup (and I suspect on most others), they require the full path to commands to be specified - ex. /usr/local/bin/re2c rather than just re2c. I've resolved this issue locally by updating that line in sa-compile to read "my $cmd = "/usr/local/bin/re2c -i -b -o scanner$_.c scanner$_.re"; Please change future release of Spamassassin to include the full path to re2c in the code for sa-compile. Thanks!
We can't really do that since people would have re2c installed in various locations. Perhaps you just need to set your PATH appropriately in the crontab.
(In reply to comment #1) > We can't really do that since people would have re2c installed in various locations. > Perhaps you just need to set your PATH appropriately in the crontab. Boy do I feel stupid! I never even noticed that PATH command at the top of my cron file. I will fix it there and thanks for your prompt response!
cool, closing