[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 <dgolden@golden-consulting.com> --- I have been able to create a work around by adding the command "/bin/hostname -F /etc/hostname" to /etc/init.d/boot.local -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Dennis Golden <dgolden@golden-consulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Dennis Golden <dgolden@golden-consulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dgolden@golden-consulting.c | |om -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Dennis Golden <dgolden@golden-consulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|hostname is not initialized |hostname is not initialized |so postfix default |so postfix default |hostname/domainname faile |hostname/domainnam fail -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Dennis Golden <dgolden@golden-consulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|hostname is not initialized |hostname is not initialized |so postfix default |so postfix default |hostname/domainnam fail |hostname/domain name fail -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Chenzi Cao <chcao@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chcao@suse.com Assignee|bnc-team-screening@forge.pr |ms@suse.com |ovo.novell.com | -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Marcus Schaefer <ms@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|ms@suse.com |yast-internal@suse.de --- Comment #2 from Marcus Schaefer <ms@suse.com> --- looks more like a yast think not setting the hostname on install or is this referring to another kind of system ? -- 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#c4 Arvin Schnell <aschnell@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|yast2-maintainers@suse.de |bnc-team-screening@forge.pr | |ovo.novell.com --- Comment #4 from Arvin Schnell <aschnell@suse.com> --- According to the last comment this is not a YaST issue. -- 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#c9 Pawel Wieczorkiewicz <pwieczorkiewicz@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pwieczorkiewicz@suse.com Assignee|wicked-maintainers@suse.de |systemd-maintainers@suse.de --- Comment #9 from Pawel Wieczorkiewicz <pwieczorkiewicz@suse.com> --- It's systemd's responsibility, reassigning to systemd-maintainers then. -- 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#c10 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |thomas.blume@suse.com Flags| |needinfo?(dgolden@golden-co | |nsulting.com) --- Comment #10 from Thomas Blume <thomas.blume@suse.com> --- Please remove the 'quiet' boot option and boot with: systemd.log_level=debug When the system is up, please provide the output of: journalctl -axb -- 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#c11 Dennis Golden <dgolden@golden-consulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(dgolden@golden-co | |nsulting.com) | --- Comment #11 from Dennis Golden <dgolden@golden-consulting.com> --- Created attachment 643513 --> http://bugzilla.suse.com/attachment.cgi?id=643513&action=edit 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. -- 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#c12 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(dgolden@golden-co | |nsulting.com) --- Comment #12 from Thomas Blume <thomas.blume@suse.com> --- (In reply to Dennis Golden from comment #11)
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 <werner@suse.com> --- 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. -- 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#c14 Dennis Golden <dgolden@golden-consulting.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(dgolden@golden-co | |nsulting.com) | --- Comment #14 from Dennis Golden <dgolden@golden-consulting.com> --- When you configure the network with yast hostname and domain, it creates /etc/hostname with the fqdn. If you read the man page for hostname, it will tell you that: The host name is usually set once at system startup in /etc/rc.d /rc.inet1 or /etc/init.d/boot (normally by reading the contents of a file which contains the host name, e.g. /etc/hostname). Obviously this is missing from systemd. If you read the documentation for postfix, it obtains the value for my hostname by doing a call get hostname which has not been set in the running kernel because it has not done the above. I have worked around the problem by putting this command: /bin/hostname -F /etc/hostname in: /etc/boot.local This should not be required. I several machines with postfix custom main.cf and master.cf. I don't want to hard code the myhostname variable, because I use the same configuration on multiple machines. This worked perfectly until systemd. 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#c15 --- Comment #15 from Dennis Golden <dgolden@golden-consulting.com> --- (In reply to Dr. Werner Fink from comment #13)
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 <dgolden@golden-consulting.com> --- BTW this is all managed by wicked. -- 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#c17 --- Comment #17 from Dr. Werner Fink <werner@suse.com> --- (In reply to Dennis Golden from comment #14) The static hostname is set by systemd-hostnamed.service and with this you may check this systemctl is-enabled systemd-hostnamed.service systemctl status -a systemd-hostnamed.service journalctl --unit systemd-hostnamed.service you may check this out (In reply to Dennis Golden from comment #15) I know ;) -- 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#c18 --- Comment #18 from Dennis Golden <dgolden@golden-consulting.com> --- Created attachment 643931 --> http://bugzilla.suse.com/attachment.cgi?id=643931&action=edit counsole output This is from a fresh boot. -- 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#c19 --- Comment #19 from Thomas Blume <thomas.blume@suse.com> --- I think this issue is the same as reported here: https://lists.debian.org/debian-user/2015/03/msg00287.html The kernel.hostname sysctl is set without domain: -->-- dg-linux:~ # sysctl -a | grep hostname kernel.hostname = dg-linux --<-- This is then used as the transient hostname by systemd. The hostname call is correcting this: -->-- dg-linux:~ # hostname -F /etc/hostname dg-linux:~ # sysctl -a | grep hostname kernel.hostname = dg-linux.golden-consulting.com --<-- It is also corrected when you remove the transient hostname via: hostnamectl --transient set-hostname "" This will then use the correct static hostname. The question is, what is setting kernel.hostname to the wrong value? -- 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#c20 --- Comment #20 from Dr. Werner Fink <werner@suse.com> --- The static hostname should be without any domain name. Simply because it is a local hostname which is normally not related to any network device. Also in Europe where very long domain names are common, it could be that if the domain name become part of the static hostname, it might be overflow the array used for the hostname (currently the limit is 64 characters, on older systems it might be 32 characters). Compare with man:proc(5) /proc/sys/kernel/domainname and /proc/sys/kernel/hostname can be used to set the NIS/YP domainname and the hostname of your box in exactly the same way as the commands domainname(1) and hostname(1), that is: # echo 'darkstar' > /proc/sys/kernel/hostname # echo 'mydomain' > /proc/sys/kernel/domainname has the same effect as # hostname 'darkstar' # domainname 'mydomain' Note, however, that the classic darkstar.frop.org has the hostname "darkstar" and DNS (Internet Domain Name Server) domainname "frop.org", not to be confused with the NIS (Network Information Service) or YP (Yellow Pages) domainname. These two domain names are in general different. For a detailed discussion see the hostname(1) man page. -- 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#c21 --- Comment #21 from Dennis Golden <dgolden@golden-consulting.com> --- 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. 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#c22 --- Comment #22 from Dennis Golden <dgolden@golden-consulting.com> --- BTW, if you look at the attachment I sent, you will find that systemd-hostnamed.service is not being called. 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#c23 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |needinfo?(dgolden@golden-co | |nsulting.com) --- Comment #23 from Thomas Blume <thomas.blume@suse.com> --- (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: -->-- #include <stdio.h> #include <unistd.h> #include <sys/param.h> 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 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. -- 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#c24 --- Comment #24 from Dr. Werner Fink <werner@suse.com> --- (In reply to Dennis Golden from comment #21) No it was not, all systems here around with SysVinit do set the static hostname without domain name. And I'm also maintainer of sysvinit. The script here was /etc/init.d/boot.localnet and the code does look like # # set hostname and domainname # XHOSTNAME="" test -f /etc/HOSTNAME && { read XHOSTNAME < /etc/HOSTNAME } test -n "$HOSTNAME" -a "$HOSTNAME" != '(none)' && { echo Using boot-specified hostname \'${HOSTNAME}\' XHOSTNAME="$HOSTNAME" } test -n "$XHOSTNAME" && { echo -n Setting up hostname \'${XHOSTNAME%%.*}\' hostname ${XHOSTNAME%%.*} rc_status -v -r } XDOMAINNAME="" test -f /etc/defaultdomain && { read XDOMAINNAME < /etc/defaultdomain } test -n "$XDOMAINNAME" && { echo -n Setting up NIS domainname \'$XDOMAINNAME\' } domainname "$XDOMAINNAME" test -n "$XDOMAINNAME" && { rc_status -v -r } unset XHOSTNAME unset XDOMAINNAME -- 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#c25 --- Comment #25 from Dr. Werner Fink <werner@suse.com> --- (In reply to Dennis Golden from comment #22) Hmm ... from attachment #643931 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? -- 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#c26 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |varkoly@suse.com Flags| |needinfo?(varkoly@suse.com) --- Comment #26 from Thomas Blume <thomas.blume@suse.com> --- Peter, any idea how main.cf could be empty to that postfix needs to use then gethostname function instead of the stored settings? -- 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#c27 --- Comment #27 from Dr. Werner Fink <werner@suse.com> --- Rational for choosing a hostname without domain name can be found in RFC 1178 and RFC 1123 https://tools.ietf.org/html/rfc1178 [...] Avoid domain names. For technical reasons, domain names should be avoided. In particular, name resolution of non-absolute hostnames is problematic. Resolvers will check names against domains before checking them against hostnames. But we have seen instances of mailers that refuse to treat single token names as domains. For example, assume that you mail to "libes@rutgers" from yale.edu. Depending upon the implementation, the mail may go to rutgers.edu or rutgers.yale.edu (assuming both exist). [...] https://tools.ietf.org/html/rfc1123 2.1 Host Names and Numbers The syntax of a legal Internet host name was specified in RFC-952 [DNS:4]. One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit. Host software MUST support this more liberal syntax. Host software MUST handle host names of up to 63 characters and SHOULD handle host names of up to 255 characters. [...] Btw: the array for the hostname in /proc/sys/kernel/hostname has 64 characters which includes the trailing ASCII null as well as the hostname. -- 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#c28 --- Comment #28 from Dennis Golden <dgolden@golden-consulting.com> --- (In reply to Dr. Werner Fink from comment #25)
(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 <dgolden@golden-consulting.com> --- (In reply to Thomas Blume from comment #23)
(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 <stdio.h> #include <unistd.h> #include <sys/param.h>
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 <dgolden@golden-consulting.com> --- Created attachment 644234 --> http://bugzilla.suse.com/attachment.cgi?id=644234&action=edit output of journalctl -ab for openSUSE 12.3 Since the last release of openSUSE that worked correctly was openSUSE 12.3, so I brought that system back up and ran journalctl -ab against it. You will see that it set the hostname to the FQDN: Aug 18 17:57:59 dg-linux.golden-consulting.com systemd[1]: Set hostname to <dg-linux.golden-consulting.com>. -- 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#c31 --- Comment #31 from Dr. Werner Fink <werner@suse.com> --- (In reply to Dennis Golden from comment #30) The hostname/domainname used in uname(1), set with sysctl(8) or gethostname(2)/getdomainname(2), and accessible at /proc/sys/kernel/hostname or /proc/sys/kernel/domainname has nothing todo with the full qualified hostname for the network device of the system which has to be used by a MTA like postfix or sendmail. The domainname with is NIS/YP and the hostname is for the local system only! It is very common to use the same short hostname for the local system as for the first part, aka without domainname, of the full qualified hostname of the first network device but the configuration of a MTA should use the name space of the network device and never the that of the local system! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yast2-maintainers@suse.de Flags| |needinfo?(yast2-maintainers | |@suse.de) -- 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#c35 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jen142@promessage.com --- Comment #35 from Thomas Blume <thomas.blume@suse.com> --- *** Bug 858385 has been marked as a duplicate of this bug. *** -- 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#c36 Ancor Gonzalez Sosa <ancor@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ancor@suse.com, | |mfilka@suse.com Flags|needinfo?(yast2-maintainers |needinfo?(mfilka@suse.com) |@suse.de) | --- Comment #36 from Ancor Gonzalez Sosa <ancor@suse.com> --- Moving the needinfo from yast2-maintainers to mfilka (see comment#32 for the question). -- 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#c37 Thomas Blume <thomas.blume@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|systemd-maintainers@suse.de |yast2-maintainers@suse.de --- Comment #37 from Thomas Blume <thomas.blume@suse.com> --- Reassigning to yast maintainers, since this seems to be an issue of the installer. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=929471 Imobach Gonzalez Sosa <igonzalezsosa@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |igonzalezsosa@suse.com -- 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#c39 Josef Reidinger <jreidinger@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jreidinger@suse.com --- Comment #39 from Josef Reidinger <jreidinger@suse.com> --- michal ping -- 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#c40 Martin Vidner <mvidner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(dgolden@golden-co | |nsulting.com), | |needinfo?(varkoly@suse.com) | |, | |needinfo?(mfilka@suse.com) | --- Comment #40 from Martin Vidner <mvidner@suse.com> --- Sorry for the delay. It appears that during the installation you have not actually set the hostname, it stayed as 'linux' and near the end YaST added a random 4 character suffix. You have changed the /etc/hosts entry for the static address, which is unfortunately also labeled Hostname in the UI (also in the latest Tumbleweed). -- 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#c41 Stefan Hundhammer <shundhammer@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 - Medium |P5 - None Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #41 from Stefan Hundhammer <shundhammer@suse.com> --- Resetting bug priority. This is meant for project managers, not for bug reporters. According to Martin's comment #40, this is a user error, not a bug. -> INVALID -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com