0

I seem to be in a world of hurt because I keep shooting blanks on getting everything to work on wlan0 on my rev 1 Pi. It's using an edimax dongle which is a known good and with the below setup I can ssh into it wirelessly. The OS is Raspbian GNU/Linux 7 (wheezy). But on startup there are some issues that are new and Postgres will not start up. I would think on bootup there would not be any port issues so I lay this issue at the feet of my inadequacy to get the wpa_supplicant to work. I've been through all the google searches and tried lots of different ones. Here is what I think are the relevant messages from the bootup. I could not find these messages in any logs so this is my keying from its screen. I have run sudo apt-get update, upgrade in the past week so it should not need an update for this, right?

not running dhcpcd because /etc/network/interfaces ... failed!

start eth0 start wlan0 done
starting Postgresql 9.1 database server main[...]
The Postgresql server failed to start. 2015-08-11 07:17:56  CDT LOG: could not bind IPv4 socket: Cannot assign requested address. HINT: is another postmaster already running on port 5432?

Could not create listen socket for localhost
FAIL FATAL: could not create any TCP/IP sockets

My IP address is: 192.168.0.156

/etc/networking/interfaces

auto wlan0
iface lo inet loopback

#auto eth0
#allow-hotplug eth0
iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp 
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
#ap_scan=2

network={
        ssid="Zoomer"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
        psk="mypassword"

}

My goal is to swap out the edimax with another Realtec device (that has worked in the past) for long-distance wifi. Help me see what I'm not understanding.

1

Postgresql starting does not depend on you being connected to a network; IP services are always available, even if the only interface on the machine is lo (local loopback; there is no corresponding hardware). This problem:

Cannot assign requested address. HINT: is another postmaster already running

Would not be solved by getting wlan0 working properly. What's implied is that something is already bound to port 5432; hopefully this is just a misconfiguration somewhere that's resulted in postgresql starting twice or starting, dying and starting again. In this latter case, if it did not set an option on the port allowing for immediate reuse, the OS may hold onto it for an indeterminate period of time.

Right after this happens at boot, try:

lsof -i TCP:5432

You'll need to apt-get install lsof if it isn't already installed.

Hopefully it says something, revealing who the culprit is. If it says nothing, try service postgresql start; if that fails, wait 5 minutes and try again. If it doesn't work at that point, something very strange is going going on; have a look at

tail -n 100 /var/log/syslog | grep -i postgresql

The postgresql server might have some independent log of its own; you should check the documentation for that.

|improve this answer|||||
  • Thank you, this is very helpful. Even after restart lsof yields nil, also the search of syslog. And the only log of postgresql I can find is: /var/log/postgresql/postgresql could not bind IPv6 socket: Cannot assign requested address 2015-08-11 10:43:49 CDT HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry. I rebooted again and "MAGIC" it found it. Is lsof more than a reader? – sam452 Aug 11 '15 at 15:50
  • No. I‘d guess it‘s just summarizing information from /proc and/or /sys. – goldilocks Aug 11 '15 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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