Ubuntu 18.04 で Postfix の multi instances の service unit を有効にする方法
Managing multiple Postfix instances on a single host に従い、multi instances の設定をした後、その service unit を用意する方法のメモ。
/lib/systemd/system-generators/*などにあるファイルはOS起動時や systemd のリロード (systemctl daemon-reload) 時に実行される- postfix パッケージに
/lib/systemd/system-generators/postfix-instance-generatorが含まれている postfix-instance-generatorは、postconf -h multi_instance_directoriesの結果に応じて/run/systemd/generator/postfix.service.wants/postfix@postfix-XXX.serviceな symlink を作るpostmulti -I postfix-XXX -G mta -e createすると、/etc/postfix/main.cfのmulti_instance_directoriesに/etc/postfix-XXXが追加される
/run/systemd/generator/postfix.service.wants/*は、systemctl start postfixしたときに一緒に start される- なので、
systemctl start postfixで子インスタンスも起動される。stopとかrestartも同様
結論
子インスタンスの設定したあとに systemctl daemon-reload すればおk