fix: Make it so runit users specify services directory
This commit is contained in:
parent
82075a664e
commit
ebdbbc2ff0
1 changed files with 8 additions and 6 deletions
14
Makefile
14
Makefile
|
|
@ -76,6 +76,7 @@ USER := omnisearch
|
||||||
GROUP := omnisearch
|
GROUP := omnisearch
|
||||||
|
|
||||||
SYSTEMD_DIR := /etc/systemd/system
|
SYSTEMD_DIR := /etc/systemd/system
|
||||||
|
RUNIT_DIR ?= $(error Please set RUNIT_DIR to your services directory)
|
||||||
OPENRC_DIR := /etc/init.d
|
OPENRC_DIR := /etc/init.d
|
||||||
DINIT_DIR := /etc/dinit.d
|
DINIT_DIR := /etc/dinit.d
|
||||||
LAUNCHD_DIR ?= /Library/LaunchDaemons
|
LAUNCHD_DIR ?= /Library/LaunchDaemons
|
||||||
|
|
@ -151,7 +152,7 @@ install-openrc: $(TARGET)
|
||||||
@echo "Run 'rc-update add omnisearch default' to enable"
|
@echo "Run 'rc-update add omnisearch default' to enable"
|
||||||
|
|
||||||
install-runit: $(TARGET)
|
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 templates/* $(DATA_DIR)/templates/
|
||||||
@cp -rf static/* $(DATA_DIR)/static/
|
@cp -rf static/* $(DATA_DIR)/static/
|
||||||
@cp -n example-config.ini $(DATA_DIR)/config.ini || true
|
@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)
|
@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 -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
|
@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/run $(RUNIT_DIR)/omnisearch/run
|
||||||
install -m 755 init/runit/log/run /etc/service/omnisearch/log/run
|
install -m 755 init/runit/log/run $(RUNIT_DIR)/omnisearch/log/run
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Config: $(DATA_DIR)/config.ini"
|
@echo "Config: $(DATA_DIR)/config.ini"
|
||||||
@echo "Edit config with: nano $(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 "You need to start the service manually"
|
||||||
@echo "Void: ln -s /etc/service/omnisearch/ /var/service"
|
@echo "Void: ln -s $(RUNIT_DIR)/omnisearch/ /var/service/"
|
||||||
@echo "Artix: ln -s /etc/service/omnisearch/ /run/runit/"
|
@echo "Artix: ln -s $(RUNIT_DIR)/omnisearch/ /run/runit/"
|
||||||
|
|
||||||
install-s6: $(TARGET)
|
install-s6: $(TARGET)
|
||||||
@mkdir -p $(DATA_DIR)/templates $(DATA_DIR)/static $(LOG_DIR) $(CACHE_DIR)
|
@mkdir -p $(DATA_DIR)/templates $(DATA_DIR)/static $(LOG_DIR) $(CACHE_DIR)
|
||||||
|
|
@ -218,6 +219,7 @@ uninstall:
|
||||||
rm -f $(DINIT_DIR)/omnisearch
|
rm -f $(DINIT_DIR)/omnisearch
|
||||||
rm -rf /etc/service/omnisearch
|
rm -rf /etc/service/omnisearch
|
||||||
rm -rf /var/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
|
@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
|
@grep -q '^$(GROUP):' /etc/group 2>/dev/null && groupdel $(GROUP) 2>/dev/null || true
|
||||||
@echo "Uninstalled omnisearch"
|
@echo "Uninstalled omnisearch"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue