diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2015-12-02 05:15:40 -0500 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-01-05 12:43:34 -0500 |
commit | 2b6226e66f5339edc5e5f19aa3f1f5d7d2ce99ea (patch) | |
tree | c67605afc9acaf913a08ec045a2fb8247b555de1 /meta-networking/recipes-daemons/postfix/postfix.inc | |
parent | b03c85679883d95f5a64c46f79ae4e6868b72e57 (diff) | |
download | meta-openembedded-2b6226e66f5339edc5e5f19aa3f1f5d7d2ce99ea.tar.gz |
postfix.inc: fix start postfix failed while hostname is numeric
While hostname is numeric, start postfix failed
...
root@qemux86-64:~# hostname 1.2.3.4
root@qemux86-64:~# systemctl restart postfix
|Job for postfix.service failed because the control process exited
with error code. See "systemctl status postfix.service" and
"journalctl -xe" for details.
root@qemux86-64:~# systemctl status postfix -l
Dec 02 08:05:40 1.2.3.4 aliasesdb[535]: /usr/sbin/postconf: fatal: unable to use my own hostname
Dec 02 08:05:41 1.2.3.4 aliasesdb[535]: newaliases: warning: valid_hostname: numeric hostname: 1.2.3.4
Dec 02 08:05:41 1.2.3.4 postfix/sendmail[537]: warning: valid_hostname: numeric hostname: 1.2.3.4
Dec 02 08:05:41 1.2.3.4 aliasesdb[535]: newaliases: fatal: unable to use my own hostname
Dec 02 08:05:42 1.2.3.4 postfix[540]: warning: valid_hostname: numeric hostname: 1.2.3.4
Dec 02 08:05:42 1.2.3.4 postfix[540]: fatal: unable to use my own hostname
...
Refer meta/recipes-core/initscripts/initscripts-1.0/hostname.sh in oe-core,
add check_hostname.sh and invoke it before postfix start, if the hostname
is invalid, set "localhost" to main.cf.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-daemons/postfix/postfix.inc')
-rw-r--r-- | meta-networking/recipes-daemons/postfix/postfix.inc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc index 6d39570d3..dc652d7da 100644 --- a/meta-networking/recipes-daemons/postfix/postfix.inc +++ b/meta-networking/recipes-daemons/postfix/postfix.inc | |||
@@ -23,6 +23,7 @@ SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV | |||
23 | file://internal_recipient \ | 23 | file://internal_recipient \ |
24 | file://postfix.service \ | 24 | file://postfix.service \ |
25 | file://aliasesdb \ | 25 | file://aliasesdb \ |
26 | file://check_hostname.sh \ | ||
26 | " | 27 | " |
27 | 28 | ||
28 | S = "${WORKDIR}/postfix-${PV}" | 29 | S = "${WORKDIR}/postfix-${PV}" |
@@ -145,6 +146,8 @@ do_install () { | |||
145 | install -m 644 ${WORKDIR}/main.cf_2.0 ${D}${sysconfdir}/postfix/main.cf | 146 | install -m 644 ${WORKDIR}/main.cf_2.0 ${D}${sysconfdir}/postfix/main.cf |
146 | sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf | 147 | sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf |
147 | 148 | ||
149 | install -m 755 ${WORKDIR}/check_hostname.sh ${D}${sbindir}/ | ||
150 | |||
148 | install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix | 151 | install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix |
149 | install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient | 152 | install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient |
150 | 153 | ||