Skip to main content

Gnuinos non-systemd based Suda

Gnuinos based Suda.

(Building a non-systemd based version of Suda which runs as a live distribution from Usb stick or dvd and is also installable.)

Gnuinos is a non fsf approved remix of my preferred distribution,Devuan linux, which strives to be fully libre. Devuan linux is based on Debian but without systemd - it can be considered a hard fork. Devuan allows non-free firmware and software ( non-free in the sense of not being fully Libre), Gnuinos does not.

More information and download links for Gnuinos here https://gnuinos.org/

This version of suda is put together as a proof of concept as it is both 32bit meaning it can run on older 32bit computers or computers which can only run a 32 bit os due to uefi restrictions ( some intel based tablets and such like) and non-systemd encumbered.

Being non-systemd means that the systemd controls for creating and bringing up services such as x11vnc and novnc that the online and iso versions of suda rely on are not present  as Gnuinos uses either sysvinit or openrc to manage services
and we have to adapt to that. In all other respects Gnuinos works in much the same way as The Parabola or Trisquel versions. In this 32 bit version of Gnuinos based suda I’m using the sysvinit init system.

As before I've used older machines to install modify and test this version( in this case a lenovo G550 )

I don’t want to duplicate information from the Trisquel write up so Ill confine myself to pointing out the modifications made. The software installed and the scripts that give  suda its look and feel are pretty much the same.

Like Trisquel I had to modify the /etc/lxdm/default.conf file to allow the glitchify script to run correctly, so I altered this line

# arg=/usr/bin/X -background vt1

by uncommenting the # and changing vt1 to vt7 so the line now reads as this

arg=/usr/bin/X -background vt7

this change is also important for when making the iso that runs in live mode and avoids a black screen with no desktop after booting.

The next thing we need to do is set up x11vnc to start at boot. On systemd Distros we would just follow the guide set out here

https://jasonschaefer.com/setup-x11vnc-server-with-systemd-auto-start-up/

which has good examples of  configuration files and how to set it all up. We need x11vnc to start at boot so that suda can be accessed via novnc in a web browser from another computer on the same network.

Having installed x11vnc using ‘sudo apt install x11vnc’ and also installing open sshserver we need to password protect both x11vnc access and be able to ssh into the machine we then need to set an x11vnc password as root ( so users cant change it randomly) by doing this

‘sudo x11vnc -storepasswd /etc/x11vnc.pwd’

To start the service we create an init script in /etc/init.d/x11vnc . which looks like this :

#!/bin/sh
### BEGIN INIT INFO
# Provides:    x11vnc
# Required-Start:    $local_fs $remote_fs x11-common lxdm
# Required-Stop:     $local_fs $remote_fs $syslog
# Should-Stop:       $named
#Default-Start:      3  5
#Default-Stop:      0 1 6
# Short-Description: x11vnc remote x via ssh
# Description:       Enable service provided by daemon.
### END INIT INFO

dir="/usr/bin/"
##check this points to correct passwd location
cmd="x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /etc/xllvnc.pwd -rfbport 5900 -shared -o /var/log/x11vnc.log"
user=""

name=`basename $0`
pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"

get_pid() {
    cat "$pid_file"
}

is_running() {
    [ -f "$pid_file" ] && ps -p `get_pid` > /dev/null 2>&1
}

case "$1" in
    start)
    if is_running; then
        echo "Already started"
    else
        echo "Starting $name"
        cd "$dir"
        if [ -z "$user" ]; then
            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
        else
            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
        fi
        echo $! > "$pid_file"
        if ! is_running; then
            echo "Unable to start, see $stdout_log and $stderr_log"
            exit 1
        fi
    fi
    ;;
    stop)
    if is_running; then
        echo -n "Stopping $name.."
        kill `get_pid`
        for i in 1 2 3 4 5 6 7 8 9 10
        # for i in `seq 10`
        do
            if ! is_running; then
                break
            fi

            echo -n "."
            sleep 1
        done
        echo

        if is_running; then
            echo "Not stopped; may still be shutting down or shutdown may have failed"
            exit 1
        else
            echo "Stopped"
            if [ -f "$pid_file" ]; then
                rm "$pid_file"
            fi
        fi
    else
        echo "Not running"
    fi
    ;;
    restart)
    $0 stop
    if is_running; then
        echo "Unable to stop, will not attempt to start"
        exit 1
    fi
    $0 start
    ;;
    status)
    if is_running; then
        echo "Running"
    else
        echo "Stopped"
        exit 1
    fi
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit 0

unlike the systemd versions of suda we wont start this service at boot but instead call it via  /etc/lxdm/PreLogin which allows us to then launch noVNC via script by adding it to the login script /etc/lxdm/PostLogin ( noVNC needs x11vnc to be running before it can be launched) along with the launchers for the scripts that make the suda environment ie glitchify.sh & ./sudacam1.sh & ./sudacam2.sh &./manifesto.sh in that order.

the ./vncup.sh shell script calls noVNC from where I have placed it in /etc/

and once running should be reachable via web-browser on a seperate machine running on the same network via

 http://'ip address of server':6080/vnc.html?host=medialab&port=6080

if you don't want x11vnc or no VNC to run at PreLogin and PostLogin  you can comment out the appropriate entries in the configuration files in /etc/lxdm/

The final alteration to make is for a running instance of the live environment. Ive discovered that when running live from usb stick or DVD ( still a viable alternative on older Machines) if the user logs out of the ctwm environment the login screen does not appear and unless you understand how to navigate to another virtual tty by using ctrl+alt+f'1-9' and restarting the xserver by logging in and running sudo /etc/init.d/lxdm restart from the terminal ( the live version is set to autologin in the user suda via the /etc/lxdm/default.conf file so we don't after boot see the user login screen ) for all intents and purposes the session is halted , to get round that problem for ordinary users who might for whatever reason logout I've altered the /etc/lxdm/ PostLogout file by adding  /etc/init.d/lxdm restart which restarts the x session and automatically logs the user back in to the suda ctwm desktop.

Obviously if a user wanted to use the included refractainstaller script it would be advisable to turn off the PostLogout alterations by commenting out that line  , and those in PostLogin , restarting the xserver and proceeding from there.

Also  note that running the iso in Live mode its important for the machine running it to be attached to a Lan via ethernet cable rather than wifi. This makes it easier for the network services such a x11vnc and noVNC to start and for the suda instance to be discoverable otherwise Suda will not be contactable until wifi has been set up via simple-netaid-vte3 then doing :
sudo dchlient eth0 (for ethernet)
sudo dhclient wlan0 (for wireless)
in the first instance and connman-gtk afterwards (though these methods imply being an a network which gives out internal network addresses).