From owner-freebsd-hackers@freebsd.org Wed Nov 18 07:55:59 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4450DA327A9 for ; Wed, 18 Nov 2015 07:55:59 +0000 (UTC) (envelope-from dan_partelly@rdsor.ro) Received: from mail.rdsor.ro (mail.rdsor.ro [193.231.238.10]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6831CA9 for ; Wed, 18 Nov 2015 07:55:58 +0000 (UTC) (envelope-from dan_partelly@rdsor.ro) Received: from [192.168.1.166] (unknown [86.125.33.32]) by mail.rdsor.ro (Postfix) with ESMTP id EAC371178D for ; Wed, 18 Nov 2015 09:55:56 +0200 (EET) From: Dan Partelly Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: libUCL / UCL as FreeBSD config question Message-Id: <5B598F72-C5DD-48FD-866D-F90E117D646E@rdsor.ro> Date: Wed, 18 Nov 2015 09:55:56 +0200 To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 9.1 \(3096.5\)) X-Mailer: Apple Mail (2.3096.5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2015 07:55:59 -0000 Hi all, is LibUCL able to read in memory a UCL key-value database , modify it in = various ways : 1. Add a new key-value pair 2. Modify the value of a value and serialise the modified database back to disk ? Or it is designed only a one way / read-only configuration mechanism ?=20= The reason Im asking is this:=20 if UCL becomes the new config mechanism of FreeBSD, does it brings any = other advantage=20 than an easy to read and humanly write format ? Would this = library/language be usable in=20 any other way in system configuration =E2=80=94 apart from autoexec.bat = way =E2=80=94> use command line tool to read key-vaule , filter it with some tool back to plain **text** and = feed it to a command line utility from FreeBSD base ?=20 Let=E2=80=99s say one writes a network config daemon to handle network = configuration, and expose network=20 configuration (like interface management, route management, DHCP = bindings and so on), which=20 exposes all this functionality to the rest of the system through IPC. = Now, let=E2=80=99s say , a simple client modifies the IP address of a certain interface, or host name or = whatever, and in process modifying the corresponding key-value in memory, in addition to sending the IOCTL to = change ip address for the interface=20 to the kernel. Is lib UCL able to serialise this change back to the file which backups = up the database ? If it is , all is dandy,=20 If it is not, is is this feature easy to implement in libUCL , without = being a hack, or libUCL design was read only=20 from start, thing which would make serialisation hard to implement = cleanly ?