From d3b6cbbdddb4c4b5c1f26e4d666eb49a6288682c Mon Sep 17 00:00:00 2001 From: Noname Blank Date: Mon, 13 Jul 2026 14:27:31 +0530 Subject: [PATCH] Fix: check for correct sv path and runsvdir improvements 1. The previous commit didn't account for correct "sv" path. 2. The previous setup gave priority to artix runit setup, but sv path was incorrect - Its "/etc/runit/sv", but accidentaly gave "/etc/sv" which dosen't exist. - So, improve it by adding various other check and make it a branch "if-elif" check. - Called '_runit_sv'. 3. Improve on/default to first check for current running system dir's insted. - Prioritise current running insted of Not/Enabled symlinked "/etc/runit/runsvdir/default". - Above should only gave priority if it is not enabled/running. - So, not recommended. link of ref: [1]: https://docs.voidlinux.org/config/services/index.html | Enabling Services [2]: https://wiki.gentoo.org/wiki/Runit#Runit_and_service_management | 3.4.2 [3]: https://wiki.artixlinux.org/Main/Runit | Basic usage Signed-off-by: Noname Blank --- setup.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index 0cc57eb..e150695 100755 --- a/setup.sh +++ b/setup.sh @@ -181,8 +181,19 @@ _disable_dm_dinit() { done } +_runit_sv() { + if [ -d /etc/sv ]; then echo "/etc/sv" + elif [ -d /etc/runit/sv ]; then echo "/etc/runit/sv" + else + error "Cannot find runit service configuration files directory" + return 1 + fi +} + _runit_runsvdir() { - if [ -d /run/runit/service ]; then echo "/run/runit/service" + if [ -d /service ]; then echo "/service" # legacy/upstream symlink + elif [ -d /var/service ]; then echo "/var/service" + elif [ -d /run/runit/service ]; then echo "/run/runit/service" elif [ -d /etc/runit/runsvdir/default ]; then echo "/etc/runit/runsvdir/default" else error "Cannot find runit service directory" @@ -230,16 +241,18 @@ enable_sddm() { ;; runit) + local sv local runsvdir + sv=$(_runit_sv) runsvdir=$(_runit_runsvdir) - if [ ! -d /etc/sv/sddm ]; then - error "/etc/sv/sddm not found - is sddm-runit (or equivalent) installed?" + if [ ! -d "$sv/sddm" ]; then + error "$sv/sddm not found - is sddm-runit (or equivalent) installed?" return 1 fi _disable_dm_runit - sudo ln -sf /etc/sv/sddm "$runsvdir/sddm" + sudo ln -sf "$sv/sddm" "$runsvdir/" info "sddm symlinked into $runsvdir" ;; @@ -268,7 +281,7 @@ enable_sddm() { echo "" echo " systemd - sudo systemctl enable --now sddm" echo " openrc - sudo rc-update add sddm default" - echo " runit - sudo ln -s /etc/sv/sddm /run/runit/service/" + echo " runit - sudo ln -s /etc/sv/sddm /var/service/ || sudo ln -s /etc/runit/sv/sddm /run/runit/service/" echo " dinit - sudo ln -s /etc/dinit.d/sddm /etc/dinit.d/boot.d/sddm" return 1 ;;