r/vibecoding • • 5d ago

Showcase/Project Gemini 4 Neon created a pure Rust, Linux init system that is 99% faster than systemd

Gemini 4 Neon built a Linux PID 1 init system in pure Rust with no dependencies, compiled into a single 209 KiB static binary. It boots 50 services in ~3 milliseconds (~60x faster than systemd) using ~420 KiB of PID 1 RAM and I'm using it as my default init system on my Void Linux desktop. (getty at 31 milliseconds and lightdm at 60 milliseconds after PID 1 starts).

How it works: One binary with no libc handles PID 1, graninitctl, and poweroff/reboot using raw Linux syscalls and a single epoll loop. Early boot tasks like fstab, sysctl, hostname, and loopback run directly inside PID 1 with zero shell forks, and desktop services aren't stuck waiting on udevadm settle to finish. To start services fast without fork() copy-on-write overhead or vfork() serialization, it launches up to 32 processes concurrently across CPU cores using clone(CLONE_VM | CLONE_CHILD_CLEARTID | SIGCHLD) plus futex on a temporary mmap stack pool that gets unmapped right after boot. From there it seals its heap (zero runtime allocations) and handles supervision, crash-loop backoff, and timestamped log rotation out of fixed buffers.

Built in Antigravity and verified with 215 C-header ABI checks, unit/kernel selftests, and 13 namespace PID 1 integration tests before switching my GRUB default: get it here!

EDIT: it currently doesn’t work well with other distros besides Void, I will be trying to get it working on other distros in due time.

EDIT 2: It should be working with other Distros besides Void and now I'm going to try to work on getting it to be an actual viable replacement for other init systems.

310 Upvotes

66 comments sorted by

32

u/666AB 5d ago • Bravo

I checked this out and found a couple bugs already. I wouldn’t run this on any machine. Maybe I’ll make a PR bc I think it’s cool but idk.

This should say ‘void Linux specific’. Because it is void Linux specific for various reasons I saw on first scan.

  1. No services it starts can trigger an OOM (which is a valid thing to do sometimes ya know)
  2. kexec - so first it doesn't check that a kexec kernel is loaded. If the reboot call fails, PID 1 exits. (Panic) … also, “install.sh --replace-init” points /sbin/kexec at graninit. That overwrites the real kexec tool, which is what loads the kernel in the first place.

edit: this is just what I saw at first pass. Still cool, but not ready for anyone to run imo.

2

u/eggyegged 5d ago

Thanks for the feedback, I have edited the post and I will be trying to get it working for other distros sometime soon.

-3

u/AllNamesAreTaken92 22h ago

Please don't, you are neither qualified nor capable.

3

u/dedydamy 9h ago

do you need a hug?

5

u/Living_Mode_6623 5d ago

I already have my robochooms porting to fedora ...

49

u/Asalakabim 5d ago

Are you going to tell what 60x faster actually means here or do i need fable to point out how bullshit this comparison is?

21

u/eggyegged 5d ago

60x is specifically PID 1 overhead + service spawning, not total power-button-to-desktop time.

2

u/OrganizationAgile361 4d ago

is it systemd or dinit compatible? how are defined the services?

2

u/michaelbolton67 1d ago

So 2 seconds?

7

u/A_modicum_of_cheese 5d ago

1/60th of the features

6

u/AoE3_Nightcell 5d ago

It probably means that it makes your machine boot a couple seconds faster

1

u/Purple-Midnight-9902 3d ago

3 msx60 is not much tbh. Unless you boot every hour. Depends features set ...

1

u/AoE3_Nightcell 3d ago

Yeah im just trying to articulate the impact, not say it’s a big deal.

1

u/lazyfai 3d ago

In fact I seldom reboot... So that few seconds happens a few times per month.

0

u/AllNamesAreTaken92 22h ago

Why do you, the person with the least amount of relevant information, aka nothing, feel the most driven to share their (unformed) opinion? What are your motivations in life?

0

u/AoE3_Nightcell 20h ago

What makes me the person with the least amount of knowledge about how long init takes to run? Fuck off

-2

u/[deleted] 5d ago edited 5d ago

[removed] — view removed comment

0

u/woswoissdenniii 5d ago

As a rude person myself. Apologize for this. Bit unnecessary.

0

u/vibecoding-ModTeam 5d ago

There’s not enough time in life to deal with assholes. Try your best not to be one.

9

u/PerfectReflection155 5d ago

What benifits besides speed.

Like can I replace my current systemd or whatever on my production docker servers. Each running approx 60 containers. 1 of them also running persistent agents regulsrly and cronjobs.

2

u/eggyegged 5d ago

Besides speed, the main benefits are simplicity and fixed footprint: a single 238 KiB static binary with no libc or dependencies (~330–464 KiB PID 1 RAM, zero heap allocations after boot, 0.000 ms/s idle CPU), built-in crash-loop backoff, strict typo-checked configs, NOTIFY_SOCKET readiness, live daemon-reload, and per-service rotating timestamped logs without separate supervisor trees like s6/runit. But it is v0.1.0 and doesn't do systemd LISTEN_FDS socket activation (so dockerd uses unix:///var/run/docker.sock instead of fd://) or journald structured logs. It's solid if you want a super-lean supervisor on a Void/Alpine Docker host or test server, though on mission-critical Debian/RHEL prod boxes systemd's distro integration is still hard to beat for the risk.

2

u/Living_Mode_6623 5d ago

Going to check it out choom, got my agent installing it to my disposable bench VM to give it a spin.

2

u/eggyegged 5d ago

Thanks! I would love to hear your feedback

1

u/Living_Mode_6623 5d ago

I'll make sure to post up full details.. but I let my robochooms setup and profile it on void and they are now working on a fedora port (as that's what I use mostly.)

20

u/jyrox 5d ago

Isn’t systemd much more than just a simple init system? I thought it was responsible for a ton of other stuff while the system is running.

14

u/clockwork2011 5d ago

Some people should ask their AI about init scripts and how there's a whole "cult" around them. Non-systemd purists have been a thing for as long as systemd has been a thing for.

7

u/ThadCastleGOAT 5d ago

Take me back to the mid 2010s when the simplicity purists had their entire init in 100 lines of shell scripts, we had no window manager, relied on rawdogging X with wmutils and our status bars were fifo pipes with some color. 

3

u/clockwork2011 4d ago

How fast your computer boots was a badge of honor back then. It’s really funny to me that the normie vibers are reliving the same patterns now.

1

u/Excellent-Copy-2688 5h ago

I have no status bar, don't need one

76

u/GourryHacks 5d ago

This is the beginning guys.

I rewrote kvm as a type-1 hypervisor on a single architecture in 10kb.

Everyone here saying "ok now maintain it" isn't asking themselves what "maintain" means when you can vibe a new driver in an afternoon.

17

u/Zelderian 4d ago

I hate the “who’s gonna maintain it” argument for small projects. Like, I made this in an hour from scratch. Absolute worst case scenario, I’ll sacrifice another hour and remake it. Maintenance on small, curated tools is effectively nothing when you can change anything you want with a couple sentences.

4

u/inebriatus 2d ago

One of my coworkers was asking questions in our team slack about JavaScript build tooling. We have some code that requires webpack and some new repositories that are on vite. He was wondering if anyone would be against moving everything to webpack for consistency and I couldn’t care less. We can change it so easily and it’s the kind of thing I think we just never need to worry about again. A prompt to convert it all to webpack, a prompt to go back to vite once we update our legacy code. It’s just the kind of question that’s not really interesting to me any more in the new world we’re living in.

1

u/jesjimher 1h ago

What usually happens is that you can rewrite anything with just a few prompts, sure, it seems to work and everything seems fine and dandy. Then, a few days later, you find some weird case where it doesn't work. No problem, can be fixed... And then you find another, and another... Even those who had supposedly been fixed appear again. Eventually you get tired on this whack a mole game, and start from scratch, or just go back to the original, mostly human written software.

I will change my mind when this kind of posts aren't "look at that fancy tool I rewrote this weekend and is faster and better", but "I've been using my rewritten AI tool for 6 months, and everything works fine".

22

u/DangKilla 5d ago

It’s not enterprise solution; a hobby project, sure

2

u/greendookie69 6h ago

I am an idiot with poor reading comprehension and replied to you before, thinking you were the OP. Sorry

11

u/Mandelvolt 5d ago

So, does this make systemd more bloated or less bloated?

5

u/ThePapanoob 4d ago

99% faster since you have no idea what a fully featured initsystem is doing and youre comparing it to one wich just doesnt do that.

4

u/TrashConvo 5d ago edited 4d ago

Cool. Now migrate, use, and support it

5

u/Useful_Judgment320 5d ago

My guy it's deployed to localhost:8484

4

u/TheFuzzball 5d ago

We used to initialise systems with sprawling shell scripts written by hand with no error handling. I'm sure an LLM can reproduce that in C and get fast boot times. 

That's not a replacement for systemd, though. 

3

u/pilkyton 4d ago edited 4d ago

And Systemd is exceptionally well-written C code which handles everything a modern Linux system needs for reliable operation. This is why every single distro in the world except one or two nerd distros are using it.

  • Finally made init robust on Linux. Replaces fragile init scripts (hacky subshells, fragile and outdated boilerplate code, basic "sleep" commands for timing, constantly calling external executables like cat/grep/wget whose versions and bugs differ on all distros, piping things between their executables, using PID files, etc).
  • Thanks to Systemd, all our services now launch via native (well-written) C code instead, which starts all services very quickly, in parallel, on-demand, in the correct order, when required resources are ready (devices, networks, etc), without any bugs (double-starts, race conditions, false starts, etc). With reliable, unified logging. It also uses cgroups and namespaces to securely isolate the scope of services, to limit the harm if a service is hacked.
  • It also finally allows users to effortlessly create their own services/on-demand sockets with just a few lines of easy text.
  • Arch's primary init maintainer described the incredible freedom of finally switching to Systemd 11 years ago: https://www.reddit.com/r/archlinux/comments/4lzxs3/comment/d3rhxlc/
  • NixOS core developer simply says "there's nothing better out there" (true): https://www.reddit.com/r/archlinux/comments/4lzxs3/comment/d3rlwap/
  • It keeps growing because the most efficient way to implement various core system extras is to add them to systemd, which is a kind of supervisor for the whole system now. That's a good thing. It means more stability, more integration, more security.

1

u/Purple-Midnight-9902 3d ago

The fun part is to see how hostile the community has been against the code and even against the people

Maybe this helped Linux to lose Poettering...

But some others Linux fans are great people. Just a good memory not to hear too much the ones who yell with hate

1

u/pilkyton 3d ago edited 3d ago

Yeah, it's very sad that we lost Poettering. Well, basically, if you try to get between an autistic Linux user and their 1970s/1980s code, then prepare to get a lot of flames. To them, what matters is how old something is, not how well-engineered it is. :D Shell scripts are therefore the epitome, since they are old and cozy and familiar; not new and scary.

1

u/OrganizationAgile361 5d ago

Can you port it to Artix linux? 

1

u/eggyegged 4d ago

Yes, I will be doing that soon

3

u/theonetruelippy 5d ago

the majority of the boot time on my kernels is stuff like initialising the wifi adapter (fw load), I don't think the actual OS is necessarily the bottleneck - but I will instrument it for enquiring minds.

3

u/Single_Ring4886 3d ago

Do not let people discourage you!
THE IMPORTANT PART IS that you keep working on this not forget it in few days or even weeks. If you focus on this with help of multiple ai systems and make it opensource and focus for few months it can be real production stuff.

2

u/clockwork2011 5d ago

init scripts have been a thing for a long time. Even ones written in rust. Not to take away from what your AI did here, but none of this is a new concept or idea.

2

u/xeroxedforsomereason 5d ago

3 commits and you're rifling it out on here? very bold.

1

u/Unusual-Pea7202 4d ago

the 209kb binary is impressive, but I'm more curious about how it handles service dependencies without a full init system, did it just use a flat exec order?

1

u/Zellione 4d ago

Now you just need to implement all the 1000 systemd edge cases they implemented over the years.

1

u/Total-Reasonable 4d ago

How does it handle service dependencies and readiness when launching 32 processes at once, e.g. something needing the network or dbus up first?

1

u/Professional-Bid6658 4d ago

That edit is doing a lot of work. Void-only means this isn't a systemd replacement for anyone else yet.

1

u/AcoustixAudio 3d ago

Why not just contribute the changes to systemd? Without some sort of benchmark 60x means nothing. Since this is the vibe coding sub I believe you, because the first thing people vibe code is a systemd replacement, but a benchmark is sure in order

1

u/FlamboyantKoala 3d ago

Love to see it. I'm not currently hacking around on a linux computer so I can't make use of it but things like this are the initial seed to faster and better systems.

1

u/SylviaJarvis 3d ago

Embedded systems have had monolithic C programs for init since before Linux.

If the hardware and applications on the system never change, then you don't need or want an extensible framework like systemd or sysvinit. Frameworks burn time and memory, and getting rid of any part of the framework makes system startup faster.

Instead, you write out the raw system calls in a single program, compile that program, and run the compiled binary init at boot. If you install some new service, you edit and recompile init. Common services like networking are supported by libraries instead of shelling out to helper utilities. If you have a massively complicated setup, you have a compile-time dependency solver that generates the code. Nothing in boot order is determined at run time.

The real innovation here was using Rust.

1

u/fhcoso 3d ago

If you want a real init alternative, you need to take a look at SMF. It's used by Solaris/OpenSolaris and Illumos distributions, and I miss it on FreeBSD and Linux.

1

u/eightrx 1d ago

How well does it work compared to runit? Are there any benefits from your initial system besides speed?

1

u/still_Horiz3n 1d ago

I built from 405bytes of hex0 to a self hosting c compiler that compiles to stage 3 fixed point for windows mac and linux

1

u/nhermosilla14 14h ago

Nice demo, although I wouldn't call this really valuable in and of itself. There are some things were a more strict reviewing process is required IMHO, and both the kernel and init are part of those.

1

u/-useEffect- 7h ago

what a joke

1

u/Tizen20 4h ago

Seems interesting. I hope this project gets maintained and stays supported in the future.

1

u/mccydoutxl 5d ago

This is lowk insane (flipping amazing) i’ve tested it and its outcome was phenomenal🎉🎉🎉🥜

1

u/Serasul 5d ago

i dont believe you, that is physical not possible