Systemd/systemd – shared: add minimal JSON tokenizer
cgit.freedesktop.org
cgit.freedesktop.org
It's not actually used in pid 1, but in the userspace tooling.
I would however prefer if it used a lenient superset (allowing comments and trailing commas in lists, maybe also unquoted keys). Something like JSON5 ( http://json5.org/ ). The requirements for config files and for a wire-format are different (easily human-writable vs. strict standard).
Also, this is really, really something that would be better placed in a library. (If you don't want to avoid dynamic dependencies, then make it a source library or link staticly.)
Anyone know any other config file targeted formats? I'm not keen on YAML for config. There's libconfig (and assoc. format), but, imho, it's a bit complex
Why am I not surprised?
I give up.
The Only True Unix way is to invent an ad hoc configuration format with arbitrary rules about line breaks, tabulators and separator characters, incomplete Unicode support and confusing issues around whitespace escaping.
a) separating configuration values from code
b) embedding an established interpreter
Of course being written in C, this implementation isn't likely to be able to handle arbitrary-precision numbers, but then neither do jansson nor json-c AFAIK.
Could you please tell me few reasons against code reuse?
And as a bonus; a reasonable case for reimplementing everything in systemd ecosystem would be very appreciated.
> And as a bonus; a reasonable case for reimplementing everything in systemd ecosystem would be very appreciated.
Oh, fuck off.
EDIT: What I meant to say in that last sentence is: I realize that I could have been more upfront about what the tradeoffs are, but if you're just going to spew bullshit like "NIH!" over and over without anything to back it up, then I don't care to engage in a serious discussion with you. Indeed, I think it might not be possible to engage in a serious disccusion with you. Hence, "fuck off".
We may look into big c/c++ projects like Firefox, blender, chrome and many others and we can see that dependencies are really managable and maintable.
But yet again you may argue that using reimplementation of a json parser in a code base is simpler. It's personal choice and I belive it is not a good engineering practice.
Still there is no good case for imlementation of any subsytem of linux in systemd.
From the readme: glibc >= 2.14 libcap libmount >= 2.20 (from util-linux) libseccomp >= 1.0.0 (optional) libblkid >= 2.24 (from util-linux) (optional) libkmod >= 15 (optional) PAM >= 1.1.2 (optional) libcryptsetup (optional) libaudit (optional) libacl (optional) libselinux (optional) liblzma (optional) liblz4 >= 119 (optional) libgcrypt (optional) libqrencode (optional) libmicrohttpd (optional) libpython (optional) libidn (optional) gobject-introspection > 1.40.0 (optional) elfutils >= 158 (optional) make, gcc, and similar tools During runtime, you need the following additional dependencies:
util-linux >= v2.25 required
dbus >= 1.4.0 (strictly speaking optional, but recommended)
dracut (optional)
PolicyKit (optional)
When building from git, you need the following additional
dependencies:
docbook-xsl
xsltproc
automake
autoconf
libtool
intltool
gperf
gtkdocize (optional)
python (optional)
python-lxml (optional, but required to build the indices)
sphinx (optional)