Coder Social home page Coder Social logo

dainit's Introduction

dainit

dainit is a simple init system for Linux written in Go, mostly for me to to use on my laptop. It's likely less full-featured and more minimalist than your init system. (It aims to be an init system and only an init system.)

dainit will do the following:

  1. Set the hostname
  2. Remount the root filesystem[1]
  3. Mount all other non-network filesystems and activate swap partitions
  4. Start processes with config files in /etc/dainit after their dependencies ("Needs") are started. See conf/ for a sample udevd and wpa_supplicant (which depends on udevd to finish before being started) config.
  5. Start a tty and wait for a login.
  6. Kill running processes, unmount filesystems, and poweroff the system once that login session ends.

(The way step 4 is handled isn't very elegant and will likely fail if you have too many slow startup processes.)

You can also create a file /etc/dainit.conf for some basic configuration. If there are any lines of the form "Autologin: username" it will automatically log in as that username. (If there's multiple autologin directives, it will create the appropriate number of ttys.) If any line contains "Persist: true", then when a tty exits, it'll respawn the tty instead of powering down the system once all the ttys are gone.

Installation/Usage

sudo cp $GOPATH/bin/dainit /sbin
sudo update-initramfs -u

then add init=/sbin/dainit to your grub configuration. (Or alternatively, make /sbin/init a symlink to dainit.)

[1] This shouldn't be required, since mount -a should take care of it in step 3 according to mount(8), but as far as I can tell it doesn't.

dainit's People

Contributors

driusan avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.