Hacker News new | past | comments | ask | show | jobs | submit login

What is the criteria by which you classify something as "opaque"? The documentation for systemd and its utilities is second to none.



The documentation for systemd and its utilities is second to none.

God help the software industry if that is indeed the case (of course, it is not).


How so? I was able to easily use systemd and the man pages seem decent. Maybe not the best documentation, but it seems reasonable.


In order to see the quality difference, you have to compare the docs to another project that you make extensive use of.

I know that Postgresql's and Erlang's documentation is really rather good. So, go use Postgresql or Erlang for a slightly non-trivial project, then -now that you know about the topic that the docs cover- compare the quality of the systemd documentation to the documentation of either other project.

Pay special attention to the documentation provided to folks who want to understand the internals of systemd, Postgres, or Erlang. AIUI, [0] systemd's internals documentation is woefully lacking.

[0] And as has been repeated by everyone I've ever seen try to use said documentation.


True, systemd's documentation isn't very bad though, it's reasonable (lack of internal documentation is pretty common in many open source projects).


Remember that this thread was sparked by otterly's comment: [0]

> The documentation for systemd and its utilities is second to none.

What little I've seen of systemd's user/sysadmin documentation leads me to believe that it is okay. I also understand that documentation is often the least interesting part of any project, and often sorely neglected.

However. Everyone I've heard of that tests out the Systemd Cabal's claim that

"Systemd is not monolithic! Systemd is fully documented and modular, so any sufficiently skilled programmer can replace any and all parts of it with their own implementation."

by attempting to make a compatible reimplementation has failed at their task [1] and reported that the internals documentation is woefully insufficient.

When you're writing software for general consumption, good user documentation is a requirement. After all, if noone can figure out how to use your system, "noone" will use it.

When you also claim that you go out of your way to provide enough documentation to allow others to understand the relevant parts of your internals, and be able to write compatible, independent implementations of your software, the quality of the documentation about your internals is now in scope for evaluation and criticism.

[0] https://news.ycombinator.com/item?id=10485095

[1] I am very aware that this task is made harder by the fact that it is large and thankless. :)


What specifically do you find lacking in it?


Perhaps. Observed a lovely exchange a while back where a database was being publicly shamed for producing a poor unit file (i think they actually had the unit file launch a shell script that fired up the database).

Their response given was that it was the only way for them to avoid tying their database to the systemd signaling lib.

This was counted by one of the systemd devs claiming they could just use a socket that systemd provides.

But when i poked at the documentation, the only place such a "option" was mentioned was at the bottom of the man file for said lib. And it was presented as a note on the internal workings of systemd.

And you will find warning after warning about not using systemd internals, as the devs reserve the right to change the behavior of those internals at any time.


Right, you're supposed to use the published interfaces. There's nothing particularly novel about that -- neither Microsoft nor Apple will support you if you don't use their public APIs, and in fact Apple will refuse to publish your software in their app store if you don't.

With respect to socket activation, a pretty useful tutorial, published by the systemd author, can be found here: http://0pointer.de/blog/projects/socket-activated-containers...

The DBus API can be found here: http://www.freedesktop.org/wiki/Software/systemd/dbus/


> Right, you're supposed to use the published interfaces.

You missed the point. I'll isolate each component for you:

"[A] database was being publicly shamed for producing a ... unit file ... [that used] a shell script [to start] the database[.]"

"[The database devs mentioned] that it was the only way for them to avoid tying their database to the systemd signaling lib."

"[O]ne of the systemd devs [mentioned] they could just use a socket that systemd provides."

"[But this] ... 'option' ... was presented [at the bottom of the man page for the systemd signalling lib that the database authors were trying to not use] as a note on the internal workings of systemd."

"[You] will find warning after warning about not using systemd internals, as the devs reserve the right to change the behavior of those internals at any time."

So, this "option" -as documented- is something that you cannot rely on, as it is subject to change at any time, without warning.

> With respect to socket activation, a pretty useful tutorial...

Tutorials are no substitute for documentation. Documentation describes the contracts that the software commits to. Tutorials can exploit edge cases and undocumented behaviors without warning. Moreover, if the docs say that the tutorial is demonstrating a feature that's subject to change at any time, you'd have to be a madman to rely on it.

> The DBus API can be found here...

If the database devs don't want to depend on the systemd signalling lib, I bet they really don't want to depend on DBus. This might come as a surprise to some, but many servers don't run a DBus daemon.


Directly talking to the notify socket is not considered using systemd internals. It is documented as a stable, public interface:

https://wiki.freedesktop.org/www/Software/systemd/InterfaceS...

Socket activation doesn't have any systemd-based interface. You just get a file descriptor passed in the normal Unix way. The systemd library functions related to socket activation are utility functions for examining the inherited socket, but they are just wrappers for any other way you might do so.

You can configure daemons like nginx or PHP-FPM to use sockets inherited from systemd instead of their own, and it works fine. They don't have any specific support for systemd socket activation, nor do they need to. They can't even tell the difference between the systemd sockets and ones they'd get on a configuration reload.


> Directly talking to the notify socket is not considered using systemd internals.

Then -according to digi_owl's report- it sounds like the documentation for the signalling lib should be fixed.


The closest I could find in the docs to what digi_owl said is the following:

> Internally, these functions send a single datagram with the state string as payload to the AF_UNIX socket referenced in the $NOTIFY_SOCKET environment variable. If the first character of $NOTIFY_SOCKET is "@", the string is understood as Linux abstract namespace socket. The datagram is accompanied by the process credentials of the sending service, using SCM_CREDENTIALS.

I can see how someone would be reluctant to rely on that, even given the interface promise and the nudging of the systemd developers. To be more consistent with what's a stable, public interface and the admonition to avoid internals, I would probably drop the word "internally."

Indeed, I've created a pull request: https://github.com/systemd/systemd/pull/1759


Props for fixing the documentation. :D

However, even with your change, I still read that section as describing implementation detail that's not guaranteed to be stable. If that note describes a stable, documented protocol, a link back to the documentation of that protocol would be helpful and reassuring.


For those who want context and specifics: The whole argument from some of the people who didn't want to rely upon something that is explicitly described as "internal" is set out at length in places like https://news.ycombinator.com/item?id=7809174 .


> The documentation for systemd and its utilities is second to none.

  $ man none
  No manual entry for none
Sounds about right.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: