OpenBSD Journal

p2k16 Hackathon Report: ajacoutot@ on Gnome, rc and rcctl improvements

Contributed by nayden on from the rc to the controls dept.

Our next p2k16 report comes from Antoine Jacoutot, who writes:

First of all I'd like to give a big thank to gilles@, Epitech Nantes and the OpenBSD Foundation for making this event a real blast. The hackroom accomodation was very nice and so was the location.

Disclaimer: I have a goldfish memory so I am probably forgetting a lot of small things I did during this week, next time I should probably start writing what I'm doing as I go.

So it was that time of the year where a new GNOME release was out (3.20.1). I obviously started working on updating our GNOME ports to that release. It ended up being very easy with only a few regressions that have since been taken care of. A week before the hackathon, Jasper and I actually started this work by updating the underlying libs (glib, gtk...) so after 1.5 day in Nantes, everything was pretty much done \o/.

On the system front, I finally got the balls to make the installer automatically run sysmerge(8) on first boot after an upgrade. This uses the same logic as fw_update(1), using rc.firsttime except that sysmerge(8) needed to run a little earlier in the boot process. To do so, I factorized the initial rc.firsttime feature into a run_upgrade_script() function that would execute a particular rc file at a specified time in /etc/rc using sh(1) then remove it. So we can now use things like:

run_upgrade_script sysmerge
run_upgrade_script firsttime

Thank you Theo for the idea :-)

There will probably be some adjustments here and there especially regarding the output but I've been using a similar method for 18 months without an issue.

Speaking about rc(1), I tweaked and merged a diff from one of our users: Jiri B, allowing to start a daemon under a specific routing table (rtable(4)). That means we need a way to start another similar rc.d(8) script since we'll be using multiple instances of the same daemon. To do so, we just link the original rc.d script to another name (so that all links are up-to-date with the original script) then enable it in rc.conf.local(8). e.g. running 2 ntpd(8), one under rtable 0 (default) and the other under 2

# ln -s /etc/rc.d/ntpd /etc/rc.d/ntpd2
# rcctl set ntpd2 rtable 2
# rcctl enable ntpd ntpd2
# rcctl start ntpd ntpd2

Information about an rc.d daemon can be listed with:

# rcctl get ntpd

I ended the hackathon by importing a couple of Hashicorp tools which I use daily at $WORK: packer and terraform. Thanks to Jasper hinting me about the GO15VENDOREXPERIMENT variable, it ended up being very straightforward. This led me to start working on consul, vault and nomad; but these aren't ready just yet.

At last and as usual during such an event, I spent a few hours discussing with some fellow developers about several topics that we'll be working on in the near future.

(Comments are closed)

  1. By rjc (rjc) rjc on

    Thank you for the write-up Antoine and for your work on sysmerge(8).

    I do have a couple of nitpicks, though:

    - 'rcctl enable' needs to be run before 'rcctl set' - otherwise we get a warning:

    # rcctl set ntpd2 rtable 2
    rcctl: ntpd2 is not enabled

    - most likely, you wanted to show output of 'rcctl get ntpd2' as the 'rtable' shows '2'.



  2. By Billy Larlad ( on

    Thanks for the great work on GNOME. 3.20 is working great on my x220!


Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]