From 5db09ce1044608bb628e084ad9b9ab4198b3c631 Mon Sep 17 00:00:00 2001 From: Daniel Haarhoff Date: Sun, 28 Aug 2022 11:53:58 +0100 Subject: [PATCH] Make it easy to install ly on runit systems e.g. void (#431) * Make it easy to install ly on runit systems e.g. void * Tidy up runit section in readme Co-authored-by: Daniel Haarhoff --- makefile | 5 +++++ readme.md | 20 ++++++++++++++++++++ res/ly-runit-service/conf | 14 ++++++++++++++ res/ly-runit-service/finish | 3 +++ res/ly-runit-service/run | 15 +++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 res/ly-runit-service/conf create mode 100644 res/ly-runit-service/finish create mode 100644 res/ly-runit-service/run diff --git a/makefile b/makefile index 6b9177d..8a4ce1a 100644 --- a/makefile +++ b/makefile @@ -98,6 +98,11 @@ installopenrc: @echo "installing openrc service" @install -DZ $(RESD)/ly-openrc -m 755 -T ${DESTDIR}/etc/init.d/${NAME} +installrunit: + @echo "installing runit service" + @install -dZ ${DESTDIR}/etc/sv/ly-runit-service + @install -DZ $(RESD)/ly-runit-service/* -t ${DESTDIR}/etc/sv/ly + uninstall: @echo "uninstalling" @rm -rf ${DESTDIR}/etc/ly diff --git a/readme.md b/readme.md index 31c1309..389adae 100644 --- a/readme.md +++ b/readme.md @@ -111,6 +111,26 @@ If you choose a tty that already has a login/getty running (has a basic login pr # rc-update del agetty.tty2 ``` +### runit + +``` +$ make +# make install installrunit +# ln -s /etc/sv/ly /var/service/ +``` + +Disable your existing display manager service if need be e.g.: + +``` +# rm /var/service/lxdm +``` + +If you are running on `tty2` (check your `/etc/ly/config.ini`) you can disable e.g. `agetty` running there: + +``` +# rm /var/service/agetty-tty2 +``` + ## Arch Linux Installation You can install ly from the [AUR](https://aur.archlinux.org/packages/ly), using yay for example: ``` diff --git a/res/ly-runit-service/conf b/res/ly-runit-service/conf new file mode 100644 index 0000000..6f8be4c --- /dev/null +++ b/res/ly-runit-service/conf @@ -0,0 +1,14 @@ +if [ -x /sbin/agetty -o -x /bin/agetty ]; then + # util-linux specific settings + if [ "${tty}" = "tty1" ]; then + GETTY_ARGS="--noclear" + fi +fi + +BAUD_RATE=38400 +TERM_NAME=linux + +StandardInput=tty +TTYPath=/dev/tty2 +TTYReset=yes +TTYVHangup=yes \ No newline at end of file diff --git a/res/ly-runit-service/finish b/res/ly-runit-service/finish new file mode 100644 index 0000000..5c3c757 --- /dev/null +++ b/res/ly-runit-service/finish @@ -0,0 +1,3 @@ +#!/bin/sh +tty=${PWD##*-} +exec utmpset -w $tty \ No newline at end of file diff --git a/res/ly-runit-service/run b/res/ly-runit-service/run new file mode 100644 index 0000000..1257eef --- /dev/null +++ b/res/ly-runit-service/run @@ -0,0 +1,15 @@ +#!/bin/sh + +tty=${PWD##*-} + +[ -r conf ] && . ./conf + +if [ -x /sbin/getty -o -x /bin/getty ]; then + # busybox + GETTY=getty +elif [ -x /sbin/agetty -o -x /bin/agetty ]; then + # util-linux + GETTY=agetty +fi + +exec setsid ${GETTY} ${GETTY_ARGS} -nl /usr/bin/ly tty2 "${BAUD_RATE}" "${TERM_NAME}" \ No newline at end of file