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