Code Monkey home page Code Monkey logo

hummingbird's Introduction

Lightning fast Linux init

"It makes runit look like systemd" —wooosh
"the antithesis of systemd" —u/ocean-noice
No systemd

about

hummingbird is an init system designed for speed. It does nothing more than start the system and stop the system by default. There are three main "runlevels", fs which is called directly after the pseudo filesystems necessary for the system to run have been mounted, interlude which is ran before dropping the user into a tty, and tty which is what is responsible for actually starting ttys.

installation

$ git clone https://github.com/Sweets/hummingbird
$ cd ./hummingbird
$ make
$ sudo make install

additional files

If your distribution has any files specific to it, they can be found in dist. Replace everything in /usr/lib/hummingbird with your distribution specific files for optimal usage with your distribution.

If they're not available, feel free to contribute them, or request them.

work on hummingbird

As a developer, I feel that the functionality of hummingbird has reached what I envisioned it to. This is not to say that the project is dead by any means — I simply have nothing more to add to it. That being said though, if you ever feel there's an issue with hummingbird, open an issue. It will be addressed as soon as I can get to it.

Don't ever be intimidated by the last commit date being a long time in the past. If you see I've made commits on other projects in the last year, rest assured I'll get to your issue.

usage

Feel free to use hummingbird on your own personal installation, on any sort of embedded system you wish, hell, if you're a distribution developer, feel free to ship it as the init if you're so inclined. hummingbird is licensed under the MIT license — the world is your oyster. If you have any cool projects that use hummingbird, feel free to make a pull request or an issue showing how it's being used, it'll be listed on the repository README.

hummingbird's People

Contributors

aosync avatar capezotte avatar dylanaraps avatar jlxip avatar kiedtl avatar ocean-moist avatar sweets avatar tomdot-dev avatar trvv avatar wooky 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  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

hummingbird's Issues

request: documentation

This project looks interesting, how energy efficient is this compared to runit?

Also, how do you use hummingbird to start and stop resources and how stable is it?

I am very curious.

Getting dropped to emergency shell post-boot

Sometimes executing some command, (haven't found a pattern, sometimes it happens sometimes not), the init fails and drops me to emergency shell post-boot.

I'm not sure if this is KISS's init issue or hummingbird, but it's not happening with busybox init.

home directory not found

OS: Arch Linux

I followed the instructions to the letter. However, upon logging in (I don't use a DM, just the tty), it shows the following:

-- username: /home/username: change directory failed: No such file or directory
Logging in with home = "/".

forced reboot after attempted startup with `init=/usr/lib/hummingbird`

i'm currently attempting to migrate from runit to hummingbird on my void install.
however, any time i attempt to boot, it just powers off all connected usb devices and eventually boots me back into EFI and, from there, to grub. the only way to boot is to use runit.

/usr/lib/hummingbird is empty other than random.seed, no folder in /etc or /var (there probably isn't meant to be one, but i'm making sure as that's where the usual system config files go), and i have absolutely no idea where to take this.

hummingbird appears to be compiling and installing fine, and it has absolutely no footprint other than its files in /usr/bin and folder in /usr/lib

Cant Compile

On kiss linux w/ musl.

getting this;

/usr/bin/ld: /tmp/cccHhIDF.o:(.bss+0x0): multiple definition of `signal_map'; /tmp/ccHEIdfG.o:(.data.rel.local+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:8: hummingbird] Error 1

help with runit

Distribution: Void Linux

I tried using hummingbird along with runit's process supervision using this guide. The guide seems pretty outdated because runsvdir-start does not exist from my current install. So instead, I changed the line having /sbin/runsvdir-start with /etc/runit/2 (source). I also installed tcsh because the guide indirectly says so.

Upon booting up, it shows these lines and stops (I can confirm because I waited for about half an hour):

hummingbird - Linux 4.19.48_1
* Applying /usr/lib/sysctl.d/10-void.conf ...
kernel.core_uses_pid = 1
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
kernel.kptr_restrict = 1
kernel.dmesg_restrict = 1
kernel.perf_event_paranoid = 2
kernel.kexec_load_disabled = 1
kernel.yama.ptrace.scope = 1
* Applying /etc/sysctl.conf ...
/usr/bin/udevd

And when I press enter a couple of times, it goes to the login tty while shooting this error infinitely:

ln: failed to create symbolic link '/run/runit/runsvdir/current/current': File exists

While there is a handler case for SIGCHLD, it is never registered with signal

See #14
Zombies remain very unreaped, which appears to have caused trouble for a friend of mine using FVWM.
I have also confirmed this by constructing an environment using the following (very terrible) script and creating zombies by nesting sh processes and killing them.

This was tested under commit 6ba337a.

#!/bin/sh

rm -rf /media/ramdisk/summoner-mount-namespace

SMM=/media/ramdisk/summoner-mount-namespace

mkdir -p $SMM/usr/bin
mkdir -p $SMM/bin
mkdir -p $SMM/usr/sbin
mkdir -p $SMM/sbin
mkdir -p $SMM/usr/lib/hummingbird
mkdir -p $SMM/dev
mkdir -p $SMM/etc
mkdir -p $SMM/proc
mkdir -p $SMM/sys

cp hummingbird $SMM/usr/bin/hummingbird
cp usr/lib/hummingbird/* $SMM/usr/lib/hummingbird/
cp /usr/bin/busybox $SMM/bin/busybox

chmod +x $SMM/usr/lib/hummingbird/*

# This script ever returning indicates "init failed" to hummingbird.
# And we have no real TTYs.
echo "#!/bin/sh" > $SMM/usr/lib/hummingbird/tty
echo "exec sh" >> $SMM/usr/lib/hummingbird/tty

# "pre-heat" environment
unshare -m -R $SMM /bin/busybox --install -s

unshare -m -p -f -R $SMM /usr/bin/hummingbird

To create a zombie:

20kdc@Magnus:/media/20kdc/6d58dae8-1885-49fc-a0c2-ad587ec9e7b9/External2/hummingbird$ sudo ./summoner
mount: mounting remount,rw on / failed: No such file or directory
mount: can't read '/etc/fstab': No such file or directory
swapon: can't open '/etc/fstab': No such file or directory


BusyBox v1.30.1 (Ubuntu 1:1.30.1-4ubuntu6.3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/ # sh
<omitted...>
/ # sh
<omitted...>
/ # sh
<omitted...>
/ # ps -e
PID   USER     COMMAND
    1 0        /usr/bin/hummingbird
   14 0        /usr/bin/hummingbird
   15 0        sh
   16 0        sh
   17 0        sh
   18 0        sh
   19 0        {ps} sh
/ # kill -KILL 16
/ # Killed
/ # [1]+  Stopped (tty input)        sh
/ # fg
sh

/ # exit
/ # exit

Then from outside the namespace, check top:

  13291 root      20   0    2616   1624   1528 S   0.0   0.0   0:00.00              `- summoner                                                                                                                    
  13307 root      20   0    9124    584    520 S   0.0   0.0   0:00.00                  `- unshare                                                                                                                 
  13308 root      20   0    1084      4      0 S   0.0   0.0   0:00.00                      `- hummingbird                                                                                                         
  13321 root      20   0    1084     48      8 S   0.0   0.0   0:00.00                          `- hummingbird                                                                                                     
  13322 root      20   0    2428      4      0 T   0.0   0.0   0:00.00                              `- sh                                                                                                          
  13324 root      20   0       0      0      0 Z   0.0   0.0   0:00.00                          `- sh 

The entry with a Z here is the zombie.
Alternatively, ps -e will show a process as 13595 pts/2 00:00:00 sh <defunct>. (This is from a different run, so a different PID.)

The zombie process will be cleaned up by the outer init when hummingbird terminates.

The zombies can be reaped by adding signal(SIGCHLD, handler); past the other two signal calls in hummingbird.c.

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.