commit 85b358db4afcecf30d9c37c2c231cb250bf74f4d
parent 0d5086a1638c70580e7643a89ca1f4f4dc288b80
Author: Friedel Schön <[email protected]>
Date: Mon, 12 Jun 2023 14:36:06 +0200
making reboot work
Diffstat:
3 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/bin/fsvs.c b/bin/fsvs.c
@@ -53,7 +53,10 @@ int main(int argc, char** argv) {
print_usage_exit(PROG_FSVS, 1);
}
- signal(SIGINT, signal_interrupt);
+ struct sigaction sa = { 0 };
+ sa.sa_handler = signal_interrupt;
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
return service_supervise(argv[0], argv[1]);
}
diff --git a/mk/install.mk b/mk/install.mk
@@ -7,7 +7,7 @@ install: install-binary \
install-etc
install-binary: $(BIN_FILES)
-ifeq ($(INSTALL_SBIN),)
+ifneq ($(INSTALL_SBIN),)
@install -vd $(INSTALL_PREFIX)/$(INSTALL_SBIN)
@for file in $(BIN_FILES); do \
install -v -m 755 $$file $(INSTALL_PREFIX)/$(INSTALL_SBIN); \
@@ -15,7 +15,7 @@ ifeq ($(INSTALL_SBIN),)
endif
install-documentation: $(DOCS_FILES)
-ifeq ($(INSTALL_DOCS),)
+ifneq ($(INSTALL_DOCS),)
@install -vd $(INSTALL_PREFIX)/$(INSTALL_DOCS)
@for file in $(DOCS_FILES); do \
install -v -m 644 $$file $(INSTALL_PREFIX)/$(INSTALL_DOCS); \
@@ -23,7 +23,7 @@ ifeq ($(INSTALL_DOCS),)
endif
install-manual: $(ROFF_FILES)
-ifeq ($(INSTALL_MAN8),)
+ifneq ($(INSTALL_MAN8),)
@install -vd $(INSTALL_PREFIX)/$(INSTALL_MAN8)
@for file in $(ROFF_FILES); do \
install -v -m 644 $$file $(INSTALL_PREFIX)/$(INSTALL_MAN8); \
@@ -31,7 +31,7 @@ ifeq ($(INSTALL_MAN8),)
endif
install-share:
-ifeq ($(INSTALL_SHARE),)
+ifneq ($(INSTALL_SHARE),)
@install -vd $(INSTALL_PREFIX)/$(INSTALL_SHARE)/fiss
@for file in share/fiss/*; do \
install -v -m 644 $$file $(INSTALL_PREFIX)/$(INSTALL_SHARE)/fiss; \
@@ -39,7 +39,7 @@ ifeq ($(INSTALL_SHARE),)
endif
install-etc:
-ifeq ($(INSTALL_ETC),)
+ifneq ($(INSTALL_ETC),)
@install -vd $(INSTALL_PREFIX)/$(INSTALL_ETC)/service.d
@install -vd $(INSTALL_PREFIX)/$(INSTALL_ETC)/start.d
@install -vd $(INSTALL_PREFIX)/$(INSTALL_ETC)/stop.d
diff --git a/src/supervise.c b/src/supervise.c
@@ -85,12 +85,6 @@ static void control_sockets(void) {
}
}
-void signal_interrupt(int signo) {
- (void) signo;
-
- daemon_running = false;
-}
-
int service_supervise(const char* service_dir_, const char* runlevel_) {
struct sigaction sigact = { 0 };
service_t* s;
@@ -99,9 +93,6 @@ int service_supervise(const char* service_dir_, const char* runlevel_) {
sigact.sa_handler = signal_child;
sigaction(SIGCHLD, &sigact, NULL);
- sigact.sa_handler = signal_interrupt;
- sigaction(SIGINT, &sigact, NULL);
- sigaction(SIGTERM, &sigact, NULL);
sigact.sa_handler = SIG_IGN;
sigaction(SIGPIPE, &sigact, NULL);
@@ -160,7 +151,5 @@ int service_supervise(const char* service_dir_, const char* runlevel_) {
signal(SIGPIPE, SIG_DFL);
signal(SIGCHLD, SIG_DFL);
- signal(SIGINT, SIG_DFL);
- signal(SIGCONT, SIG_DFL);
return 0;
}