Init - ArchWiki

# Init

Related articles

- Arch boot process
- ConsoleKit
- Init Rosetta

Warning: Arch Linux only has official support for systemd. When using a different init system, please mention so in support requests.

Init is the first process started during system boot. It is a a daemon process that continues running until the system is shut down. Init is the direct or indirect ancestor of all other processes, and automatically adopts all orphaned processes. It is started by the kernel using a hard-coded filename; if the kernel is unable to start it, panic will result. Init is typically assigned process identifier 1.

The init scripts (or rc) are launched by the init process to guarantee basic functionality on system start and shutdown. This includes (un)mounting of file systems and launching of daemons. A service manager takes this one step further by providing active control over launched processes, or process supervision. An example is to monitor for crashes and restart processes accordingly.

These components combine to the init system. Some inits include the service manager in the init process, or have init scripts in close relation to them. These inits are below referred to as integrated, though entries in different categories may explicitely depend on each other.

## Inits (integrated)

- systemd — Dependency-based init system with aggressive parallelization, process supervision using cgroups, and the ability to depend on a given mount point or dbus service.

  http://freedesktop.org/wiki/Software/systemd/ || systemd

- uselessd — A fork of systemd v208.

  http://uselessd.darknedgy.net/ || uselessd

- Upstart — Event-based init system which handles starting, stopping and supervising of tasks and services.

  http://upstart.ubuntu.com/ || upstart

- initng — Dependency-based init system with parallelization and asynchronous start.

  http://initng.sourceforge.net/trac || initng-git

- Epoch — Single-threaded init system designed for minimal footprint, compatibility and unified configuration.

  http://universe2.us/epoch.html || epoch-init-system

- finit — Small init system written in Ruby supporting cgroups and socket activation.

  https://github.com/felipec/finit/ ||

## Inits

- BusyBox — Utilities for rescue and embedded systems.

  http://busybox.net/ || busybox

- SysVinit — Traditional System V init.

  http://savannah.nongnu.org/projects/sysvinit || sysvinit

- ninit — Fork from minit

  http://riemann.fmi.uni-sofia.bg/ninit/ || ninit

- sinit — Simple init initially based on Rich Felker’s minimal init.

  http://tools.suckless.org/sinit || sinit

## Init scripts

- initscripts-fork — Maintained fork of SysVinit scripts in Arch Linux.

  https://bitbucket.org/TZ86/initscripts-fork/overview || initscripts-fork

- minirc — Minimal init script designed for BusyBox.

  https://github.com/hut/minirc/ || minirc-git

- OpenRC Arch services — OpenRC service scripts compatible to Arch Linux.

  https://github.com/andrewgregory/openrc-arch-services || openrc-arch-services-git

- spark-rc — A simple rc script to kickstart your system.

  https://github.com/fbt/spark-rc || spark-rc

- watchman-sm-services — Examples of services for watchman.

  https://github.com/fbt/watchman-services || watchman-sm-services-git

## Service managers

- daemontools — Collection of tools for managing UNIX services.

  http://cr.yp.to/daemontools.html || daemontools

- Monit — Monit is a process supervision tool for Unix and Linux. With monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server.

  http://mmonit.com/monit/ || monit

- OpenRC — Dependency-based rc system that works with the system-provided init, normally SysVinit.

  http://www.gentoo.org/proj/en/base/openrc/ || openrc / openrc-core

- perp — Persistent process (service) supervisor and managment framework for UNIX.

  http://b0llix.net/perp/ || perp

- runit — UNIX init scheme with service supervision, a replacement for SysVinit, and other init schemes.

  http://smarden.org/runit/ || runit

- s6 — Small suite of programs for UNIX, designed to allow service supervision in the line of daemontools and runit.

  http://skarnet.org/software/s6/ || s6

- watchman — A not-so-simple service manager for Linux.

  https://github.com/fbt/watchman || watchman-sm

## Troubleshooting

This section addresses potential problems when not using systemd.

### Cron functionality

Arch uses timer files instead of cron by default. Install archlinux-cronjobs from the AUR for basic cron jobs.

### Group permissions

Systemd handles groups with `logind` and local sessions. Without them, users should add themselves to the respective groups (such as audio, video) and reboot. See Groups#Group_management for details. Policykit agents require a local session, but group rules can be used instead. See Polkit#Bypass_password_prompt.

Alternatively, see ConsoleKit.

### Rootless X (1.16)

See Xorg#Rootless Xorg (v1.16).

### Start X on the same TTY

This also prevents interrupting the current Xorg process from a different TTY. See [1] for details.

### Syslog-ng

Note: rsyslog works with the default configuration.

Syslog-ng is configured for `journalctl` by default. Edit `/etc/syslog-ng/syslog-ng.conf`:

    source src {
     unix-stream("/dev/log");
     internal();
     file("/proc/kmsg");
    };

See Syslog-ng#Sources for details

### Replacing the systemd package

This article or section needs expansion.

Reason: Find a statisfactory solution for tmpfiles, cf. openrc-systemdcompat and tmpfiles-config (Discuss)

Warning: It is strongly recommended to leave systemd and libsystemd installed.

The systemd packages include several components besides the init system:

- systemd-udev for device hot-plugging. Alternatives include eudev, mdev and smdev.
- systemd libraries linked against software such as Xorg. In case libsystemd is not desired (for example when using eudev, which provides its own `libudev.so`), install libsystemd-standalone or eudev-systemdcompat.
- Helper utilities such as systemd-tmpfiles and systemd-sysusers used in pacman `.install` files.

## See also

- Debian init system debate
- How to run s6-svscan as process 1
- Replace systemd with busybox + minirc
- Spark project
- Experiments of Manjaro
- Init vs. runsv

Category:

- Boot process