Hi David, I remember the email where you already mentioned this. I didn't read closely enough though.
I thought the error came from some mirror hostname. In fact, it is the machine name itself (of the
MirrorBrain host) that the script tries to resolve.
The lookup is done to have a hostname/domain to append to mailed logs; the feature of mailing logs
isn't actually used anymore, but the code is still there.
On my test host, the hostname "ubuntu" resolves to 127.0.0.1:
# python -c "import socket; h = socket.gethostname(); print h; print socket.gethostbyaddr(h)"
ubuntu
('ubuntu', [], ['127.0.1.1'])
The code is obviously naively running on assumptions that can't be met everywhere.
Development plans for the mirrorprobe are:
* integrate it into the "mb" tool, so there isn't the need to have a second script, and it can use
shared functionality from the "mb" Python module
* clean up its error reporting in general - it is a big neglected because it relied on the mail
functionality in the past, and was run with &>/dev/null, which didn't turn out to be a good idea (rare
errors could easily get lost)
Therefore, I'd think the code should be removed, and make place for a better notification mechanism. A
future notification system should be integrated with a web frontend, and allow for mail notification
at the same time, for important things.
I'll commit a fix in SVN, but as it will take a while until that ends up in the Ubuntu packages, I'd
recommend a workaround for now. Maybe you can adjust /etc/hostname and /etc/hosts in a way that it
avoids the crash - or comment out the code as you did.
This works here:
root@ubuntu:~# cat /etc/hostname
ubuntu
root@ubuntu:~# grep ubuntu /etc/hosts
127.0.1.1 ubuntu
root@ubuntu:~# python -c "import socket; socket.gethostbyaddr(socket.gethostname())[0]"
root@ubuntu:~#
(Returns empty value, but doesn't crash at least)
|