summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile7
2 files changed, 7 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index ea247f6..1c3f37a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@
# Caches
/logs
/data
-/pid \ No newline at end of file
+/pid
+/logger_*.log \ No newline at end of file
diff --git a/Makefile b/Makefile
index e17d8d7..7d032f4 100644
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,11 @@ logger: src/logger.c src/utils.c
$(CC) $^ -o $@
publish: publisher logger
- rm -f pid
- ./logger $(LOGGERS_DIR) 587 $(LOG_INTERVAL) &> $(LOGGERS_DIR)/587.log & echo $$! >> pid
+ [ -f pid ] && { kill $(shell cat pid); rm pid; }
+ for client in $$(basename -a /home/loic/registers/*); \
+ do \
+ ./logger $(LOGGERS_DIR) $$client $(LOG_INTERVAL) &> logger_$${client}.log & echo $$! >> pid; \
+ done
./publisher $(LOGGERS_DIR) $(LOG_INTERVAL) $(SUBSCRIBER_ADDR) $(ZMQ_PORT) $(KEY)
subscribe: subscriber