From 82facbba8898fd8915039f4318efbb708983fd93 Mon Sep 17 00:00:00 2001 From: emanuele-f Date: Wed, 12 Dec 2018 16:02:41 +0100 Subject: [PATCH] Add n2n-ntopng to bind the services lifetimes --- packages/debian/configure.in | 1 + .../etc/systemd/system/edge-ntopng@.service.in | 16 ++++++++++++++++ packages/rpm/configure.in | 1 + packages/rpm/n2n.spec.in | 1 + 4 files changed, 19 insertions(+) create mode 100644 packages/etc/systemd/system/edge-ntopng@.service.in diff --git a/packages/debian/configure.in b/packages/debian/configure.in index 168d57a..bbea7a3 100644 --- a/packages/debian/configure.in +++ b/packages/debian/configure.in @@ -39,6 +39,7 @@ AC_CONFIG_FILES(debian/control) AC_CONFIG_FILES(debian/rules) AC_CONFIG_FILES(../etc/systemd/system/edge.service) AC_CONFIG_FILES(../etc/systemd/system/edge@.service) +AC_CONFIG_FILES(../etc/systemd/system/edge-ntopng@.service) AC_CONFIG_FILES(../etc/systemd/system/supernode.service) AC_CONFIG_FILES(Makefile) AC_OUTPUT diff --git a/packages/etc/systemd/system/edge-ntopng@.service.in b/packages/etc/systemd/system/edge-ntopng@.service.in new file mode 100644 index 0000000..4c8a666 --- /dev/null +++ b/packages/etc/systemd/system/edge-ntopng@.service.in @@ -0,0 +1,16 @@ +[Unit] +Description=n2n edge process, on %I +After=network.target syslog.target +Wants= +BindsTo=ntopng.service + +[Service] +Type=simple +ExecStartPre= +ExecStart=/usr/sbin/edge /etc/n2n/edge-%i.conf -f +Restart=on-abnormal +RestartSec=5 + +[Install] +WantedBy=ntopng.service +Alias= diff --git a/packages/rpm/configure.in b/packages/rpm/configure.in index cddb0b4..708114d 100644 --- a/packages/rpm/configure.in +++ b/packages/rpm/configure.in @@ -38,6 +38,7 @@ AC_SUBST(REVISION) AC_CONFIG_FILES(n2n.spec) AC_CONFIG_FILES(../etc/systemd/system/edge.service) AC_CONFIG_FILES(../etc/systemd/system/edge@.service) +AC_CONFIG_FILES(../etc/systemd/system/edge-ntopng@.service) AC_CONFIG_FILES(../etc/systemd/system/supernode.service) AC_CONFIG_FILES(Makefile) AC_OUTPUT diff --git a/packages/rpm/n2n.spec.in b/packages/rpm/n2n.spec.in index 5d44271..e28e712 100644 --- a/packages/rpm/n2n.spec.in +++ b/packages/rpm/n2n.spec.in @@ -48,6 +48,7 @@ rm -fr $RPM_BUILD_ROOT /usr/share/man/man8/edge.8.gz /usr/lib/systemd/system/edge.service /usr/lib/systemd/system/edge@.service +/usr/lib/systemd/system/edge-ntopng@.service /usr/lib/systemd/system/supernode.service %config(noreplace) /etc/n2n/supernode.conf.sample %config(noreplace) /etc/n2n/edge.conf.sample