Skip to content

NurOS-Linux/neoinit

Repository files navigation

neoinit

License Language Platform Build

Microkernel-style init system for Linux.

Requirements

  • C11 compiler (gcc or clang)
  • meson >= 0.56
  • ninja

Building

meson setup builddir
cd builddir
ninja

Run tests:

meson test

Install:

ninja install

Installs neoinit to /sbin/neoinit and servctl to /usr/bin/servctl.

Build options

Option Default Description
systemd_compat true Build systemd .service file parser
services_dir /etc/neoinit/services Directory to scan for service definitions
default_path (system default) Default PATH for services
container_detection true Skip reboot and unmount in container environments

Example — disable systemd compatibility:

meson setup builddir -Dsystemd_compat=false

Service definitions

Services are loaded from /etc/neoinit/services/ at boot in alphabetical order.

YAML format:

name: myservice
description: My service
exec: /usr/bin/myservice --flag
working_dir: /var/lib/myservice
restart: true
type: simple
env:
  - FOO=bar

See docs/services.md for full field reference.

Runtime control

servctl communicates with the running init via /run/neoinit.sock:

servctl status          # show init status
servctl list            # list all services
servctl start <name>    # start a stopped service
servctl stop <name>     # stop a running service

Signal handling

Signal Effect
SIGCHLD Reap zombie processes
SIGTERM Sync, unmount, power off
SIGINT Sync, unmount, reboot
SIGHUP Ignored
SIGPIPE Ignored

The kernel delivers SIGINT to PID 1 on Ctrl+Alt+Del.

Documentation

Authors

See CONTRIBUTORS.md.

About

Microkernel-style init system for Linux.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Contributors