Editing
Msg04095.html
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Re: [vserver] postgres SQL = ----- * '''From:''' Sam Vilain * '''Date:''' Wed, 20 Aug 2003 14:51:54 +0100 (BST) ----- <pre> I am getting this error when trying to start postgresql (postmaster) in a vserver:PGSTAT: bind(2): Cannot assign requested address Something else has the port open, probably a postgres instance running on the master server. Running `netstat -plunt | grep 5432' should show you which process is bound to the `postgres' port (5432). You may need to run it within `chcontext --ctx 1 /bin/bash' to be sure to see all processes that might have it open. The thing to look for is lines like this: tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 560/perl (there will be more spaces in the actual output of the program) The process above (webmin, a perl program, with PID 560) is `listening' or `bound' to 0.0.0.0, which means `all IPv4 interfaces on the machine'. Most daemons will do this by default, thereby grabbing the port for all interfaces on the machine. In a vserver context with IP restrictions (assuming Alex/Herbert haven't changed this on me :)), when a process tries to bind to 0.0.0.0, it is transparently altered to a bind to the primary address of their vserver. This bind call fails, because another process already has it open. There are three simple solutions; 1. run the daemon (postgres) with `chbind' to restrict it from binding to anything other than the master server's IP address - done by editing the /etc/init.d/* script. 2. configure the daemon to restrict it's binding to the master server's IP address, see the manual. 3. turn off the daemon in the master server, perhaps it is not needed (Paul - I couldn't see the answer to this common `bind failed' message in the FAQ - perhaps it deserves an entry?) -- Sam Vilain, sam@xxxxxxxxxx I would have said yes to abortion if only it was right. I mean, yeah it's right. Well no it's not right that's why I said no to it. - George W. Bush, South Carolina, February 14, 2000 </pre> ----- * '''Follow-Ups''': ** '''[[msg04096.html|Re: [vserver] postgres SQL]]''' *** ''From:'' Herbert Pötzl * '''References''': ** '''[[msg04090.html|[vserver] postgres SQL]]''' *** ''From:'' Alberto Cammozzo * Prev by Date: '''[[msg04094.html|Re: [vserver] postgres SQL]]''' * Next by Date: '''[[msg04096.html|Re: [vserver] postgres SQL]]''' * Previous by thread: '''[[msg04094.html|Re: [vserver] postgres SQL]]''' * Next by thread: '''[[msg04096.html|Re: [vserver] postgres SQL]]''' * Index(es): ** [[index.html#04095|'''Date''']] ** [[threads.html#04095|'''Thread''']]
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information