オマエラ wlog

[ all ] [ media ] [ life ] [ meta ] [ tech ]

runit fast boot and init scripts

by z411 @ 2016-12-02 [ tech ]

Since I moved away from Debian and systemd again I've been trying new options for my init system, like s6, openbox init and suckless init (sinit). After trying out Void Linux, runit, which provides service supervision, seemed like a fine option so I installed it on my Gentoo machine.

Turns out it's pretty simple and it works, but I wanted a fast boot.

By default once you install runit, even if you use runit-init you'll end up using the same old SysV init scripts in one way or another. To get a fast boot you have to write your own. So that's what I did.

With my init scripts I could get a ~3 second boot; that's including the kernel which takes up most of the boot time; the userspace itself gets up to an usable state in around 500ms. This machine started with systemd in ~7 seconds, so I'm pretty sure people with faster machines will get an ever faster boot.

For those who don't know, runit works with 3 stages. Stage 1, which runs at boot; stage 2, which starts up services in parallel and keeps running until shutdown, and stage 3 which does the actual shutdown process. I'll share my scripts for each one.

Permalink | 12:16

Nikki 0.1

by z411 @ 2016-07-18 [ tech ]

I just uploaded the very simple script (~200 LOC) used to generate this blog to a repo. I was looking over at Pelican but it's still overkill for what I need, and while I was about to install 4x13's wlog, I wanted a static alternative, so I made my own.

It's pretty simple to use, just create the markdown files in the "pages" directory with the following format:

title: My Article
date: 2016-01-01 14:00
(blank line)
Post content here...

Then just run the script, and the static blog should be generated in the "output" directory. You can now just upload it through FTP to any web server. Pretty simple and fast.

Running nikki

The repo is available over here @ GitHub.

I still want it to support automatic copying of stylesheets and images to the output directory. Very simple configuration variables are at the top of nikki.py. I also plan to add pagination and improve the error handling later.

Permalink | 19:21