メンテナンス・トラブルシュート - pkg・ports アップデート - spamassassin - 3.4.1_12 → 3.4.2

 クラウディア
1. 概要
2. 周辺モジュールをインストールしなおし
3. 更に・・・
4. 補遺

1. 概要

 発生は 2018年9月27日。

> pkg version -vl "<"
spamassassin-3.4.1_12              <   needs updating (index has 3.4.2)
 によりアップグレードすると

> portupgrade -Rr spamassassin
[Reading data from pkg(8) ... - 357 packages found - done]
[Gathering depends for mail/spamassassin .............................................................. done]
[Exclude up-to-date packages .......................................................................... done]
--->  Upgrading 'spamassassin-3.4.1_12' to 'spamassassin-3.4.2' (mail/spamassassin)

・・・	略	・・・

===>   spamassassin-3.4.2 depends on package: perl5>=5.28.r1<5.29 - found
===>  Configuring for spamassassin-3.4.2
NOTE: settings for "make test" are now controlled using "t/config.dist".
See that file if you wish to customize what tests are run, and how.

checking module dependencies and their versions...

***************************************************************************
ERROR: the required HTML::Parser module is not installed,
minimum required version is 3.43.

  HTML is used for an ever-increasing amount of email so this dependency
  is unavoidable.  Run "perldoc -q html" for additional information.


***************************************************************************
ERROR: the required NetAddr::IP module is not installed,
minimum required version is 4.010.

・・・略・・・

***************************************************************************
NOTE: the optional BSD::Resource module is not installed.

・・・略・・・

checking binary dependencies and their versions...
dependency check complete...

REQUIRED module missing: HTML::Parser
REQUIRED module missing: NetAddr::IP
optional module missing: Digest::SHA1
optional module missing: Mail::SPF
optional module missing: Geo::IP
optional module missing: Razor2
optional module missing: IO::Socket::INET6
optional module missing: IO::Socket::SSL
optional module missing: DBI
optional module missing: LWP::UserAgent
optional module missing: Encode::Detect::Detector
optional module missing: Net::Patricia
optional module missing: BSD::Resource

warning: some functionality may not be available,
please read the above report before continuing!

Can't open Makefile: No such file or directory.
===>  Building for spamassassin-3.4.2
make[2]: cannot open Makefile.

make[2]: stopped in /usr/ports/mail/spamassassin/work/Mail-SpamAssassin-3.4.2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/mail/spamassassin
*** Error code 1

Stop.
make: stopped in /usr/ports/mail/spamassassin
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20180927-76565-1xl5kfu env UPGRADE_TOOL=portupgrade UPGRADE_PORT=spamassassin-3.4.1_12 UPGRADE_PORT_VER=3.4.1_12 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! mail/spamassassin (spamassassin-3.4.1_12)     (interrupted by user)
 実はこれ、原因は大体推測がつくのです。  「pkg・ports アップデート関連 - perl5」に書いてあるのですが、前の日に perl5 を 5.26 から 5.28 へアップデートしたのですが、他のモジュールは明示的にインストールしなおしていないからと思われます。

2. 周辺モジュールをインストールしなおし

 missing となっているものをインストールしなおしてみます。  portupgrade では無理かいな?

> portupgrade -Rr p5-HTML-Parser
[Reading data from pkg(8) ... - 357 packages found - done]
[Gathering depends for www/p5-HTML-Parser ... done]
[Gathering depends for mail/spamassassin .............................................................. done]
[Exclude up-to-date packages .......................................................................... done]
--->  Upgrading 'spamassassin-3.4.1_12' to 'spamassassin-3.4.2' (mail/spamassassin)
--->  Building '/usr/ports/mail/spamassassin'

・・・略・・・

Stop.
make: stopped in /usr/ports/mail/spamassassin
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20180927-80378-qodzov env UPGRADE_TOOL=portupgrade UPGRADE_PORT=spamassassin-3.4.1_12 UPGRADE_PORT_VER=3.4.1_12 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! mail/spamassassin (spamassassin-3.4.1_12)     (interrupted by user)
 あはは、やっぱ同じだわ・・・。ひとつずつだな・・・。

cd /usr/ports/www/p5-HTML-Parser
make deinstall clean
make
make install
cd /usr/ports/net-mgmt/p5-NetAddr-IP
make deinstall clean
make
make install
 と、もっと必要かと思われましたが・・・。  ここまでで

> portupgrade -Rr spamassassin
[Reading data from pkg(8) ... - 357 packages found - done]
[Gathering depends for mail/spamassassin .............................................................. done]
[Exclude up-to-date packages .......................................................................... done]
--->  Upgrading 'spamassassin-3.4.1_12' to 'spamassassin-3.4.2' (mail/spamassassin)

・・・略・・・

Installing spamassassin-3.4.2...
===> Creating groups.
Using existing group 'spamd'.
===> Creating users
Using existing user 'spamd'.
==========================================================================

You should complete the following post-installation tasks:

        1) Read /usr/local/share/doc/spamassassin/INSTALL
           and /usr/local/share/doc/spamassassin/UPGRADE
           BEFORE enabling SpamAssassin for important changes

        2) Edit the configuration in /usr/local/etc/mail/spamassassin,
           in particular /usr/local/etc/mail/spamassassin/init.pre
           You may get lots of annoying (but harmless) error messages
           if you skip this step.

        3) To run spamd, add the following to /etc/rc.conf:
           spamd_enable="YES"

        4) If this is a new installation, you should run sa-update
           and sa-compile. If this isn't a new installation, you
           should probably run those commands on a regular basis
           anyway.

        5) Install mail/spamass-rules if you want some third-party
           spam-catching rulesets

SECURITY NOTE:
By default, spamd runs as root (the AS_ROOT option). If you wish
to change this, add the following to /etc/rc.conf:

        spamd_flags="-u spamd -H /var/spool/spamd"

==========================================================================

===>  Cleaning for spamassassin-3.4.2
--->  Cleaning out obsolete shared libraries

3. 更に・・・

 これで sa-spamd を再起動でいいかな・・・と

> service sa-spamd status
spamd is not running.
> service sa-spamd start
Starting spamd.
spamd: could not create IO::Socket::IP socket on [::1]:783: Address already in use
server socket setup failed, retry 1: spamd: could not create IO::Socket::IP socket on [127.0.0.1]:783: Address already in use
spamd: could not create IO::Socket::IP socket on [::1]:783: Address already in use
server socket setup failed, retry 2: spamd: could not create IO::Socket::IP socket on [127.0.0.1]:783: Address already in use
spamd: could not create IO::Socket::IP socket on [::1]:783: Address already in use
server socket setup failed, retry 3: spamd: could not create IO::Socket::IP socket on [127.0.0.1]:783: Address already in use
spamd: could not create IO::Socket::IP socket on [::1]:783: Address already in use

Ctrl+C で停止
 ん~ status で見られないけど、まだいるのかな・・・と。

> pgrep -lf spam
38944 spamd child
99985 spamd child
662 /usr/local/bin/spamd -x -u spamd -H /var/spool/spamd -d -r /var/run/spamd/spamd.pid
> kill -KILL 662
> pgrep -lf spam
> service sa-spamd start
Starting spamd.
child process [96656] exited or timed out without signaling production of a PID file: exit 255 at /usr/local/bin/spamd line 3034.
/usr/local/etc/rc.d/sa-spamd: WARNING: failed to start spamd
 まだあかん。  起動時の maillog を見てみると

Sep 27 09:35:52 ns spamd[97421]: logger: removing stderr method
Sep 27 09:35:52 ns spamd[97424]: config: no rules were found! Do you need to run 'sa-update'?
Sep 27 09:35:53 ns spamd[97421]: child process [97424] exited or timed out without signaling production of a PID file: exit 255 at  /usr/local/bin/spamd line 3034.
 なるほど、初心に帰れ。sa-update ですな・・・。

> sa-update
> service sa-spamd start
Starting spamd.
 これで起動できたように見えましたが・・・。  maillog をずっと見ててよかったです。

Sep 27 09:36:20 ns spamd[97444]: logger: removing stderr method
Sep 27 09:36:20 ns spamd[97447]: Can't locate Net/SSLeay.pm in @INC (you may need to install the Net::SSLeay module) (@INC contain s: /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/site_perl/mach/5.28 /usr/local/lib/perl5/5.28/mach /usr/local/lib/perl5/5.2 8) at /usr/local/lib/perl5/site_perl/IO/Socket/SSL.pm line 19.
 うむ。  IO/Socket/SSL.pm もインストールしなおしが必要なようです。

cd /usr/ports/security/p5-Net-SSLeay
make deinstall clean
make
make install

service sa-spamd restart
 今度は maillog を見ていても大丈夫なようでした。

Sep 27 09:37:42 ns spamd[97447]: spamd: server killed by SIGTERM, shutting down
Sep 27 09:37:43 ns spamd[98236]: logger: removing stderr method
Sep 27 09:37:45 ns spamd[98240]: spamd: server started on IO::Socket::IP [::1]:783, IO::Socket::IP [127.0.0.1]:783 (running versio n 3.4.2)
Sep 27 09:37:45 ns spamd[98240]: spamd: server pid: 98240
Sep 27 09:37:45 ns spamd[98240]: spamd: server successfully spawned child process, pid 98241
Sep 27 09:37:45 ns spamd[98240]: spamd: server successfully spawned child process, pid 98242
Sep 27 09:37:45 ns spamd[98240]: prefork: child states: IS
Sep 27 09:37:45 ns spamd[98240]: prefork: child states: II

4. 補遺

 上記まででうまくいったように見えたのですが。  数日たって、spam にかかるべきものが素通しでクライアントへ渡されていることに気づきました。  qmail 関連の daemon も再起動が必要だったようです。  わたしの環境でいうと

qmail-start
qmail-smtpd-ssl
qmail-smtpd
qmail-pop3d-ssl
qmail-pop3d
 を再起動した後に

sa-spamd
 を再起動しないと、うまくメールをチェックしてくれないようです。
ハイスピードプラン
それがだいじWi-Fi
葬送のフリーレン Prime Video