Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Title says it all. I changed my hostname on my system to a FQDN and now Postfix won't start, saying:

Sep  1 21:57:06 mailer postfix/master[4759]: fatal: bind 127.0.0.1 port 10029: Cannot assign requested address

Interestingly enough, it still has the old name "mailer" in the error log. I've updated my configuration so that it should have the new hostname:

myhostname = mailer.xxx.com
mydomain = mailer.xxx.com

But no joy.

Please help! Let me know if there's any other info you need...


Postconf -n:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = mailer.xxx.com
mydomain = mailer.xxx.com
myhostname = mailer.xxx.com
mynetworks = xxx.xxx.xxx.0/24, 127.0.0.0/8
myorigin = /etc/mailname
notify_classes = bounce, 2bounce, delay, policy protocol, resource, software
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = permit_mynetworks, reject
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

ip addr:

1: lo: <LOOPBACK> mtu 16436 qdisc noop state DOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 40:40:4b:1c:8b:d1 brd ff:ff:ff:ff:ff:ff
    inet 173.45.237.59/24 brd 173.45.237.255 scope global eth0
    inet6 fe80::4240:4bff:fe1c:8bd1/64 scope link 
       valid_lft forever preferred_lft forever

/etc/hosts:

127.0.0.1     localhost localhost.localdomain
173.45.237.59     mailer.xxx.com

/etc/network/interfaces

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
# The loopback network interface
auto lo
iface lo inet loopback
pre-up iptables-restore < iptables.up.rules

# The primary network interface
# Uncomment this and configure after the system has booted for the first time
auto eth0
iface eth0 inet static
    address 173.45.237.59
    netmask 255.255.255.0
    gateway 173.45.237.1
    dns-nameservers 173.45.224.4 173.45.224.5
share|improve this question
    
has the machine been rebooted? –  Devin Ceartas Sep 1 '09 at 22:05
    
Yes. Postfix worked fine before the reboot, now it's not. I rebooted again, and still nothing. –  neezer Sep 1 '09 at 22:10
    
Don't Do This(tm). See the Files section of the hostname(1) manpage: manpages.ubuntu.com/manpages/karmic/en/man1/hostname.1.html –  Zanchey Sep 2 '09 at 15:52
    
You really want mydomain = xxx.com, by the way. –  Bill Weiss Sep 2 '09 at 16:11
add comment

5 Answers

up vote 3 down vote accepted

Adding as a new answer, since the topic of the question has changed from Postfix to a general networking problem.

I suspect it's the pre-up clause on the lo interface in /etc/network/interfaces. If that script (iptables-restore) fails, ifup aborts processing the interface. Try commenting it out and running ifup lo.

share|improve this answer
    
You and I were going the same place. Good call. –  Bill Weiss Sep 4 '09 at 23:53
add comment
1: lo: <LOOPBACK> mtu 16436 qdisc noop state DOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

Why isn't 127.0.0.1 on there? On a server I run (that works), I get:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever

As a test, try this:

> nc -l -s 127.0.0.1 -v -p 12345
  listening on [127.0.0.1] 12345 ...

If you don't get that, it's not postfix's problem :)

share|improve this answer
    
I run the command above, and I get the response that you said I should get. What now? –  neezer Sep 2 '09 at 21:14
    
If the ip output you posted is correct, I think you have some serious network problems. Out of curiosity, do something like ipconfig lo 127.0.0.1 netmask 255.0.0.0 and see if things change. –  Bill Weiss Sep 2 '09 at 22:32
    
Wait. your lo says it's down. how about an ifup lo and see if postfix is happier / ip addr output changes / something? –  Bill Weiss Sep 2 '09 at 22:33
    
I had tried <code>ifup lo</code> and the <code>ip addr</code> changes accordingly, to say that the <code>lo</code> is 'UNKNOWN' rather than 'DOWN', but Postfix keeps throwing the same error as if nothing has changed. For the record, I've setup another system with the hostname set correctly from the start (before Postfix is installed) identical to this system, and it works fine. My interest in this now is purely academic (want to know what went wrong). –  neezer Sep 3 '09 at 13:20
1  
Change those rules to have full paths: pre-up /sbin/iptables-restore < /some/place/iptables.up.rules. I would also have them on the eth0 definition instead of lo. It's ok if lo is up even if the firewall rules aren't loaded, maybe not so much for eth0 :) –  Bill Weiss Sep 4 '09 at 17:06
show 3 more comments

Please paste the output of postconf -n, ip addr and the content of /etc/hosts.

Generally the error you're describing indicates that it's trying to bind to a non-local IP address. The output of the above commands should help us figure out why.

share|improve this answer
    
Added the outputs to my question above. I noticed that it seems my loopback interface is down; I tried running "sudo ifconfig lo up", but now it says its status is "unknown". ??? –  neezer Sep 1 '09 at 22:23
    
Did you perhaps comment out the loopback interface in /etc/network/interfaces? –  Insyte Sep 1 '09 at 22:47
    
It should just have two lines: "auto lo" and "iface lo inet loopback". –  Insyte Sep 1 '09 at 22:47
    
Yes, those are all there and accounted for, and not commented out. –  neezer Sep 2 '09 at 13:51
add comment

You have no loopback address. It's got nothing to do with your Postfix config, something (or someone) has monkeyed with your /etc/network/interfaces file. Make sure it contains:

auto lo
iface lo inet loopback

At the top, then run ifup lo and all will be well.

share|improve this answer
    
No, I do have those in my /etc/network/interfaces file. Running "ifup lo" does the same as "ifconfig lo up", in that it still lists the status of the loopback interface as "unknown". I've added the contents of /etc/network/interfaces above for reference. Any other ideas? –  neezer Sep 2 '09 at 13:45
add comment

I just ran into the exact same problem. Postfix and my dkim filter wouldn't start and it turned out to be linked to the loopback interface being down. I tried an ifup lo but got ifup: interface lo already configured. So, I just did an ifdown lo and then an ifup lo. I didn't get an error message so I tried starting dkim/postfix and everything started right up.

Not sure why the loopback interface didn't start properly after a reboot. Still need to look into that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.