Postfix のインストール (pkgsrcで)

以前 Atom で組んだ NetBSD サーバだが、相変わらず調子が悪く、不定期に再起動が発生している。

ネットワークとかディスクの負荷とかと関係があるかと思って、ルータとして動かすのをやめてみたり、NFSサーバをやめてみたり、各種サーバプロセスを止めてみたりしたものの、改善の様子はない。

結局、別のサーバに完全に移行することにした。

今はメールサーバも外部サーバで運用しているのが、自宅サーバの cron メールを外部のメールサーバに転送するために、当該サーバではまだ Postfix が動いている。そして SASL が必要なために NetBSD 付属のではなく、pkgsrc でインストールしたものを使用している。

そこで移行先のサーバで pkgsrc で Postfix をインストールしたのだが…。

はて? pkgsrc でインスト-ルした方の Postfix を使うにはどうするんだっけ?

元のサーバの /etc/rc.conf を見ても何も書いてない。/etc/mailer.conf もオリジナルのままだ。でも、 ps で確認すると /usr/pkg/sbin/postfix が動いている…。

正解は /etc/rc.conf.d/postfix だった。しかも、以前インストールした時のメモに書いてあるし。

悔しいのでもう一度書いておく。

$ pkg_info -D postfix
Information for postfix-2.8.3nb1:
Install notice:
(略)
===========================================================================
$NetBSD: MESSAGE.NetBSD,v 1.5 2010/03/02 08:07:36 martti Exp $
The existing /etc/rc.d/postfix can be forced to start /usr/pkg/sbin/postfix
instead of /usr/sbin/postfix, by adding the following lines to
/etc/rc.conf.d/postfix:
postfix_command='/usr/pkg/sbin/postfix'
required_files='/usr/pkg/etc/postfix/main.cf'
start_cmd='/usr/pkg/sbin/postfix start'
stop_cmd='/usr/pkg/sbin/postfix stop'
reload_cmd='/usr/pkg/sbin/postfix reload'
postconf='/usr/pkg/sbin/postconf'
Please note that /etc/rc.conf.d/postfix does not exist by default so
you need to create that file if you need to override the default settings.
Remember to modify /etc/mailer.conf to use /usr/pkg/sbin/sendmail instead
of /usr/libexec/postfix/sendmail.
===========================================================================