2017-02-09 9 views
0

postfix無人インストールのためのpreseedingエントリを収集しようとしています。 postfix手動インストール後、私は以下のようにdebconf-get-selectionsを使用しますが、ゼロ出力を得ます。何がここで失敗するのか?debconf-get-selections --installer output empty

[email protected]:/var/tmp# lsb_release -a 
No LSB modules are available. 
Distributor ID: Ubuntu 
Description: Ubuntu 16.10 
Release:  16.10 
Codename:  yakkety 
[email protected]:/var/tmp# debconf-get-selections --installer | grep postfix 
[email protected]:/var/tmp# 

答えて

0

私のUbuntuキックスタートが動くように動機づけながら、私は解決策を見つけました。 debconf-get-selectionの--installオプションが機能しません。 debconf-set-selectionのリストを取得するには、それをスキップして、まれにdebconf-get-selectionを使用する必要があります。

[email protected]:~# debconf-get-selections | grep postfix 
postfix postfix/main_mailer_type  select Internet with smarthost 
postfix postfix/recipient_delim string + 
postfix postfix/relay_restrictions_warning  boolean 
postfix postfix/mydomain_warning  boolean 
postfix postfix/not_configured error 
postfix postfix/retry_upgrade_warning boolean 
postfix postfix/mailname  string pzi-ub-1.foobar.com 
postfix postfix/chattr boolean false 
postfix postfix/destinations string pzi-ub-1.foobar.com, $myhostname, pzi-ub-1, localhost.localdomain, localhost 
postfix postfix/relayhost  string pzi-gw-1.foobar.com 
postfix postfix/procmail  boolean true 
postfix postfix/compat_conversion_warning  boolean true 
postfix postfix/mynetworks  string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 
postfix postfix/sqlite_warning boolean 
postfix postfix/kernel_version_warning boolean 
postfix postfix/tlsmgr_upgrade_warning boolean 
postfix postfix/mailbox_limit string 0 
postfix postfix/dynamicmaps_conversion_warning boolean 
postfix postfix/rfc1035_violation  boolean false 
postfix postfix/protocols  select all 
postfix postfix/main_cf_conversion_warning  boolean true 
postfix postfix/root_address string 
postfix postfix/bad_recipient_delimiter error 

ノー値(インストーラがために要求していないもの)でオプションをトリミングして、このスクリプトを作成したのpreseedリストをコンパイルするには:私はこのリストを取得する「aptのインストールpostfixの」の後に私の新鮮で インストール私はキックスタートの%postセクションから呼び出す:

%post --interpreter=/bin/bash 

exec > /root/post.log 2>&1 
set -x 
scripts=" 
autofs 
rootssh 
users 
sudo 
mail 
" 
for x in $scripts; do 
wget http://gw/ks/post/ub/$x -O $x; sh ./$x 
done 

[email protected]:~/Dropbox/notes/ks/post/ub$ cat mail 
set -x 
# x=mail; cd /var/tmp; wget http://gw/ks/post/ub/$x -O $x; sh ./$x 
# 
# ref: http://blog.delgurth.com/2009/01/19/pre-loading-debconf-values-for-easy-installation/ 

d=`grep search /etc/resolv.conf | sed 's/search //'` 
hostname=`hostname` 
fqdn=$hostname.$d 

cat<<EOF | debconf-set-selections 
postfix postfix/main_mailer_type  select Internet with smarthost 
postfix postfix/recipient_delim string + 
postfix postfix/mailname  string $fqdn 
postfix postfix/chattr boolean false 
postfix postfix/destinations string $fqdn, \$myhostname, $hostname, localhost.localdomain, localhost 
postfix postfix/relayhost  string mailhost.foobar.com 
postfix postfix/procmail  boolean true 
postfix postfix/compat_conversion_warning  boolean true 
postfix postfix/mynetworks  string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 
postfix postfix/mailbox_limit string 0 
postfix postfix/rfc1035_violation  boolean false 
postfix postfix/protocols  select all 
postfix postfix/main_cf_conversion_warning  boolean true 
postfix postfix/root_address string 
EOF 

debconf-get-selections | grep postfix 

apt-get -qq -y install postfix 

そして、ここではそのメールスクリプトとキックスタートの%postセクションであります