From dd5cfb9017c0c6ac233faf4fb17ebfa8a2101cf8 Mon Sep 17 00:00:00 2001 From: Igor Ivanov Date: Tue, 14 Jul 2020 21:33:31 +0300 Subject: [PATCH] Use vmad for systemd Signed-off-by: Igor Ivanov --- Makefile.am | 9 --------- contrib/scripts/vma.service.in | 3 +-- tools/daemon/daemon.c | 5 ----- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6eecd5af..dc01e13e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,23 +23,14 @@ mydoc_DATA = README.txt journal.txt VMA_VERSION install-exec-hook: if type systemctl >/dev/null 2>&1; then \ - cp $(top_builddir)/contrib/scripts/vma.init $(DESTDIR)$(sbindir)/vma; \ - chmod 755 $(DESTDIR)$(sbindir)/vma; \ mkdir -p $(DESTDIR)$(prefix)/lib/systemd/system/; \ cp $(top_builddir)/contrib/scripts/vma.service $(DESTDIR)$(prefix)/lib/systemd/system/vma.service; \ chmod 644 $(DESTDIR)$(prefix)/lib/systemd/system/vma.service; \ - else \ - mkdir -p $(DESTDIR)/$(sysconfdir)/init.d; \ - cp $(top_builddir)/contrib/scripts/vma.init $(DESTDIR)$(sysconfdir)/init.d/vma; \ - chmod 755 $(DESTDIR)$(sysconfdir)/init.d/vma; \ fi uninstall-hook: if type systemctl >/dev/null 2>&1; then \ - rm -rf $(DESTDIR)$(sbindir)/vma; \ rm -rf $(DESTDIR)$(prefix)/lib/systemd/system/vma.service; \ - else \ - rm -rf $(DESTDIR)$(sysconfdir)/init.d/vma; \ fi install-all: install diff --git a/contrib/scripts/vma.service.in b/contrib/scripts/vma.service.in index 13457b2f..e6f5a25b 100644 --- a/contrib/scripts/vma.service.in +++ b/contrib/scripts/vma.service.in @@ -5,8 +5,7 @@ After=network.target [Service] Type=forking Restart=on-failure -ExecStart=@prefix@/sbin/vma start -ExecStop=@prefix@/sbin/vma stop +ExecStart=@prefix@/sbin/vmad RestartForceExitStatus=1 SIGTERM [Install] diff --git a/tools/daemon/daemon.c b/tools/daemon/daemon.c index 4444258d..9d23395a 100644 --- a/tools/daemon/daemon.c +++ b/tools/daemon/daemon.c @@ -66,11 +66,6 @@ int main(int argc, char *argv[]) /* Setup syslog logging */ openlog(MODULE_NAME, LOG_PID, LOG_LOCAL5); - /* already a daemon */ - if (getppid() == 1) { - return 0; - } - /* command line parsing... */ config_def(); log_info("Starting\n"); -- 2.18.1