[Mailman-Users] socket.gethostname()

John Poltorak jp at warpix.org
Thu Nov 6 23:43:01 CET 2003

On Thu, Nov 06, 2003 at 05:59:28PM +0000, Richard Barrett wrote:

> >>>>> import socket
> >>>>> socket.gethostname()
> >> 'mailman2'
> >
> > Where does value originate and should it match anything within 
> > Mailman's
> > configuration?
> >
> It originates within the system kernel. Read the man page for hostname. 
> Like hostname, socket.gethostname() is calling a system C library 
> function to get the information, which is quite independent of Mailman.

I suppose I need to run it independently of Apache to see what is really 
going on.

> > Is there any way to dump the value of  self.__tmpfname to the logfile 
> > from
> > the lines above ?
> >
> No because you would not running Mailman, just the Python interpreter 
> from the command line.
> > This is what currently appears in the error log:-
> >
> >
> > admin(648):   File "../Mailman/MailList.py", line 817, in __save
> > admin(648):     fname_tmp = fname + '.tmp.%s.%d' % 
> > (socket.gethostname(), os.getpid())
> > admin(648): error: (14, 'Bad address')
> >
> >
> This is a system error code, EFAULT, which means "Bad address", 
> whatever that means. It is certainly abnormal and I suspect not a 
> problem in MM per se. It could indicate an incipient memory problem or 
> corrupt libraries or kernel or ...

I'm actually trying to get a ported version running. I'm not using Unix.
> After discussion with a colleague we decided we couldn't identify any 
> simple, obvious cause or course of action to take but it sounded like 
> something was broken in the system.
> Is this a persistent or occasional problem?

I'm just trying to get it set up, that's all.
> My first instincts are to reboot the system, maybe run a few 
> diagnostics on memory and disk, and a full fsck and see if that clears 
> it. With my knowledge of things this is SWAG territory.
> > I'm assuming that socket.gethostname() is the culprit.
> >
> If you called socket.gethostname() from the Python command line as I 
> suggested  in my previous message and got a sensible result, you are 
> probably wrong in this assumption.

It works fine from a Python command line, but I can't be sure the 
environment in which Apache is running is exactly the same.

When I remove socket.gethostname() from the above line it works, so I'm 
quite it is the culprit.

What I need is to discover the values which are being retrieved by 
LockFile.py. Not being a Python expert stops me from outputting the 
variables to a file or to the screen.... 

> -----------------------------------------------------------------------
> Richard Barrett                               http://www.openinfo.co.uk


More information about the Mailman-Users mailing list