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