Title: Signature
RW wrote:
On Mon, 17 Apr 2017 16:37:35 -0400
Robert Steinmetz wrote:

I upgrades my working Ubuntu 14.04 LTS to 16.04 LTS SpamAssassin
version 3.4.1.
  Something happened during the upgrade and I ma now unable to get 
sa-compile to configure properly.

Here is the message

root@thelma:~# dpkg --configure sa-compile
Setting up sa-compile (3.4.1-3) ...
Running sa-compile (may take a long time)
Can't exec "rm": No such file or directory at /usr/bin/sa-compile
line 374, <$fh> line 1.
make: chmod: Command not found
This is likely an Ubuntu/Debian problem. On the face of it it look like
sa-compile is being run without a properly set PATH variable. 

Note that you do need to run sa-update after changing versions of
spamassassin as it will be looking for rules in a 3.4.1 specific
directory.
Thanks for the response.
It is a problem of a failed upgrade. I posted the problem on the Ubuntu forum so far not response.

I agree it looks like the $PATH is not set correctly, where in spamassassin of sa-compile would that be set?
I ran the command as superuser. I would expect that sa-compile would use the user's $PATH which definitely includes "rm" and "chmod", sso somewhere sa-compile or spamassassin must reser the $PATH or run as another user with an incorrect $PATH.

I found the entry below in /etc/passwd
debian-spamd:x:136:144::/var/lib/spamassassin:/bin/sh
I ran sa-update it ran without error.

I ran sa-compile again and this was the output;
root@thelma:~# sa-update
root@thelma:~# sa-compile
Apr 18 09:27:38.942 [8741] info: generic: base extraction starting. this can take a while...
Apr 18 09:27:38.942 [8741] info: generic: extracting from rules of type body_0
Can't exec "stty": No such file or directory at /usr/share/perl5/Mail/SpamAssassin/Util/Progress.pm line 158.
100% [===========================================] 1246.47 rules/sec 00m00s DONE
Can't exec "stty": No such file or directory at /usr/share/perl5/Mail/SpamAssassin/Util/Progress.pm line 158.
100% [===========================================] 254.60 bases/sec 00m09s DONE
Apr 18 09:27:48.738 [8741] info: body_0: 1146 base strings extracted in 10 seconds
cd /tmp/.spamassassin8741LlVWi0tmp
reading bases_body_0.in
Can't exec "rm": No such file or directory at /usr/bin/sa-compile line 374, <$fh> line 1.
cd Mail-SpamAssassin-CompiledRegexps-body_0
re2c -i -b -o scanner1.c scanner1.re
re2c -i -b -o scanner2.c scanner2.re
re2c -i -b -o scanner3.c scanner3.re
re2c -i -b -o scanner4.c scanner4.re
re2c -i -b -o scanner5.c scanner5.re
re2c -i -b -o scanner6.c scanner6.re
/usr/bin/perl Makefile.PL PREFIX=/tmp/.spamassassin8741LlVWi0tmp/ignored INSTALLSITEARCH=/var/lib/spamassassin/compiled/5.022/3.004001
Generating a Unix-style Makefile
Writing Makefile for Mail::SpamAssassin::CompiledRegexps::body_0
Writing MYMETA.yml and MYMETA.json
make
make: chmod: Command not found
Makefile:400: recipe for target 'blib/lib/Mail/SpamAssassin/CompiledRegexps/.exists' failed
make: *** [blib/lib/Mail/SpamAssassin/CompiledRegexps/.exists] Error 127
command failed: exit 2
root@thelma:~#
tty is in /usr/bin
rm is in /bin
chmod is in /bin
sa-complie is in /usr/bin

root@thelma:/usr/bin# ls -ld sa-compile
-rwxr-xr-x 1 root root 22014 Nov 10  2015 sa-compile

Looking at sa-compile it seems $PATH is set this looks to me like it overwrites the search path.
if (!$modname) {
    $modname = "Mail::SpamAssassin::CompiledRegexps::$ruleset_name";
  }

  our $PATH = $modname;
  $PATH =~ s/::/-/g;
  $PATH =~ s/[^-_A-Za-z0-9\.]/_/g;
rm seems to be used without an absolute path at line 374 below.
$force and system("rm -rf $PATH");
I am not a perl expert, I hardly know anything about it.
Perhaps someone can shed some light on this.
I could edit sa-compile and add /bin/rm, /usr/.bin/tty
then
track down the chmod and add /bin/chmod where it occurs later.
somehow that seems the wrong way to fix it.


--
Robert Steinmetz, AIA
Principal
Steinmetz & Associates

<<attachment: rob.vcf>>

Reply via email to