Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu debconf获取选择--安装程序输出为空_Ubuntu_Postfix - Fatal编程技术网

Ubuntu debconf获取选择--安装程序输出为空

Ubuntu debconf获取选择--安装程序输出为空,ubuntu,postfix,Ubuntu,Postfix,正在尝试收集postfix无人参与安装的预告条目。在postfix手动安装之后,我使用debconf获取如下选择,但得到零输出。知道这里有什么失败吗 root@pzi-ub-4:/var/tmp# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.10 Release: 16.10 Codename: yakkety root@pzi

正在尝试收集postfix无人参与安装的预告条目。在postfix手动安装之后,我使用debconf获取如下选择,但得到零输出。知道这里有什么失败吗

root@pzi-ub-4:/var/tmp# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.10
Release:        16.10
Codename:       yakkety
root@pzi-ub-4:/var/tmp# debconf-get-selections --installer | grep postfix
root@pzi-ub-4:/var/tmp#

当我有动力让我的Ubuntu kickstart工作时,我找到了解决方案。debconf get selection的--install选项不起作用。您需要跳过该步骤,只使用裸debconf get selection来获取debconf set selection的列表。 在“apt install postfix”之后的新安装中,我得到以下列表:

root@pzi-ub-1:~# 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
为了编译呈现的列表,我修剪了没有值的选项(安装程序没有要求的值),并创建了这个脚本,我从kickstart的%post部分调用它:

pzi@pzi-gw-1:~/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 --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