Giter Site home page Giter Site logo

ignite's Introduction

= Ignite, a simple and robust init replacement

ignite is a set of scripts to boot Arch Linux using runit for service
supervision.

== Benefits

Robust, proven software: ignite is based on runit (which has been in
development since 2001), a high quality implementation of ideas dating
back to 1997 and earlier.

Simple configuration: ignite allows you to configure Arch using
/etc/rc.conf, like back in the old days.

Low overhead: runit-run is a tiny, statically linked binary that only
does the absolutely essential things.

Non-intrusive: ignite wont replace your cron, getty or syslog-ng.  You
are still free to do that yourself, if you want to.

Portability: the scripts can be easily adapted to other Linux
distribution, or even other unixish operating systems.

Full control: ignite will never start anything you didn't tell it
about.  ignite also supports read-only root file systems.

== Setup

READ THIS CAREFULLY OR YOUR SYSTEM WILL NOT BOOT SUCCESSFULLY.

If you booted with sysvinit, make a copy of /usr/bin/init to
/usr/bin/init.sysv, else you cannot reboot cleanly.

Install runit-musl and ignite-git from AUR.  Ensure that you have at least
one agetty-tty1 process in DAEMONS.  Note that services mentioned in
/etc/inittab will not be picked up anymore.

You can reboot with "init.sysv 6" after installation if you booted
with sysvinit.

== Configuration

ignite is configured using /etc/rc.conf and respects these variables:

HARDWARECLOCK=UTC|local
TIMEZONE=
KEYMAP=
CONSOLEFONT=
CONSOLEMAP=
MODULES=()  # prefix ! is not supported
USEDMRAID=no|yes
USEBTRFS=no|yes
USELVM=no|yes
HOSTNAME=   # or use /etc/hostname
DAEMONS=(alsa syslog-ng crond)  # see below, prefix ! disables

DAEMONS refer to service directories in /etc/sv.

Other runlevels can be defined in /etc/rc.conf as well by setting
$DAEMONS_foo to an array of services.  You can boot these by adding
runlevel=foo to the kernel command line.  There is a predefined
runlevel "single" which also can be triggered by appending "single",
"1", "S", or "-s" to the kernel command line.  It is predefined to
only start sulogin on tty1, and takes extra precaution to allow the
root filesystem to be (re-)mountable read-only.  The "emergency"
runlevel (or "-b") can be used to get a root shell in stage 2.

You can change runlevels in the running system by executing
"runsvchdir $runlevel".  This will shut down all services
that are not in the new runlevel, and start the missing ones.
Services defined in both runlevels will keep running.

== Additional Arch configuration points

* If you use syslog-ng, ensure that you source from
  'unix-dgram("/dev/log");' in /etc/syslog-ng/syslog-ng.conf.

* Restore core dumps: remove /usr/lib/sysctl.d/coredump.conf

* Revert network interface renaming:
  ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

* For NFS server support, you need:
  nfsd rpcbind rpc.idmapd rpc.mountd rpc.statd
  (and, if desired: rpc.gssd rpc.svcgssd)

* For NFS client support, you need:
  rpcbind rpc.statd (and, if desired: rpc.gssd)

* With xorg-server 1.16.0+, you may need a file /etc/X11/Xwrapper.config
  with following contents (also see Xorg.wrap(1))

      needs_root_rights = yes
      allowed_users = anybody

== How it works

ignite uses runit, with "1 2 3"-scripts adapted from Arch initscripts
2012.05.1, back when they were plain bash scripts.  The "1 2 3"-
scripts are very straight forward, you can read them easily.

Phase 1 configures the system initially.  It can be interrupted at
almost any time by pressing C-c, which will drop you into a sulogin,
so you can change stuff.  Upon exiting this emergency shell, booting
resumes at that step.  STDOUT and STDERR are logged into dmesg.

In phase 2, $DAEMONS scripts are linked to /run/runit/runsvdir/*, and
runsvchdir picks them up.  You can fiddle around there yourself, but
changes won't be persistent.  Use plain "runsv /etc/sv/$DAEMON" if you
just want to try a daemon and not permanently enable it.

Use shutdown/halt/reboot to enter phase 3, which stops all services,
unmounts everything and lets runit turn off/reboot the machine.

== Limitations

- No support for non-UTF8 environments
- Only simple crypttab support (no 3rd and 4th column)
- Some irrelevant features of shutdown/halt/reboot are not implemented

== Copyright

runit is BSD licensed.

ignite is in the public domain.

To the extent possible under law, the creator of this work has waived
all copyright and related or neighboring rights to this work.

http://creativecommons.org/publicdomain/zero/1.0/

ignite's People

Contributors

ebfe avatar leahneukirchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ignite's Issues

Current state of development

Hi,

Have been messing with runit for a while and was thinking of bringing it too ArchBang as an alternative init system. Wondering what current state of development ignite is in and how much works. Basically need base + X and openbox window manager. Do you use systemds own udev or something else?

Mr Green

dnsmasq

#! /bin/sh
exec /usr/bin/dnsmasq -k --user=dnsmasq

Allow service@blah?

Starting multiple instances of a daemon with different configs by running eg systemctl enable netcfg@wifi-uni is one of the nice things about systemd.

This is tricky to get working in ignite because of the requirement that it works on read only roots.

Possible implementation:

/etc/runit/2:

...

     case ${daemon:0:1} in
       !) ;;
       *)
         [[ $daemon =~ ([^@]+@)([^@]+) ]]
         if [ ${BASH_REMATCH[1]} ]; then
           cp -r /etc/sv/${BASH_REMATCH[1]} $d/$daemon
           ln -s /run/runit/supervise.$daemon $d/$daemon/supervise
           echo -n "${BASH_REMATCH[2]}" > $d/$daemon/config
         else
           ln -s /etc/sv/$daemon $d
         fi;;
     esac

...

Example daemon:
/etc/sv/tincd@/run:

#! /bin/sh
PROFILE=`cat config`
exec /usr/bin/tincd -D -n $PROFILE

This is inconsistent with the rest of ignite - no supervise in /etc/sv/..., creating actual files in /run instead of symlinks

Clash with halt,reboot,shutdownn ....

Currently ignites halt,reboot,shutdown,poweroff clash with installed versions. This means package will fail to install under you remove them. Wondering if systemd-sysvcompat needs to be removed? (or added as 'conflicts' in PKGBUILD)

static ip configuration

One can use dhcpcd to request and get a static ip.
A eth0-static service would be nice to do that.

I have a branch where I tested such a service and works fine.

This would mean that some variables would need to be configured on /etc/rc.conf.
I guess we'd need INTERFACE (or unconditionally eth0) ADDRESS NETMASK GATEWAY BROADCAST and NAMESERVER (?) for such a simple configuration.


If not dhcpcd, ip could be used to achieve a static ip configuration, like:

ip link set dev "$INTERFACE" up &&
ip addr add "${ADDRESS}/${NETMASK}" broadcast "$BROADCAST" dev "$INTERFACE" &&
ip route add default via "$GATEWAY"

ofcourse ip would exit once it's done its job, so it's not very suitable here,
but it can be used in /etc/rc.local (for anyone wanting this if this is rejected).


So, that's the idea. I am not sure it's worth it.
Configuring in /etc/rc.local should work fine too.

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.