• write your own /sbin/init

    From Alexey Vissarionov@2:5020/545 to Dave Vandermeer on Fri Aug 11 11:14:44 2017
    Good ${greeting_time}, Dave!

    10 Aug 2017 12:39:10, you wrote to Maurice Kinal:

    Personally I am blaming systemd. It appeared to me that it was
    99.99% of the console grief I was seeing.
    All distro's should give the option of fallback to OpenRC init for
    those that don't want to run Gnome3 .. systemd is nothing but a pain
    in the ass

    People who use userspace crocks like udev and systemd simply don't know how to use the kernel. And the /sbin/init itself may be as simple as

    #include <signal.h>
    #include <unistd.h>

    int main(void)
    {
    sigset_t set;
    int status;

    if(getpid() != 1)
    return 1; /* change to running /etc/rc with given arguments if you need */

    sigfillset(&set);
    sigprocmask(SIG_BLOCK, &set, NULL);

    if(fork())
    {
    for(;;)
    wait(&status);
    }
    else
    {
    sigprocmask(SIG_UNBLOCK, &set, NULL);
    setsid();
    setpgrp();
    return execve("/etc/rc",
    (char *[]){"rc", NULL},
    (char *[]){NULL});
    }
    }


    --
    Alexey V. Vissarionov aka Gremlin from Kremlin
    gremlin.ru!gremlin; +vii-cmiii-cmlxxvii-mmxlviii

    ... that's why I really dislike fools.
    --- /bin/vi
    * Origin: http://openwall.com/Owl (2:5020/545)