LoginSignup
6
4

More than 5 years have passed since last update.

最近のPostfixではmaster.cf内のtypeが全部unixになってる

Last updated at Posted at 2017-04-21

Postfixの勉強ということで『Postfix 実用ガイド』を読んでみてます。
邦訳にして2004年の本ですが2014年に第8刷。ロングセラーだじぇ

ただまぁ、原著が2003年。こちら を見る限り、Postfix 2.0〜2.1の本です。
最新は2.11 → 3.0 → 3.1ですから、どうしても当時の記述と今は異なってきます。
連携する外部コンポーネントや外部世界の常識もだいぶ違うので、そこは読み変えたり追加で調べないととだめ、ということになります。
例えばSendGridと連携する方法とか

さて、同書籍ではfifoキューを使うのが当たり前のように書かれています。
特にqmgrなどは「キューマネージャ」ですので、FIFOキュー使うのが自然そうに感じられます。

一方で Ubuntu 14.04 LTS, 16.04 LTSとか CentOS 7 の系統だとmaster.cfからはtypeとしてのfifoが一掃されています。

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
...
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr

12.04 LTS, CentOS 6 での設定例とかはこう

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
...
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr

# chroot の変化については今回は不問です。

非常に歴史あるソフトの中で、ディストロ標準バージョンで「最近」切り替わるというのはちょっとおもしろい。
使用するのがUnixドメインソケットかFIFOかの違いなのでもちろん「大したコト」ではないですが「なんでだ?」と不思議に思いました。

どうやら2012年頃に頭の良い人達がいたのでした。

Running on idle systems

3) Instead of changing the file system layout, we could change 
   master.cf to use "unix" instead of "fifo" endpoints for the queue 
   manager and pickup services. The reason for using FIFOs is that 
   Solaris 2.4 UNIX-domain sockets locked up the kernel during 
   Postfix tests (the change to FIFOs then exposed bugs in several 
   4.4BSD implementations, but I disgress). 

   To this date, both the trigger client (used in postdrop and cleanup) 
   and trigger server (used in qmgr and pickup) contain code for 
   UNIX-domain sockets.  This code has not been tested in 12 years, 
   so minor updates are likely needed. But the benefit of this is 
   that there are no visible changes except four bytes in master.cf.

出てくるキーワードが渋い。Solaris。この人のメール見ると「以前から問題には気づいていた」感がすごいのでそれも面白いです。

# あ、5年前の話を蒸し返してすみませんが disgress は digress のタイポだと思います……話が脱線しました。

そして、2.10あたりのリリースノートで無事以下のようになったようです。

[Feature 20120924] the default master.cf file now uses "unix" instead
of "fifo" for the pickup and qmgr services. This avoids periodic
disk drive spin-up.

Ubuntuだと14.04 LTS, RHEL/CentOSだと7はOKで、この一つ前のLTS相当は当てはまりません。

それ以前のバージョン場合はディストロが何かやるか、自分で手動で変えない限りはfifoになってると思います。

例えば Ubuntu 12.04.5 LTSとかだと

$ lsb_release -d
Description:    Ubuntu 12.04.5 LTS
$ postconf -d mail_version
mail_version = 2.9.6

という結果となり、おそらくfifoが使われています。

上述のメール文に基づいて開発者陣が古い実装に手直しを入れたかは未確認です。
問題点を理解したとしても、2.10 以前において無闇に使うのは避けたほうが良いかもしれません。

今時のSSD/NVMe環境下でここで話題になってるPostfixの古い挙動が致命的になるとは思われず。
まぁご参考まで。

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4