
A safe, comprehensible and efficient PID 1/init replacement written in OCaml - pjmlp
https://github.com/rein/lyrica
======
vezzy-fnord
It's just sinit translated to OCaml. Given that it all boils down to POSIX
libc, I'm not sure what the advantage of OCaml is here.

EDIT: Appears to be a component of a larger "Prismriver" project, but still
completely tentative.

~~~
userbinator
The name Prismriver reminds me too much of
[https://en.wikipedia.org/wiki/PRISM_(surveillance_program)](https://en.wikipedia.org/wiki/PRISM_\(surveillance_program\)),
and the next thing beginning with 'P' that came to mind was Palladium, the
codename for Microsoft's Trusted Computing platform. Neither of those seem
particularly desirable to associate your project with, although what this does
have in common with them is the safety/security aspect...

~~~
scrollaway
So the letter P is out of bounds now?

~~~
wobbleblob
P is the 15th letter of the alphabet, 15 is 0xf in hexadecimal, the ascii code
of f is 102. 1 + 0 + 2 = 3 omg, Half-Life 3 confirmed!

------
jerf
How tested is this in the field? "Safe" for an init replacement is a strong
statement. The git repo statistics make this look young but I don't know what
Prismriver is.

I'm not saying this to be a jerk, I'm saying this because, well, "safe" is a
high bar for an init replacement! And I'm genuinely interested in the answer.

~~~
icebraining
It's just 59 lines of code, 20 of which are merely listing names of signals. I
won't say it's safe, but it's certainly easier to audit!

~~~
stock_toaster
Or it might be possible to generate a proof with a solver[1] of some kind.

[1]:
[http://www.chargueraud.org/softs/cfml/](http://www.chargueraud.org/softs/cfml/)

------
rdtsc
For a fun init can use Erlang!:

[https://github.com/nerves-project/erlinit](https://github.com/nerves-
project/erlinit)

Erlang/Elixir is already structured like modern OS (isolated processes,
preemptable, built in tracing, debugging, smp support). So if your project is
mostly Erlang skip the regular init and use erlinit right away.

Some example and usage from parent site:

[http://nerves-project.org/learn.html](http://nerves-project.org/learn.html)

~~~
vezzy-fnord
erlinit is not an Erlang init, rather a C program for bootstrapping a minimum
GNU/Linux userspace over which Erlang/OTP applications can run on.

------
jkxyz
How practical is it to run a simplified init program like this instead of
systemd for a desktop Linux system?

It feels like as a Linux user one has to make the choice between software
freedom (and software ethics) and an easily maintained, attractive desktop
experience. As a Fedora user, I'm very used to GNOME and all of the comforts
that it provides, but I'd consider switching to Gentoo sans systemd for the
sake of making a stand against bad practice in the software community.

~~~
lfam
How does systemd violate your freedom? It's LGPL 2.1 and, as far as I know,
respects the four freedoms:
[https://en.wikipedia.org/wiki/The_Free_Software_Definition](https://en.wikipedia.org/wiki/The_Free_Software_Definition)

~~~
nitrogen
If Emacs is an example of cathedral-style development, and Linux is an example
of bazaar-style development, then Systemd is turnpike-style development,
steamrolling ahead against all objections and the better interests of the
communities they bulldoze.

That's not a violation of the LGPL, but it is a betrayal of the community it
represents.

------
gaius
Looks good. The more alternatives to systemd the better.

~~~
zem
also the more basic unix tools written in ocaml the better.

~~~
technion
I would very much enjoy seeing a shell written in a safe language. The problem
is, just installing such a shell isn't enough - it'd have to be capable of
being copied into /bin/sh to actually make a fully safe platform.

------
nickpsecurity
The doc says it's equivalent to sinit: suckless init. That led to a git site I
don't understand cuz I don't know git. I downloaded the zip to see if readme
had anything. Here's what it says:

"sinit is a simple init. It was initially based on Rich Felker's minimal init.
Why? I wanted to get rid of Busybox init on my toy distro. How? There are 3
signals that sinit will act on.

SIGUSR1: powers off the machine. SIGINT: reboots the machine (or alternatively
via ctrl-alt-del). SIGCHLD: reap children"

So, one or more of these could use some better documentation. Or at least more
accessible for non-Git users.

EDIT to Add: I like the idea of rewriting key stuff like this in safer,
easier-to-maintain languages like Ocaml. Really nice stuff there. Past that, I
can't derive the value proposition without a page detailing what it does vs
alternatives.

~~~
edwintorok
There is also a description of what a minimal init should do here:
[http://ewontfix.com/14/](http://ewontfix.com/14/)

~~~
tyingq
Forgetting the politics of the site itself, this is a nice list of references
to init systems, from simple to complex:

[http://without-systemd.org/wiki/index.php/Init](http://without-
systemd.org/wiki/index.php/Init)

