Skip to content

Upgrading to 66 0.9.1.0

Dear Obarun Community,

The new release of 66 is available in the Obarun testing repositories. This post is not a description of what changed inside 66, the changelog already does that. It tells you what you have to do to bring an existing system to 0.9.1.0, in the order it has to be done.

The migration of your 66 ecosystem itself is automatic. What is not automatic is the handful of manual steps around it: a mandatory reboot, one system service to reconfigure, and the user side, where the old scandir@ and boot-user@ services are replaced by the new 66-userd daemon.

Read the whole procedure before starting it. If something is unclear, ask on the forum rather than improvising. If you find an error in these instructions, open an issue on the news repository.

Replace <user> by your actual user account name everywhere it appears below.

Before you start

0.9.1.0 migrates any 0.8.x or 0.9.0.0 system in a single pass. You install the target version directly, no intermediate release has to be installed by hand.

current version what to install
between 0.8.0.0 and 0.9.0.0 0.9.1.0 directly
between 0.7.2.1 and 0.8.2.1 0.8.2.2 first, then 0.9.1.0
below 0.7.2.1 no migration path, 66 aborts with a fatal error

Before touching anything, 66 takes a snapshot named system@<version>, where <version> is the version you are coming from. That snapshot is your way back: 66 snapshot restore system@<version>, together with a downgrade of the packages to their previous version, puts your system exactly where it was.

Step 1, install the packages

Activate the [obcore-testing], [obextra-testing] and [observice-testing] repositories in your /etc/pacman.conf, then synchronize and upgrade:

$ sudo pacman -Syu

This brings oblibs, 66, 66-tools and the service packages, dbus-66serv included, to the versions the new release needs. Do not reboot yet.

Step 2, trigger the migration

The migration is triggered by any 66 command, and it only ever migrates the ecosystem of the user who runs it. Run it as root first, then as your regular user:

# 66 status
$ 66 status

Repeat the second command once for every user account that has a 66 ecosystem.

The migration does not touch running services, it rewrites the state on disk. Nothing else is expected from you here.

Step 3, reboot

Warning

Unlike previous releases, the reboot is mandatory for this one.

66 no longer builds against skalibs and s6. The programs that are running right now were replaced: s6-svscan is now 66 scandir, s6-supervise is now 66-supervise, and so on. Those processes have been running since boot, and the only way to have the new ones take over is to restart the machine.

# reboot

Everything below happens on the rebooted system.

Step 4, the boot service

Update the boot@ service so it picks up the new boot procedure:

# 66 reconfigure boot@system

As usual with the boot service, the change becomes visible at the next reboot.

Step 5, the user D-Bus service

The user D-Bus service is no longer an instance. dbus@<user> is replaced by a plain dbus user service. As your regular user:

$ 66 remove dbus@<user>
$ 66 enable --start dbus

Warning

This restarts D-Bus, and your desktop environment will feel it. Do this from a console, outside of your X session. If you do it from inside the session, restart the session afterwards.

Step 6, from scandir@ and boot-user@ to 66-userd

scandir@<user> and boot-user@<user> are obsolete, they are not used and not maintained anymore. They are replaced by 66-userd, a daemon that tracks user sessions and drives the services of each user on the first login and the last logout, without D-Bus.

Remove the old services as your regular user. Removing scandir@<user> also removes boot-user@<user>:

$ 66 remove scandir@<user>

Install the new service and enable it as root. It pulls seatd with it:

# pacman -S 66-userd-66serv
# 66 enable --start 66-userd

Wire the PAM module

The daemon is inert until PAM tells it about logins. Add this line at the end of /etc/pam.d/system-login:

-session   optional   pam_userd.so

Remove ConsoleKit

ConsoleKit conflicts with 66-userd, both want to own /run/user/<uid>. If you use it, remove it completely:

# 66 remove consolekit

Then remove any ConsoleKit line left in /etc/pam.d/system-login if it exists.

Step 7, your session files

Your session has to hand DISPLAY and XAUTHORITY over to your user services and to D-Bus. Without it, most user services and everything D-Bus activates will not find the display, and services started by D-Bus will not reach the socket of your user.

The 66 package ships /etc/X11/xinit/xinitrc.d/66-env.sh for exactly that:

#!/usr/bin/sh

66 env import DISPLAY XAUTHORITY
dbus-update-activation-environment DISPLAY XAUTHORITY

startx users

Your ~/.xinitrc must read the /etc/X11/xinit/xinitrc.d directory. That block is what sources the file above, so it is not optional:

#!/usr/bin/bash

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi


## Select the session to start
jwm

Replace jwm by the command that starts your own desktop, startxfce4 for instance.

Display manager users

~/.xsession can stay empty. Display managers normally read and execute what is in /etc/X11/xinit/xinitrc.d/ by themselves. If yours does not, add the same block to it:

if [ -d /etc/X11/xinit/xinitrc.d ] ; then
 for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
  [ -x "$f" ] && . "$f"
 done
 unset f
fi

Wayland users

Run the two commands at compositor startup, with exec_once or whatever your compositor provides:

66 env import DISPLAY XAUTHORITY
dbus-update-activation-environment DISPLAY XAUTHORITY

Step 8, log out and check

For your session to be tracked, log out completely and log back in. Then, as your regular user:

$ 66-userctl list sessions

Your session should be listed. An empty list on a system where you are clearly logged in almost always means the pam_userd.so line is missing from the login stack, go back to step 6.

Step 9, powering the machine off as a regular user

To let a regular user reboot, power off or suspend the machine, add that user to the allow list, as root:

# 66-userctl access allow <user>

This writes /etc/66/shutdown.allow, 66-userctl access allow is a wrapper around that file. From then on the user can run:

$ 66-userctl poweroff

along with reboot, halt, suspend and hibernate.

Note

If /etc/66/shutdown.allow does not exist at all, there is no restriction. Creating it with a first access allow therefore tightens the policy for everyone else.

This is what your desktop menu should call. Under jwm, for example, the power menu becomes:

#!/usr/bin/env bash

dir="~/.config/rofi/color"
uptime=$(uptime -p | sed -e 's/up //g')

rofi_command="rofi -theme $dir/powermenu.rasi"

# Options
shutdown=" Shutdown"
reboot=" Restart"
lock=" Lock"
suspend=" Sleep"
hibernate=" Hibernate"
logout=" Logout"

# Variable passed to rofi
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"

chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
case $chosen in
    $shutdown)
        66-userctl poweroff
        ;;
    $reboot)
        66-userctl reboot
        ;;
    $lock)
        ob-lockscreen -i /usr/share/obarun/ob-lockscreen/oblock.png
        ;;
    $suspend)
        66-userctl suspend
        ;;
    $hibernate)
        66-userctl hibernate
        ;;
    $logout)
        jwm -exit
        ;;
esac

Once you are done

Deactivate the [obcore-testing], [obextra-testing] and [observice-testing] repositories in your /etc/pacman.conf until the packages reach the stable repositories.

Documentation

Feedback on this procedure is welcome, it is what makes the next one shorter. Report anything that went wrong on the forum or on git.obarun.org.

Thank you for your continued support of Obarun.

Eric Vidal: [email protected]