From ebdbbc2ff0f412046a7cf1299825b24489feae8d Mon Sep 17 00:00:00 2001 From: crumpetalpaca Date: Sat, 28 Mar 2026 09:57:27 +0000 Subject: fix: Make it so runit users specify services directory --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0353e95..0181228 100644 --- a/Makefile +++ b/Makefile @@ -76,6 +76,7 @@ USER := omnisearch GROUP := omnisearch SYSTEMD_DIR := /etc/systemd/system +RUNIT_DIR ?= $(error Please set RUNIT_DIR to your services directory) OPENRC_DIR := /etc/init.d DINIT_DIR := /etc/dinit.d LAUNCHD_DIR ?= /Library/LaunchDaemons @@ -151,7 +152,7 @@ install-openrc: $(TARGET) @echo "Run 'rc-update add omnisearch default' to enable" install-runit: $(TARGET) - @mkdir -p $(DATA_DIR)/templates $(DATA_DIR)/static $(LOG_DIR) $(CACHE_DIR) /etc/service/omnisearch/log/ + @mkdir -p $(DATA_DIR)/templates $(DATA_DIR)/static $(LOG_DIR) $(CACHE_DIR) $(RUNIT_DIR)/omnisearch/log/ @cp -rf templates/* $(DATA_DIR)/templates/ @cp -rf static/* $(DATA_DIR)/static/ @cp -n example-config.ini $(DATA_DIR)/config.ini || true @@ -161,15 +162,15 @@ install-runit: $(TARGET) @id -u $(USER) >/dev/null 2>&1 || useradd --system --home $(DATA_DIR) --shell /usr/sbin/nologin -g $(GROUP) $(USER) @chown -R $(USER):$(GROUP) $(LOG_DIR) $(CACHE_DIR) $(VAR_DIR) $(DATA_DIR) 2>/dev/null || true @chown $(USER):$(GROUP) $(DATA_DIR)/config.ini 2>/dev/null || true - install -m 755 init/runit/run /etc/service/omnisearch/run - install -m 755 init/runit/log/run /etc/service/omnisearch/log/run + install -m 755 init/runit/run $(RUNIT_DIR)/omnisearch/run + install -m 755 init/runit/log/run $(RUNIT_DIR)/omnisearch/log/run @echo "" @echo "Config: $(DATA_DIR)/config.ini" @echo "Edit config with: nano $(DATA_DIR)/config.ini" - @echo "Installed runit service to /etc/service/omnisearch" + @echo "Installed runit service to $(RUNIT_DIR)/omnisearch" @echo "You need to start the service manually" - @echo "Void: ln -s /etc/service/omnisearch/ /var/service" - @echo "Artix: ln -s /etc/service/omnisearch/ /run/runit/" + @echo "Void: ln -s $(RUNIT_DIR)/omnisearch/ /var/service/" + @echo "Artix: ln -s $(RUNIT_DIR)/omnisearch/ /run/runit/" install-s6: $(TARGET) @mkdir -p $(DATA_DIR)/templates $(DATA_DIR)/static $(LOG_DIR) $(CACHE_DIR) @@ -218,6 +219,7 @@ uninstall: rm -f $(DINIT_DIR)/omnisearch rm -rf /etc/service/omnisearch rm -rf /var/service/omnisearch + @echo "You might need to unlink omnisearch if you're using runit" @id -u $(USER) >/dev/null 2>&1 && userdel $(USER) 2>/dev/null || true @grep -q '^$(GROUP):' /etc/group 2>/dev/null && groupdel $(GROUP) 2>/dev/null || true @echo "Uninstalled omnisearch" -- cgit v1.2.3