From 3a320ba301797f9d1f3c632a9b5a38fcd3cb1e48 Mon Sep 17 00:00:00 2001 From: Jeremy MAURO Date: Wed, 25 Oct 2017 01:35:25 +0200 Subject: [PATCH] Add a systemd exabgp instance service - Add systemd instance exabgp@ - Add the exabgp@.service in all the Redhat spec file Note: Not able to add the exabgp@.service for debian distribution Signed-off-by: Jeremy MAURO --- etc/systemd/exabgp@.service | 16 ++++++++++++++++ redhat/python-exabgp.spec | 1 + redhat/python-exabgp.spec.git | 1 + 3 files changed, 18 insertions(+) create mode 100644 etc/systemd/exabgp@.service diff --git a/etc/systemd/exabgp@.service b/etc/systemd/exabgp@.service new file mode 100644 index 000000000..1062be8d4 --- /dev/null +++ b/etc/systemd/exabgp@.service @@ -0,0 +1,16 @@ +[Unit] +Description=ExaBGP for instance %i +Documentation=man:exabgp(1) +Documentation=man:exabgp.conf(5) +Documentation=https://github.com/Exa-Networks/exabgp/wiki +After=network.target +ConditionPathExists=/etc/exabgp/exabgp-%i.conf + +[Service] +Environment=exabgp_daemon_daemonize=false +Environment=EXABGP_INSTANCE=exabgp-%i +ExecStart=/usr/sbin/exabgp /etc/exabgp/${EXABGP_INSTANCE}.conf +ExecReload=/bin/kill -USR1 $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/redhat/python-exabgp.spec b/redhat/python-exabgp.spec index 895ddce71..064181b65 100644 --- a/redhat/python-exabgp.spec +++ b/redhat/python-exabgp.spec @@ -50,6 +50,7 @@ mv ${RPM_BUILD_ROOT}/usr/etc/exabgp ${RPM_BUILD_ROOT}/%{_sysconfdir}/ install -d %{buildroot}/%{_unitdir} install etc/systemd/exabgp.service %{buildroot}/%{_unitdir}/ +install etc/systemd/exabgp@.service %{buildroot}/%{_unitdir}/ install -d %{buildroot}/%{_mandir}/man1 install doc/man/exabgp.1 %{buildroot}/%{_mandir}/man1 diff --git a/redhat/python-exabgp.spec.git b/redhat/python-exabgp.spec.git index bd0c39790..ab6998bc6 100644 --- a/redhat/python-exabgp.spec.git +++ b/redhat/python-exabgp.spec.git @@ -60,6 +60,7 @@ mv ${RPM_BUILD_ROOT}/usr/share/exabgp/etc/* ${RPM_BUILD_ROOT}/%{_sysconfdir}/exa install -d %{buildroot}/%{_unitdir} install etc/systemd/exabgp.service %{buildroot}/%{_unitdir}/ +install etc/systemd/exabgp@.service %{buildroot}/%{_unitdir}/ install -d %{buildroot}/%{_mandir}/man1 install doc/man/exabgp.1 %{buildroot}/%{_mandir}/man1