Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Systemd as the init system in Nitrux #33

Closed
UriHerrera opened this issue Jul 2, 2019 · 16 comments
Closed

Replace Systemd as the init system in Nitrux #33

UriHerrera opened this issue Jul 2, 2019 · 16 comments
Labels
feature-request Issues to discuss future features to be added to this software.

Comments

@UriHerrera
Copy link
Member

UriHerrera commented Jul 2, 2019

Nitrux currently uses Systemd as the init system (that we inherited from Ubuntu, not as a choice by us). We prefer to follow the Unix way of doing things, "do one thing and do it well."

znx, for example, doesn't attempt to do more than what it was designed to do. Our focus on AppImages also indicates that we prefer to have to manage one file (the AppImage file) instead of a multitude of packages. Nitrux itself is deployed as one file by znx. The operating systems that VMetal runs are also contained as a single file.

Systemd is more than an init system that doesn't follow that way. See Wikipedia:File:Systemd components.svg.

systemd, is a software suite, full replacement for init in Linux that includes an init daemon[...]

With that said, we should considerate simplifying our distribution by using a more straightforward init system.

The following are the options:

  • s6-init, s6-Linux-init is a set of minimalistic tools used to create an s6-based init system, including a /sbin/init binary, on a Linux kernel.
  • SysVinit, The traditional Linux SysV clone.
  • runit, a full cross-platform replacement for init with parallel starting of services.
  • OpenRC, a process spawner that utilizes system-provided init, while providing process isolation, parallelized startup, and service dependency.
  • busybox-init, suited for embedded operating systems.
@UriHerrera UriHerrera added the feature-request Issues to discuss future features to be added to this software. label Jul 2, 2019
@UriHerrera
Copy link
Member Author

I have managed to create a working image (no GUI) without SystemD. It's using SysVinit, but it's a start.

VirtualBox_Nitrux_02_07_2019_09_14_17

@UriHerrera UriHerrera changed the title Consider other init systems Consider using other init systemsand replace SystemD Jul 6, 2019
@UriHerrera UriHerrera changed the title Consider using other init systemsand replace SystemD Consider using other init systems to replace SystemD Jul 6, 2019
@UriHerrera UriHerrera pinned this issue Jul 10, 2019
@UriHerrera
Copy link
Member Author

UriHerrera commented Sep 24, 2019

Using SysV

I have modified a deployed development image. Once again, it's using SysV, but the news here is that there's a GUI now and that everything is precisely the same except for the init system.

Things that work:

  • Boots (starts Plymouth and SDDM).
  • X11 starts (tested with vboxvideo i915 and amdgpu).
  • Network (ping works DNS resolves; the network driver is used).
  • Persistence.

Things that don't work:

Things that show issues :

  • Keyboard and mouse don't work after logging in (for some weird reason, unplugging and plugin back the peripherals makes them work).

Screenshots

VirtualBox_Nitrux_24_09_2019_13_45_01

Test build using SysV init running on VirtualBox.

What's next

SysV is exceptional in that it works, but it's not the best out there. Next things are to try to implement other, newer init systems.

@anupam-git
Copy link
Member

anupam-git commented Sep 24, 2019

Finally after so many days of debugging loads of logs, you've succeded.. 💯

@UriHerrera
Copy link
Member Author

UriHerrera commented Sep 26, 2019

Using OpenRC

I have created another build based on the development branch; this build utilizes OpenRC. Unlike the previous build, there's no GUI, and there's no network.

Things that work:

  • Boots (no Plymouth though; SDDM doesn't start automatically).
  • Persistence.

Things that don't work:

  • X11 (after starting SDDM with rc-service sddm start X11 freezes).
  • Network (ping fails; there's no DNS).

Screenshots

VirtualBox_Nitrux_25_09_2019_23_49_09

Test build using OpenRC running on VirtualBox.

What's next

Unfortunately, OpenRC didn't work as great, it might be possible that I'm missing some kind of configuration. I'll try with other init system in the meantime.

@UriHerrera UriHerrera changed the title Consider using other init systems to replace SystemD Consider using other init systems to replace Systemd Sep 26, 2019
@UriHerrera UriHerrera changed the title Consider using other init systems to replace Systemd Replace Systemd as the init system in Nitrux Sep 26, 2019
@UriHerrera
Copy link
Member Author

UriHerrera commented Sep 28, 2019

Using runit as init and runit with SysV compatibility

I have created another build based on the development branch; this build utilizes runit. The system boots in both cases, using runit as /sbin/init and as an extension of SysV. The main problem is that it seems that not all services are started.

Things that work:

  • Boots (no Plymouth though; SDDM doesn't start automatically).

Things that don't work:

  • Plymouth (doesn't work at all)
  • Persistence (?; I can't really test this).
  • X11 (SDDM starts but X11 freezes immediately).
  • Network (?).

Screenshots

No screenshots. It boots directly to the graphical session but X11 freezes and results in a black screen.

What's next

Try to make one of these three init systems work.

@lslvr
Copy link
Member

lslvr commented Sep 28, 2019

How performant is SysV? As it's the one that works, perhaps we should focus on polishing that one. 🙂

@UriHerrera
Copy link
Member Author

UriHerrera commented Sep 29, 2019

How performant is SysV? As it's the one that works, perhaps we should focus on polishing that one.

I measured the boot time from after selecting the deployed system on the znx boot menu and pressing enter until the welcome wizard shows up.

Current Development ISO with systemd: 00:46.67
Test build ISO with SysV: 00:48.56

The difference is nominal, so we'd have to see how to optimize it, in both cases truly, it's taking more than 30 seconds, and that shouldn't be acceptable.

My only real concern is that SysV is old (in the same context of X11; it works, but it's old). I had some sprawling success with OpenRC at one point but I couldn't this time.

@lslvr
Copy link
Member

lslvr commented Sep 29, 2019

The same boot time for both SysV and systemd? That is weird.

@anupam-git
Copy link
Member

Which are the ones with huge bootup time as shown in systemd-analyze blame ?

@lslvr
Copy link
Member

lslvr commented Sep 29, 2019

systemd was "supposed" to reduce boot times. 🤷‍♂️

@UriHerrera
Copy link
Member Author

VirtualBox_Nitrux_30_09_2019_02_00_20

@UriHerrera
Copy link
Member Author

UriHerrera commented Nov 2, 2019

As per my findings in #41, the boot time is now on the test build ISO without systemd and using SysV in VirtualBox of 00:21:54 seconds vs. the 00:22:28 seconds of the current development ISO that uses systemd. That is, the ISO booted directly, not after deploying the operating system.

@sshyran
Copy link

sshyran commented Jan 1, 2020

small, but mindblowing feature request: how about implementing "runit"... to supplement portability and crossplatformity in 30 sec. timeframe ?

@UriHerrera
Copy link
Member Author

small, but mindblowing feature request: how about implementing "runit"... to supplement portability and crossplatformity in 30 sec. timeframe ?

You're welcome to make a PR to test. I have no experience with runit.

@UriHerrera
Copy link
Member Author

UriHerrera commented Apr 24, 2020

Using OpenRC (update)

I have created another build; this build utilizes OpenRC as init whereas previously, OpenRC was the service manager, and SysV was the init.

Things that work:

  • Boots (No Plymouth though. The Plymouth version in use can work but not newer versions as they depend thoroughly on SystemD).
  • Persistence.
  • X11.
  • Network.
  • Bluetooth.
  • WiFi (At least with the chips that I have).
  • VFIO enablement.

Things that don't work:

  • NX Firewall KCM (The UI is displayed, and UFW does work, but there's an error in KF5 auth, probably a sign that the code is getting old or that a service is not starting).

Screenshots

VirtualBox_Nitrux_23_04_2020_04_07_53

Test build using OpenRC is running on VirtualBox.

What's next

OpenRC as init is working now. There are still some issues for it to be considered stable such as:

  • No bootsplash. With SysV older Plymouth versions do work, so I think that it should be possible to make it work with OpenRC although I haven't seen a distribution using (modern) Plymouth mostly because of its dependency on SystemD.

  • Plasma does work as the screenshot shows, however, it does present a problem of working "randomly." Sometimes it starts, sometimes it doesn't. We'd need to investigate why that is the case, but as far as whether it works or not, it does.

@UriHerrera
Copy link
Member Author

I'm closing this as there's a working image with SysVinit, which will replace the current image files; meanwhile, OpenRC integration is polished to replace SysVinit eventually.

@UriHerrera UriHerrera reopened this Apr 24, 2020
@UriHerrera UriHerrera unpinned this issue Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Issues to discuss future features to be added to this software.
Projects
None yet
Development

No branches or pull requests

4 participants