Is antiX going to get s6 init manager?

Forum Forums antiX-development Development Is antiX going to get s6 init manager?

  • This topic has 67 replies, 11 voices, and was last updated May 27-1:01 pm by olsztyn.
Viewing 15 posts - 16 through 30 (of 67 total)
  • Author
    Posts
  • #54902
    Member
    olsztyn
    Helpful
    Up
    0

    antiX-21-a1 running s6/66 with sysvinit removed.

    I sense this is a breakthrough many have been waiting for… I am not an expert but I do care for clean architecture.
    I am looking forward to S6 antiX, hopefully soon.
    Many thanks to eric, andyprough and anti.

    #54913
    Member
    fungalnet
    Helpful
    Up
    0
    
    }
    
    cp_skeleton() {
        cp -f /etc/66/{init,halt,reboot,poweroff,shutdown} /sbin/ || return 1
        sed 's:^66-boot.*$:66-boot -m:' -i /sbin/init
    }
    

    How crucial is it for an init file to be in /sbin/ only and not also in /usr/bin or /usr/sbin or exist as a link in /sbin/ to the /usr/bin file? I am trying to troubleshoot past experiments from memory and this is about the only thing I did differently.

    This is what I have in /sbin/init.66

    % cat /sbin/init.66*
    #!/usr/bin/execlineb -P
    
    /usr/bin/66-boot -b "Trying to boot Antix with 66 ...." -m

    while /sbin/init is a link /sbin/init -> /lib/runit/runit-init

    On grub I have one entry as a usual linux boot line the other ends at init=/sbin/init.66 this way it can boot with runit or 66.

    The only intersection between the two is init halt reboot poweroff shutdown. /usr/bin/run/ and /usr/bin/s6 for the last four and /sbin/init and /sbin/init.66

    Then on /usr/local/bin I have a poweroff and reboot with both having both commands /usr/bin/s6/reboot and /usr/bin/run/reboot One of them works all the time.

    #54931
    Member
    eric
    Helpful
    Up
    0

    Ok i found the trouble. The slim service made by the script was not correct and stuck the service database. So, i post again the script, it should works as expected now

    #!/bin/bash
    
    #antix from full iso
    
    TMP="/tmp/install"
    
    skalibs_tag="v2.10.0.0"
    execline_tag="v2.7.0.0"
    s6_tag="v2.10.0.0"
    s6_rc_tag="v0.5.2.1"
    oblibs_tag="v0.1.3.0"
    _66_tag="v0.6.1.1"
    _66_tools_tag="v0.0.7.1"
    s6_linux_utils_tag="v2.5.1.4"
    s6_portable_utils_tag="v2.2.3.1"
    
    flags_path=(
    
        --prefix=/usr
        --libexecdir=/usr/libexec
        --bindir=/bin
        --shebangdir=/bin
        --sbindir=/sbin
        --enable-shared
        --disable-allstatic
        --disable-static
    )
    
    # lowdown package doesn't exist on Antix, so do not try to build
    # the documentation
    
    _sed_lowdown() {
    
        sed 's:^LOWDOWN.*$::' -i ${1}
    }
    
    prepare_build() {
        apt update || return 1
        apt install git || return 1
        apt install build-essential || return 1
    
        mkdir ${TMP}
    }
    
    ## skalibs
    build_skalibs() {
    
        cd ${TMP}
    
        git clone https://github.com/skarnet/skalibs
    
        cd skalibs
    
        git checkout tags/"${skalibs_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    ## execline
    build_execline() {
    
        cd ${TMP}
    
        git clone https://github.com/skarnet/execline
    
        cd execline
    
        git checkout tags/"${execline_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    ## s6
    build_s6() {
    
        cd ${TMP}
    
        git clone https://github.com/skarnet/s6
    
        cd s6
    
        git checkout tags/"${s6_tag}"
    
        ./configure ${flags_path[@]} --with-dynlib=/usr/lib/execline
    
        make clean
    
        make install || return 1
    }
    
    ## s6-rc
    build_s6_rc() {
    
        cd ${TMP}
    
        git clone https://github.com/skarnet/s6-rc
    
        cd s6-rc
    
        git checkout tags/"${s6_rc_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    ## s6-linux-utils
    build_s6_linux-utils() {
    
        cd ${TMP}
    
        git clone https://github.com/skarnet/s6-linux-utils
    
        cd s6-linux-utils
    
        git checkout tags/"${s6_linux_utils_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    ## s6-portable-utils
    build_s6_portable-utils() {
    
        cd ${TMP}
    
        git clone https://github.com/skarnet/s6-portable-utils
    
        cd s6-portable-utils
    
        git checkout tags/"${s6_portable_utils_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    ## oblibs
    build_oblibs() {
    
        cd ${TMP}
    
        git clone https://framagit.org/obarun/oblibs
    
        cd oblibs
    
        git checkout tags/"${oblibs_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    ## 66
    build_66() {
    
        cd ${TMP}
    
        git clone https://framagit.org/obarun/66
    
        cd 66
    
        _sed_lowdown Makefile
    
        git checkout tags/"${_66_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    
    }
    
    ## 66-tools
    build_66-tools() {
    
        cd ${TMP}
    
        git clone https://framagit.org/obarun/66-tools
    
        cd 66-tools
    
        _sed_lowdown Makefile
    
        git checkout tags/"${_66_tools_tag}"
    
        ./configure ${flags_path[@]}
    
        make clean
    
        make install || return 1
    }
    
    cp_skeleton() {
        cp -f /etc/66/{init,halt,reboot,poweroff,shutdown} /sbin/ || return 1
        sed 's:^66-boot.*$:66-boot -m:' -i /sbin/init
    }
    
    prepare_boot() {
    
        cd ${TMP}
    
        git clone https://framagit.org/pkg/obmods/boot-66serv
    
        cd boot-66serv
    
        _sed_lowdown Makefile
    
        ./configure
    
        make install || return 1
    
    }
    
    build_tree() {
    
        ## don't crash here in case of multiple use of the script
        66-tree -n boot
    
        66-enable -t boot boot@system || return 1
    
        BOOT_CONF="$(readlink /etc/66/conf/boot@system/version)"
    
        cp "${BOOT_CONF}/.boot@system" "${BOOT_CONF}/boot@system" || return 1
    
        66-env -t boot -r 'CGROUPS=!no' boot@system || return 1
    
        66-enable -F -t boot boot@system || return 1
    
        dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 status=none || return 1
    
    }
    
    build_tree_root() {
    
        66-tree -cnE root
    
        exec 3>&1 1>/etc/66/service/slim
    cat <<EOF
    [main]
    @type = longrun
    @version = 0.0.1
    @description = "Slim daemon"
    @user = ( root )
    
    [start]
    @execute = ( slim -nodaemon )
    
    EOF
        exec 1>&3 3>&-
    
        66-enable slim
    }
    
    _run() {
    
        if ! ${1} ; then
            printf "%s\n" "unable to ${2} ${1#*_}"
            exit 1
        fi
    }
    
    ## do it
    
    _run prepare_build "install"
    _run build_skalibs "skalibs"
    _run build_execline "execline"
    _run build_s6 "s6"
    _run build_s6_rc "s6-rc"
    _run build_s6_linux-utils "s6-linux-utils"
    _run build_s6_portable-utils "s6-portable-utils"
    _run build_oblibs "oblibs"
    _run build_66 "66"
    _run build_66-tools "66-tools"
    
    cd ${TMP}
    
    _run cp_skeleton "copy"
    
    # build and remove a dummy tree to have the /usr/share/66 created
    66-tree -n dummy
    66-tree -R dummy
    _run prepare_boot "build"
    _run build_tree "build"
    _run build_tree_root "build"
    
    # reboot of the machine
    66-hpr -r -f
    

    I saw that Antix rely on elogind. You can make a service for it easily.

    Create the file /etc/66/service/elogind with:

    [main]
    @type = longrun
    @version = 0.0.1
    @description = "elogind daemon"
    @user = ( root )
    
    [start]
    @execute = ( elogind )
    
    [stop]
    @execute = ( s6-rmrf ${pid_file} )
    
    [environment]
    pid_file=!/run/elogind.pid
    

    I don’t know if its works or not on Antix. Not tested. Maybe a dependency to dbus need to be made?!?.

    Note: usually distro install the services at /usr/share/66/service and sysadmin install it at /etc/66/services. The /etc/66/services take precedence over /usr/share/66/service.

    So, now to enable it
    # 66-enable elogind

    and to start it
    # 66-start elogind

    Also, to configure your boot you can use

    # 66-env -t boot -e mcedit boot@system

    Change what you want and enable it again to apply the changes

    # 66-enable -t boot -F boot@system

    To reboot the machine correctly

    sudo 66-shutdown -r now

    To power off the machine correctly

    sudo 66-shutdown -p now

    Enjoy 🙂

    • This reply was modified 7 months, 3 weeks ago by eric.
    • This reply was modified 7 months, 3 weeks ago by eric.
    • This reply was modified 7 months, 3 weeks ago by eric.
    #54941
    Member
    oops
    Helpful
    Up
    0

    @Ă©ric … Thank you for the tuto.

    #55029
    Forum Admin
    anticapitalista
    Helpful
    Up
    0

    I built 66 compatible debs for skalibs, execline, s6, s6-rc, s6-linux-utils, s6-portable-utils for buster, bullseye, testing and sid repos.
    Should arrive soon.
    I’ll try and build 66 debs when I get time.

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #55030
    Member
    fungalnet
    Helpful
    Up
    0

    How are those s6 pkgs separated from Debian’s versions?

    #55031
    Forum Admin
    anticapitalista
    Helpful
    Up
    0

    How are those s6 pkgs separated from Debian’s versions?

    At the moment they have an antix suffix. This won’t affect buster versions since Debian won’t upgrade them and they won’t get overwritten.
    For sid/testing we might need to make sure we have a long-term solution to avoid any Debian upgrades overwriting our debs.

    Debian has skalibs, execlines and s6 in their repos. They do not have the other debs nor any Obarun 66 debs.

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #55076
    Forum Admin
    anticapitalista
    Helpful
    Up
    0

    @eric I tried the script on 32 bit antiX-19 – all seems well (no compile failures), but reboots to no init (Asked to Control D or give root password).
    Can s6/66 work on 32 bit?

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #55097
    Member
    fungalnet
    Helpful
    Up
    0

    The standard method to troubleshoot is to first edit /etc/66/init.conf and turn verbosity to 4 (max) reboot and see what is in /run/66/log/0/current

    Also if you can mount manually your root “mount -o remount,rw /dev/sdaxx /” and look at “66-intree -g boot” output.
    At that point if you try “66-all -v4 -t boot up” it will probably show you the first thing that fails in boot.
    If you see something you can fix by configuring the boot module you can edit and reboot, but since s6 is not pid1 the boot process will not complete. For getting a sulogin and having no tty12 the boot process failed too early.

    /sbin/init says “66-boot -m ” right and it is chmoded +x ?

    Since 66 has been in void for a long while if there was a problem with 32b or any of the architectures they support I would have heard something about it. Void rarely makes exceptions in adopting software that are architecture specific.

    Hopefully Eric can throw more light into the problem.

    #55098
    Forum Admin
    anticapitalista
    Helpful
    Up
    0

    Thanks fungalnet.

    I get this message at boot after enabling max verbosity.

    sulogin(): 84): warning : unable to wait for : 66-scandir

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

    #55103
    Moderator
    Brian Masinick
    Helpful
    Up
    0

    I was just looking at https://skarnet.org/ where s6 is used, distributed, and one of the very best models possible of efficient server use is displayed. The server has only had one security issue EVER (in 2003) and never since; only due to network host and domain server issues has the environment had issues. the current system Kernel excluded, the amount of memory in use is: 135428 kB, very impressive indeed.

    If the home of s6 is this well designed, developed and maintained, it’s a good model for a minimal, single purpose init / process scheduler. I hope we’ll get to a place where this can be our routine, every day, preferred choice init system, once we understand and implement it properly; in the meantime, runit is a viable alternative, sysvinit is “OK”, but has shortcomings and is really obsolete, so it’s worth figuring out how to install, configure, and manage this alternative. The people who put it together really understand fast, simple, single purpose stuff that’s in the true spirit of the original UNIX way, but takes advantage of lessons learned and best practice implementations. I’m looking forward to it.

    Brian Masinick

    #55104
    Moderator
    Brian Masinick
    #55123
    Member
    fungalnet
    Helpful
    Up
    0

    the -m option on 66-boot forces the /run tmpfs to be rw on debian. On Arch it doesn’t need this.
    I remember mount on debian/antix for a while wouldn’t mount if the target is not empty, unless a special swtich –non-empty was used, which I think has been deprecated on sid??? Compare the static directories of both your experiments if the /run is empty or not. I know runit creates a permanent /run/runit

    Sometimes Eric is unreachable in the weekends .. so allow him some time.

    • This reply was modified 7 months, 2 weeks ago by fungalnet.
    #55129
    Member
    eric
    Helpful
    Up
    0

    Can s6/66 work on 32 bit?

    It should work whatever the architecture. Also, it can be build with GCC,clang or musl. It should work on BSD and Solaris but never tested yet.

    sulogin(): 84): warning : unable to wait for : 66-scandir

    You seem to have a PATH definition problem here. Note: if you get a sulogin that means that the issue occur before launching any services even the main svscan responsible of the PID1. So the issue is on the 66-boot program itself. In your case the PATH of the 66-scandir cannot be found. The path is define at /etc/66/init.conf file but obviously it also depends of how the software was build. See below.

    Debian has skalibs, execlines and s6 in their repos.

    Apparently you use the skalibs, execline and s6 directly from debian repo which is a very bad idea because debian dev do not compile and install the skarnet softwares correctly in particular for execline. As far as i know, the execline package is completely broken. Laurent Bercot struggled a lot with debian dev about this and they do not install it correctly for obscure reason. At the last new of what i know about this, they say that execline is not a POSIX program(i never see a programs which respect the POSIX standard as many as skarnet programs) whereas systemd is it lol.

    So, i advise you to build by your own the skarnet package and to define a correct path at build time. Also, you need to respect a good order to get a correct build.
    the order is:
    1) skalibs
    2) execline
    3) s6
    4) s6-rc, s6-portable-utils, s6-linux-utils
    5) oblibs
    6) 66, 66-tools

    The s6-portable-utils and s6-linux-utils is not strictly mandatory for 66 and 66-tools but its needed for the boot@-66serv service.

    When you build it with the script that i posted all goes well. So yeah, debian bullshit…

    • This reply was modified 7 months, 2 weeks ago by eric.
    • This reply was modified 7 months, 2 weeks ago by eric.
    #55134
    Forum Admin
    anticapitalista
    Helpful
    Up
    0

    Thanks eric.

    However, your script works fine with 64bit but not 32 bit antiX.

    I didn’t use any skarnet debs from Debian. I have repackaged them to work on antiX with 66.
    (64 bit for now). Testing, but it does work.

    As I said, I get the boot error mentioned after installing antiX 32 bit, then running your script.
    The script completes without error.

    Philosophers have interpreted the world in many ways; the point is to change it.

    antiX with runit - leaner and meaner.

Viewing 15 posts - 16 through 30 (of 67 total)
  • You must be logged in to reply to this topic.