Send kea-dev mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/kea-dev
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of kea-dev digest..."
Today's Topics:
1. Re: Check kea configuration (Stephen Morris)
2. Re: Check kea configuration (Chaigneau, Nicolas)
3. Check that Kea has successfully started ? (Chaigneau, Nicolas)
----------------------------------------------------------------------
Message: 1
Date: Thu, 19 Mar 2015 12:12:27 +0000
From: Stephen Morris <[email protected]>
To: [email protected]
Subject: Re: [kea-dev] Check kea configuration
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
On 19/03/15 08:43, Chaigneau, Nicolas wrote:
> I think of this because, from my experience, it is very easy to
> botch the configuration. (For instance, a comma not removed at the
> end of a list. I'm doing this quite often.)
Checking the grammar of the file requires the modification to Kea. To
catch syntax errors (such as a missing comma), a simple Python script
will help. Something like:
#!/usr/bin/python
import sys
import json
try:
f = open(sys.argv[1])
data = f.read()
try:
json.loads(data)
print("Syntax OK")
except:
print("Data was not valid JSON")
except:
print("Unable to access file " + sys.argv[1])
(Many thanks to StackOverflow for the suggestion.) Admittedly it
doesn't tell you where the problem is, but it will tell you if there
is a syntax error.
Stephen
------------------------------
Message: 2
Date: Thu, 19 Mar 2015 14:33:14 +0000
From: "Chaigneau, Nicolas" <[email protected]>
To: Stephen Morris <[email protected]>, "[email protected]"
<[email protected]>
Subject: Re: [kea-dev] Check kea configuration
Message-ID:
<ab94b0b675bdf14189cd5a861db36c8419507...@de-cm-mbx26.corp.capgemini.com>
Content-Type: text/plain; charset="iso-8859-1"
Thanks for the suggestion.
Although I believe what Kea use is not strictly JSON: comments are supported.
I don't know if the python json parser allows this. I tried that in perl
previously, and had to strip the comments out before calling the parser.
That said, I think also that Kea's parser could be made more lenient.
For example, we could allow one extra comma at the end of a list or an array.
Languages with JSON-like structures, like C and perl, allow this.
I think even Javascript does. (according to:
http://www.freeformatter.com/json-validator.html)
-----Message d'origine-----
De?: [email protected] [mailto:[email protected]] De la
part de Stephen Morris
Envoy??: jeudi 19 mars 2015 13:12
??: [email protected]
Objet?: Re: [kea-dev] Check kea configuration
On 19/03/15 08:43, Chaigneau, Nicolas wrote:
> I think of this because, from my experience, it is very easy to botch
> the configuration. (For instance, a comma not removed at the end of a
> list. I'm doing this quite often.)
Checking the grammar of the file requires the modification to Kea. To catch
syntax errors (such as a missing comma), a simple Python script will help.
Something like:
#!/usr/bin/python
import sys
import json
try:
f = open(sys.argv[1])
data = f.read()
try:
json.loads(data)
print("Syntax OK")
except:
print("Data was not valid JSON")
except:
print("Unable to access file " + sys.argv[1])
(Many thanks to StackOverflow for the suggestion.) Admittedly it doesn't tell
you where the problem is, but it will tell you if there is a syntax error.
Stephen
_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message or
any part thereof. If you receive this message in error, please notify the
sender immediately and delete all copies of this message.
------------------------------
Message: 3
Date: Thu, 19 Mar 2015 16:19:31 +0000
From: "Chaigneau, Nicolas" <[email protected]>
To: "[email protected]" <[email protected]>
Subject: [kea-dev] Check that Kea has successfully started ?
Message-ID:
<ab94b0b675bdf14189cd5a861db36c8419507...@de-cm-mbx26.corp.capgemini.com>
Content-Type: text/plain; charset="iso-8859-1"
How can a script in charge of starting Kea know that the server has
successfully started??
- Checking that the process is running (ps...):
Not good enough, because the startup phase can take some time (especially when
dealing with large lease files that need to be loaded).
If Kea fails to complete its initialization and exits, and the check has been
done before that, then the script will not know that a problem has occurred.
- Parse the logs and wait until there is a newly added message signaling the
success, for instance such as:
"DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration"
(or the new message that will be logged when http://kea.isc.org/ticket/3755 is
done)
This would work, but it looks somewhat hackish...
Do you see a better way to achieve this ?
Initially I was looking for where Kea writes its PID file. Then I realized
there was no such file.
Why not ?
That would be a better way to check the process status: if it runs, and has
written his PID file (and its content matches the actual process PID), then it
would mean that the startup/configuration phase was successful.
Regards,
Nicolas.
This message contains information that may be privileged or confidential and is
the property of the Capgemini Group. It is intended only for the person to whom
it is addressed. If you are not the intended recipient, you are not authorized
to read, print, retain, copy, disseminate, distribute, or use this message or
any part thereof. If you receive this message in error, please notify the
sender immediately and delete all copies of this message.
------------------------------
_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev
End of kea-dev Digest, Vol 12, Issue 6
**************************************