build(Makefile): abort with error when trying to start another singleton service

This commit is contained in:
Sarah Vaupel 2024-10-17 05:22:36 +02:00
parent c73c1360ed
commit 2e3153294a

View File

@ -13,7 +13,6 @@ export UNIWORXDB_OPTS ?= -cf
export CONTAINER_ID
export FRADRIVE_SERVICE
# TODO: to be deprecated
export DEV_PORT_HTTP
export DEV_PORT_HTTPS
export HOOGLE_PORT
@ -377,7 +376,6 @@ start-frontend: WATCH = false
# HELP(start-backend): serve yesod development site
# HELP(start-frontend): start frontend watcher. Watches frontend source files for changes and recompiles on change. (TODO: watcher functionality currently broken!)
# HELP(start-hoogle): serve local hoogle instance
# TODO: abort with error if a singleton service is already running
start-%: FRADRIVE_SERVICE = %
start-%: PORTS = $(foreach PORT,$(BASE_PORTS),$(shell utils/next_free_port.pl $(PORT)))
start-%: --develop
@ -386,6 +384,10 @@ start-%: --develop
echo "DEV $(DEVELOP)"
if [[ "$(SINGLETON)" = "true" ]]; then \
CONTAINER_FILE=$(DEVELOP)/$* ; \
if ! [[ -e $${CONTAINER_FILE} ]]; then \
>&2 echo "Another $* service is already running! Use \"make new-develop\" or \"make start\" to start a new develop instance despite currently running services." ; \
exit 1 ; \
fi \
else \
DEVDIR=$(DEVELOP)/$*; \
I=`ls $${DEVDIR} | sort -n | tail -n1`; \