diamond fails to run at boot with "Name or service not known"
Opened this issue · 2 comments
paulraines68 commented
On CentOS7 using diamond-4.0.515 with the included systemd service file, diamond always fails to run at boot but starts fine by a hand later.
The error in the log is:
[2020-10-23 16:07:50,198] [MainThread] Unhandled exception: [Errno -2] Name or service not known
[2020-10-23 16:07:50,199] [MainThread] traceback: Traceback (most recent call last):
File "/usr/local/diamond/bin/diamond", line 298, in main
server.run()
File "/usr/local/diamond/lib/python2.7/site-packages/diamond/server.py", line 108, in run
self.handlers = load_handlers(self.config, handlers)
File "/usr/local/diamond/lib/python2.7/site-packages/diamond/utils/classes.py", line 89, in load_handlers
h = cls(handler_config)
File "/usr/local/diamond/lib/python2.7/site-packages/diamond/handler/stats_d.py", line 66, in __init__
self._connect()
File "/usr/local/diamond/lib/python2.7/site-packages/diamond/handler/stats_d.py", line 161, in _connect
port=self.port
File "/usr/lib/python2.7/site-packages/statsd/client.py", line 139, in __init__
host, port, fam, socket.SOCK_DGRAM)[0]
gaierror: [Errno -2] Name or service not known
I tried adding the following to [Unit] in /etc/systemd/system/diamond.service but it made no difference
After=network.target
I then changed that to the following and it did work:
After=network.target remote-fs.target nss-lookup.target
shortdudey123 commented
Interesting ... Can you submit a PR?
paulraines68 commented
Sorry, I don't know how to do a pull request