diff --git a/debian/calico-compute.install b/debian/calico-compute.install index 9a61253..e69de29 100644 --- a/debian/calico-compute.install +++ b/debian/calico-compute.install @@ -1 +0,0 @@ -usr/bin/calico-dhcp-agent usr/bin diff --git a/debian/calico-dhcp-agent.install b/debian/calico-dhcp-agent.install new file mode 100644 index 0000000..9a61253 --- /dev/null +++ b/debian/calico-dhcp-agent.install @@ -0,0 +1 @@ +usr/bin/calico-dhcp-agent usr/bin diff --git a/debian/calico-dhcp-agent.upstart b/debian/calico-dhcp-agent.upstart new file mode 100644 index 0000000..bdbf374 --- /dev/null +++ b/debian/calico-dhcp-agent.upstart @@ -0,0 +1,13 @@ +# vim:set ft=upstart ts=2 et: +description "Calico DHCP agent" +author "Neil Jerram " + +start on stopped rc RUNLEVEL=[2345] +stop on runlevel [!2345] + +limit nofile 32000 32000 + +respawn +respawn limit 5 10 + +exec /usr/bin/calico-dhcp-agent --config-file /etc/neutron/neutron.conf diff --git a/debian/changelog b/debian/changelog index dcbf7d7..10c05f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +networking-calico (1:1.0.1~pre7) trusty; urgency=low + + * Add service framework around Calico DHCP agent + + -- Neil Jerram Tue, 02 Feb 2016 11:36:24 +0000 + networking-calico (1:1.0.1~pre1-6) trusty; urgency=low * devstack/bootstrap.sh: Don't set SERVICE_HOST diff --git a/debian/control b/debian/control index 641af3e..31328af 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: networking-calico Section: net Priority: optional -Maintainer: Project Calico Maintainers +Maintainer: Neil Jerram Build-Depends: debhelper (>= 8.0.0), python-all (>= 2.6), python-setuptools, python-pbr XS-Python-Version: >= 2.6 Standards-Version: 3.9.4 @@ -10,6 +10,7 @@ Package: calico-compute Architecture: all Depends: bird, + calico-dhcp-agent, calico-felix, networking-calico, neutron-dhcp-agent, @@ -27,6 +28,22 @@ Description: Project Calico networking for OpenStack/Neutron. . This package provides the pieces needed on a compute node. +Package: calico-dhcp-agent +Architecture: all +Depends: + networking-calico, + ${misc:Depends}, + ${python:Depends} +Description: Project Calico networking for OpenStack/Neutron. + Project Calico is an open source solution for virtual networking in + cloud data centers. It uses IP routing to provide connectivity + between the workloads in a data center that provide or use IP-based + services - whether VMs, containers or bare metal appliances; and + iptables, to impose any desired fine-grained security policy between + those workloads. + . + This package provides the Calico DHCP agent. + Package: calico-control Architecture: all Depends: diff --git a/rpm/calico-dhcp-agent.service b/rpm/calico-dhcp-agent.service new file mode 100644 index 0000000..6cdbe17 --- /dev/null +++ b/rpm/calico-dhcp-agent.service @@ -0,0 +1,13 @@ +[Unit] +Description=Calico DHCP agent +After=syslog.target network.target + +[Service] +User=root +ExecStart=/usr/bin/calico-dhcp-agent --config-file /etc/neutron/neutron.conf +KillMode=process +Restart=on-failure +LimitNOFILE=32000 + +[Install] +WantedBy=multi-user.target diff --git a/rpm/networking-calico.spec b/rpm/networking-calico.spec index 89f98f3..c930e2a 100644 --- a/rpm/networking-calico.spec +++ b/rpm/networking-calico.spec @@ -4,10 +4,11 @@ Name: networking-calico Summary: Project Calico networking for OpenStack/Neutron Epoch: 1 Version: 1.0.1 -Release: 0.6.pre1%{?dist} +Release: 0.7.pre7%{?dist} License: Apache-2 URL: http://docs.openstack.org/developer/networking-calico/ Source0: networking-calico-%{version}.tar.gz +Source45: calico-dhcp-agent.service BuildArch: noarch @@ -24,9 +25,9 @@ those workloads. Group: Applications/Engineering Summary: Project Calico networking for OpenStack/Neutron %if 0%{?el6} -Requires: calico-common, calico-felix, networking-calico, openstack-neutron, iptables, python-argparse +Requires: calico-common, calico-dhcp-agent, calico-felix, networking-calico, openstack-neutron, iptables, python-argparse %else -Requires: calico-common, calico-felix, networking-calico, openstack-neutron, iptables +Requires: calico-common, calico-dhcp-agent, calico-felix, networking-calico, openstack-neutron, iptables %endif @@ -34,8 +35,6 @@ Requires: calico-common, calico-felix, networking-calico, openstack-neutro This package provides the pieces needed on a compute node. %files -n calico-compute -%defattr(-,root,root,-) -/usr/bin/calico-dhcp-agent %post -n calico-compute if [ $1 -eq 1 ] ; then @@ -74,6 +73,47 @@ if [ $1 -ge 1 ] ; then fi +%package -n calico-dhcp-agent +Group: Applications/Engineering +Summary: Project Calico networking for OpenStack/Neutron +Requires: calico-common, networking-calico + +%description -n calico-dhcp-agent +This package provides the Calico DHCP agent. + +%files -n calico-dhcp-agent +%defattr(-,root,root,-) +/usr/bin/calico-dhcp-agent +%{_unitdir}/calico-dhcp-agent.service + +%post -n calico-dhcp-agent +%if 0%{?el7} +if [ $1 -eq 1 ] ; then + # Initial installation + /usr/bin/systemctl daemon-reload + /usr/bin/systemctl enable calico-dhcp-agent + /usr/bin/systemctl start calico-dhcp-agent +fi +%endif + +%preun -n calico-dhcp-agent +if [ $1 -eq 0 ] ; then + # Package removal, not upgrade +%if 0%{?el7} + /usr/bin/systemctl disable calico-dhcp-agent + /usr/bin/systemctl stop calico-dhcp-agent +%endif +fi + +%postun -n calico-dhcp-agent +if [ $1 -ge 1 ] ; then + # Package upgrade, not uninstall +%if 0%{?el7} + /usr/bin/systemctl condrestart calico-dhcp-agent >/dev/null 2>&1 || : +%endif +fi + + %package -n calico-control Group: Applications/Engineering Summary: Project Calico networking for OpenStack/Neutron @@ -107,12 +147,21 @@ integration code. rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +# For EL7, install systemd service files +%if 0%{?el7} + install -d -m 755 %{buildroot}%{_unitdir} + install -p -D -m 755 %{SOURCE45} %{buildroot}%{_unitdir}/calico-dhcp-agent.service +%endif + %clean rm -rf $RPM_BUILD_ROOT %changelog +* Tue Feb 02 2016 Neil Jerram 1:1.0.1-0.7.pre7 + - Add service framework around Calico DHCP agent + * Thu Jan 21 2016 Neil Jerram 1:1.0.1-0.6.pre1 - devstack/bootstrap.sh: Don't set SERVICE_HOST - Various leader election improvements