[Bug 929471] New: hostname is not initialized so postfix default hostname/domainname faile
http://bugzilla.suse.com/show_bug.cgi?id=929471 Bug ID: 929471 Summary: hostname is not initialized so postfix default hostname/domainname faile Classification: openSUSE Product: openSUSE Distribution Version: 13.2 Hardware: x86-64 OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: dgolden@golden-consulting.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 633096 --> http://bugzilla.suse.com/attachment.cgi?id=633096&action=edit console output 1) When the system is booted, the hostname is never initialized. 2) Postfix uses the gethostname() system call to establish the "myhostname" and "mydomain" variables; therefore setting the domain name wrong. This causes all the postfix configuration files to fail on systems upgraded to 13.2. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471
--- Comment #1 from Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
Chenzi Cao
http://bugzilla.suse.com/show_bug.cgi?id=929471
Marcus Schaefer
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c4
Arvin Schnell
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c9
Pawel Wieczorkiewicz
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c10
Thomas Blume
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c11
Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c12
Thomas Blume
Created attachment 643513 [details] output of journalctl -axb
This is output of "journalctl -axb" after booting with systemd.log_level=debug.
I verified that the kernel hostname had NOT been initialized. To initialize required that I enter "/bin/hostname -F /etc/hostname". This is the same behaviour of the original bug.
I'm a bit puzzled how to reproduce this. On my test machine, hostname -F does nothing: -->-- linux-mgc6:~ # postconf | egrep '^myhostname|^mydomain' mydomain = localdomain myhostname = linux-mgc6.site linux-mgc6:~ # cat /etc/hostname dg-linux.golden-consulting.com linux-mgc6:~ # /bin/hostname -F /etc/hostname linux-mgc6:~ # hostname dg-linux.golden-consulting.com linux-mgc6:~ # postconf | egrep '^myhostname|^mydomain' mydomain = localdomain myhostname = linux-mgc6.site --<-- It only works if I modify /etc/HOSTNAME, and then run /usr/sbin/config.postfix: -->-- linux-mgc6:~ # cat /etc/HOSTNAME dg-linux.golden-consulting.com linux-mgc6:~ # /usr/sbin/config.postfix Reading /etc/sysconfig and updating the system... Setting up postfix local as MDA... Setting SPAM protection to "off"... linux-mgc6:~ # postconf | egrep '^myhostname|^mydomain' mydomain = golden-consulting.com myhostname = dg-linux.golden-consulting.com --<-- The script config.postfix creates new entries in /etc/postfix/main.cf. It looks like /etc/postfix/main.cf is unconfigured on your machine. Maybe there was a problem at postfix installation time. Can you please check? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c13
--- Comment #13 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c14
Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c15
--- Comment #15 from Dennis Golden
Could it be that here the DNS/FQDN (Fully Qualified Domain Name) is mixed with the static hostname which is given in /proc/sys/kernel/hostname?
The first is bind normally to the first (ether)net device whereas the second is set by systemd-hostnamed.service(8) (compare with man:hostnamectl(1) and hostname(7)). In common practice the names before the very first dot do agree but this is not required. Beside this there also exist YP/NIS domain names which may or may not agree with the DSN domain name.
hostname - show or set the system's host name domainname - show or set the system's NIS/YP domain name dnsdomainname - show the system's DNS domain name nodename - show or set the system's DECnet node name
For any MTA the Fully Qualified Domain Name of the host is the one which (IMHO) should be used as e.g. relay hosts/servers do check for this name.
The value in /proc/sys/kernel/hostname is set by the hostname command of which is contained within the /etc/hostname file. Regards, Dennis -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c16
--- Comment #16 from Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c17
--- Comment #17 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c18
--- Comment #18 from Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c19
--- Comment #19 from Thomas Blume
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c20
--- Comment #20 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c21
--- Comment #21 from Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c22
--- Comment #22 from Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c23
Thomas Blume
Then the assertion that systemd is compatible with sysvinit is false. Postfix (for one) assumes that the gethostname() returns the FQDM.
Under sysvinit the hostname has always allowed postfix to use the correct host/domain name.
We were promised that systemd would be compatible. In fact it is not and I for one have a problem when there is no apparent interest in making it so.
What about simply putting:
kernel.hostname = dg-linux.golden-consulting.com
in /etc/sysctl.conf?
I've tested with the gethostname function:
-->--
#include
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c24
--- Comment #24 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c25
--- Comment #25 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c26
Thomas Blume
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c27
--- Comment #27 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c28
--- Comment #28 from Dennis Golden
(In reply to Dennis Golden from comment #22)
Hmm ... from attachment #643931 [details] I can see
dg-linux:~ # journalctl --unit systemd-hostnamed.service -- Logs begin at Fri 2015-02-20 20:53:14 CST, end at Fri 2015-08-14 12:04:23 CDT. -- Feb 20 19:55:36 linux-sbf4 systemd[1]: Starting Hostname Service... Feb 20 19:55:36 linux-sbf4 systemd[1]: Started Hostname Service. -- Reboot -- Aug 11 12:24:36 dg-linux systemd[1]: Enqueued job systemd-hostnamed.service/start as 1444 Aug 11 12:24:36 dg-linux systemd[1]: Starting Hostname Service... Aug 11 12:24:36 dg-linux systemd[1]: About to execute: /usr/lib/systemd/systemd-hostnamed Aug 11 12:24:36 dg-linux systemd[1]: Forked /usr/lib/systemd/systemd-hostnamed as 2577 Aug 11 12:24:36 dg-linux systemd[1]: systemd-hostnamed.service changed dead -> start
... why do you think this had not happen?
If you look carefully, you will see that it ran once on Feb 20 during the initial installation. That was before the network was configured. It also tried to run on Aug 11 while I was changing the network configuration for testing but ended with watchdog. It never did anything. I restarted the system at about 11:54 on Aug 14 and there was no attempt to run the service. Look at the last to entries in that log. Also look at the first two entries to see the status of the service. Regards, Dennis -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c29
--- Comment #29 from Dennis Golden
(In reply to Dennis Golden from comment #21)
Then the assertion that systemd is compatible with sysvinit is false. Postfix (for one) assumes that the gethostname() returns the FQDM.
Under sysvinit the hostname has always allowed postfix to use the correct host/domain name.
We were promised that systemd would be compatible. In fact it is not and I for one have a problem when there is no apparent interest in making it so.
What about simply putting:
kernel.hostname = dg-linux.golden-consulting.com
in /etc/sysctl.conf?
I've tested with the gethostname function:
Yes I understand. I try not to hard code FQDN in any configuration files since yast2 network configuration updates the /etc/hostname file (and other configuration files). If there are changes made to the network configuration, the administrator has to remember exactly which configuration files were modified.
-->-- #include
#include #include int main (int argc, char *argv[]) { char host[MAXHOSTNAMELEN]; char domain[64];
gethostname (host, sizeof host); printf ("host: %s\n", host);
getdomainname(domain, 64); return printf ("domain: %s\n", domain); } --<--
And it returned the desired output:
dg-linux:/tmp # /tmp/a.out host: dg-linux.golden-consulting.com domain: (none)
Before setting the sysctl, it was:
dg-linux:/tmp # ./a.out host: dg-linux domain: (none)
Since postfix is using gethostname, that should fix it for you. However, I'm not really sure what else is using gethostname and might create undesired side effects.
Actually, if it is only postfix that created problems for you, the simplest way is IMHO, if you just put:
myhostname = dg-linux.golden-consulting.com
in /etc/postfix/main.cf
See above comment.
I still don't understand why this isn't set on your machine. postfix.service has an entry:
ExecStartPre=/etc/postfix/system/config_postfix
which calls /usr/sbin/config.postfix the first time you start the service. As noted in comment#12 /usr/sbin/config.postfix will write the configuration into main.cf and postfix wouldn't use gethostname anymore.
I have moved my configuration files (main.cf and master.cf) from one system to new releases of openSUSE for over 10 years, only modifying the files for new functionality of postfix. I never update an existing system. I always do a new install and reconfigure after testing and I would really be upset if config_postfix were to overwrite my existing configuration. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c30
--- Comment #30 from Dennis Golden
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c31
--- Comment #31 from Dr. Werner Fink
http://bugzilla.suse.com/show_bug.cgi?id=929471
Thomas Blume
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c35
Thomas Blume
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c36
Ancor Gonzalez Sosa
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c37
Thomas Blume
http://bugzilla.suse.com/show_bug.cgi?id=929471
Imobach Gonzalez Sosa
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c39
Josef Reidinger
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c40
Martin Vidner
http://bugzilla.suse.com/show_bug.cgi?id=929471
http://bugzilla.suse.com/show_bug.cgi?id=929471#c41
Stefan Hundhammer
participants (1)
-
bugzilla_noreply@novell.com