Skip to content

rinit-org/rinit

Repository files navigation

rinit

GitHub branch checks state codecov GitHub

rinit is a next generation init and service manager for Linux and written in Rust. It is inspired by 66, s6 suite and daemontools.

NOTE: This is still a work in progress, please run at your own risk.

This project was initially written in C++ and called tt.

Features

  • Support for different types of programs: oneshot and daemons
  • Predictable dependencies at build time
  • Configurable parameters for services
  • Asynchronous start of the services
  • Log everything into plain-text files
  • Low footprint
  • Target desktop and servers
  • Conditional dependencies for supporting various scenarios
  • Provide sane defaults
  • Provide user services to other init

Getting started

Build

rinit only requires the nightly rust compiler to build, it has no dependency.

To build the project:

$ cargo build --release

Install

rinit is composed by 3 binaries: rctl, rsvc and rsupervision.

It can be easily installed via rinstall. Follow usage instructions in rinstall documentation here.

Services

rinit requires services files to know what should run and how. These services can be provided by your distribution, a project developer or a third party. rinit provides a set of services available and always up-to-date here.

Usage

rinit keeps a graph with all the enabled services and their dependencies. To start using rinit, enable one or more services.

Enable a service

To enable a service, run the following command:

$ rctl enable <service>

The service and all its dependencies will be enabled and will be started in the next rinit startup. To start a service right after enabling it, add the --start option:

$ rctl enable --start <service>

Disable a service

To disable a service, run the following command:

$ rctl disable <service>

The service will continue running even after it has been disabled. To stop a service after disabling it, add the --stop option:

$ rctl disable --stop <service>

Start a service

To start a service, use:

$ rctl start <service>

Stop a service

To stop a service, use:

$ rctl stop <service>

Get current status

To get the current status of the services handled by rinit, run:

$ rctl status

Modes

rinit works in three different modes:

  • root mode, working a system service manager
  • user mode, working a user service manager
  • project mode, working a service manager for a specific set of services

The command line interface is the same for each mode. The only difference is whom the service affects and the directory used for the configuration.

All three of them requires to have rsupervision into your PATH. Please note that the Rust function that is used to spawn rsupervision doesn't support tilde expanding ~/ in PATH.

User mode

After having one or more services enabled in rinit, run rsvc as your current user. rinit in user mode can be used for starting graphical daemons (like polybar or waybar), as well as a various things, from the complete MPD setup to periodically fetch data from a WebDAV server.

Most daemons and services requires environmental variables set at runtime from various programs, like the DBUS_SESSION_BUS_ADDRESS to the WAYLAND_DISPLAY. For this reason it is suggested to start rsvc after the compositor/window manager has started, via .xstartrc or by using the autostart feature of your Desktop/window manager.

License

rinit is licensed under the GPL-3.0+ license.

About

Next-gen init and service-manager written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages