Thomas Blume changed bug 929471
What Removed Added
Flags   needinfo?(dgolden@golden-consulting.com)

Comment # 23 on bug 929471 from
(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: