The previous systemd units for OVN had systemd create a rundir for
each daemon (ovn-northd and ovn-controller).  This "worked", in that
the services did start successfully.  However, they didn't actually
work.  In practice, both services make use of files in the main ovs
rundir, so just run everything from there.  It keeps things simple and
makes the services actually work.

Signed-off-by: Russell Bryant <rbry...@redhat.com>
---
 rhel/openvswitch-fedora.spec.in                    | 2 --
 rhel/usr_lib_systemd_system_ovn-controller.service | 9 +++------
 rhel/usr_lib_systemd_system_ovn-northd.service     | 5 +----
 3 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 4d403e0..4789704 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -342,8 +342,6 @@ rm -rf $RPM_BUILD_ROOT
 %config %{_datadir}/openvswitch/ovn-sb.ovsschema
 %{_unitdir}/ovn-controller.service
 %{_unitdir}/ovn-northd.service
-%ghost %attr(755,root,root) %{_rundir}/ovn-controller
-%ghost %attr(755,root,root) %{_rundir}/ovn-northd
 
 %changelog
 * Wed Jan 12 2011 Ralf Spenneberg <r...@os-s.net>
diff --git a/rhel/usr_lib_systemd_system_ovn-controller.service 
b/rhel/usr_lib_systemd_system_ovn-controller.service
index 4fdcfd2..7637fe7 100644
--- a/rhel/usr_lib_systemd_system_ovn-controller.service
+++ b/rhel/usr_lib_systemd_system_ovn-controller.service
@@ -6,11 +6,8 @@ After=openvswitch.service
 
 [Service]
 Type=simple
-RuntimeDirectory=ovn-controller
-RuntimeDirectoryMode=0755
-PIDFile=%t/ovn-controller/ovn-controller.pid
-Environment=OVS_RUNDIR=%t/ovn-controller
+Environment=OVS_RUNDIR=%t/openvswitch
 ExecStart=/usr/bin/ovn-controller -vconsole:emer -vsyslog:err -vfile:info \
           --log-file=/var/log/openvswitch/ovn-controller.log \
-          --no-chdir --pidfile=%t/ovn-controller/ovn-controller.pid \
-          unix:/var/run/openvswitch/db.sock
+          --no-chdir --pidfile=${OVS_RUNDIR}/ovn-controller.pid \
+          unix:${OVS_RUNDIR}/db.sock
diff --git a/rhel/usr_lib_systemd_system_ovn-northd.service 
b/rhel/usr_lib_systemd_system_ovn-northd.service
index fcbf646..5b3b03a 100644
--- a/rhel/usr_lib_systemd_system_ovn-northd.service
+++ b/rhel/usr_lib_systemd_system_ovn-northd.service
@@ -7,9 +7,6 @@ After=openvswitch.service
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-RuntimeDirectory=ovn-northd
-RuntimeDirectoryMode=0755
-PIDFile=%t/ovn-northd/ovn-northd.pid
-Environment=OVN_RUNDIR=%t/ovn-northd OVS_RUNDIR=%t/openvswitch 
OVS_DBDIR=/var/lib/openvswitch
+Environment=OVS_RUNDIR=%t/openvswitch OVS_DBDIR=/var/lib/openvswitch
 ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_northd
 ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_northd
-- 
2.4.3

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to