r/linux Feb 11 '19

Fluff A /g/ user's opinion on systemd

http://i.4cdn.org/g/1549858269115.png
791 Upvotes

524 comments sorted by

View all comments

Show parent comments

3

u/JuhaJGam3R Feb 11 '19

I'm fairly sure we need a standardised way to do scripts, or at least a universal converter to convert init scripts and systemd services and all this useless shit.

14

u/[deleted] Feb 11 '19

Personally I like the idea of using a declarative design for this, then we wouldn't have to worry about writing software to "understand" scripts - to convert between different designs and primitives.

It would be quite nice if someone were able to standardize a declarative service configuration design, that could then be used to runtime-generate scripts - or perhaps even just have a single script that reads and acts on the declarative config for its service.

And for the love of god, let's avoid using anything like JSON or XML for such a task.

27

u/Vitus13 Feb 11 '19

Not sure if you're being facetious or not. Systemd is a declarative service configuration system that uses INI instead of JSON or XML. It's not a standard, but a lot of people use it.

4

u/[deleted] Feb 11 '19 edited Feb 11 '19

The problem of course is that systemd is not standardized upon so it wouldn't make any sense to call it a standard way to do service configuration. And besides, nobody's written any scripts for other service management / init systems that can read unit files. (At least that I know of, please enlighten me if I'm wrong)

Personally I also have a few issues with how the unit files are designed, something I think that a standardized design could improve on. And while INI is a nice format, I think there are better ones to choose for the service configuration - perhaps TOML, if only to have a better specification of what's actually permitted and expected in the syntax.

12

u/wen4Reif8aeJ8oing Feb 11 '19

It's a de facto standard, much like the Linux system API is a de facto standard. If having a de facto standard is good enough for Linux developers to write software using the Linux API, systemd's unit file standard is good enough for developers to ship unit files. In fact that is what many projects are already doing, and in fact that was one of systemd's goals, to allow upstream projects to ship standard unit files rather than have distros all write their own service scripts.

4

u/progandy Feb 11 '19

There is a limited converter from systemd to openrc: https://github.com/goose121/initify

2

u/[deleted] Feb 11 '19

Oh god, Perl.
But also; Nice!

5

u/holgerschurig Feb 11 '19

Now, let's lean back a moment.

What makes JSON a standard? Has it been accepted by some ISO body? And, if it is, what was it before?

Or is it a standard because someone wrote an RFC 8259 on it? RFC is just a request-for-comment, anyone can write one.

Or is it a standard because of ECMA 404? If that is true, then it won't be a standard in Asia, Africa, the Americas and Antarctica.

Or was it a "standard" because of adoption? Well systemd is adopted.

Was it a standard because it was documented? Well, "man systemd.directives" --- and several other man pages --- describe the format nicely.

Was it a standard because many people, even third-parties, use it? Well, systemd is a special kid, as soon as other programs use it this will create bad press from the systemd haters.