The bug is: after the service stopped,the pid file still exists.
So modidy the service files.

Signed-off-by: Li Xin <[email protected]>
---
 meta-networking/recipes-protocols/quagga/files/bgpd.service   | 4 +++-
 meta-networking/recipes-protocols/quagga/files/ospf6d.service | 4 +++-
 meta-networking/recipes-protocols/quagga/files/ospfd.service  | 4 +++-
 meta-networking/recipes-protocols/quagga/files/ripd.service   | 4 +++-
 meta-networking/recipes-protocols/quagga/files/ripngd.service | 4 +++-
 meta-networking/recipes-protocols/quagga/files/zebra.service  | 4 +++-
 meta-networking/recipes-protocols/quagga/quagga.inc           | 2 ++
 7 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/meta-networking/recipes-protocols/quagga/files/bgpd.service 
b/meta-networking/recipes-protocols/quagga/files/bgpd.service
index 164c817..76f9f61 100644
--- a/meta-networking/recipes-protocols/quagga/files/bgpd.service
+++ b/meta-networking/recipes-protocols/quagga/files/bgpd.service
@@ -7,7 +7,9 @@ ConditionPathExists=@SYSCONFDIR@/quagga/bgpd.conf
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/default/quagga
-ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f /etc/quagga/bgpd.conf
+PIDFile=@localstatedir@/run/quagga/bgpd.pid
+ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f @SYSCONFDIR@/quagga/bgpd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/bgpd.pid
 Restart=on-abort
 
 [Install]
diff --git a/meta-networking/recipes-protocols/quagga/files/ospf6d.service 
b/meta-networking/recipes-protocols/quagga/files/ospf6d.service
index 4b8ebf8..a2e493b 100644
--- a/meta-networking/recipes-protocols/quagga/files/ospf6d.service
+++ b/meta-networking/recipes-protocols/quagga/files/ospf6d.service
@@ -7,7 +7,9 @@ ConditionPathExists=@SYSCONFDIR@/quagga/ospf6d.conf
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/default/quagga
-ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f /etc/quagga/ospf6d.conf
+PIDFile=@localstatedir@/run/quagga/ospf6d.pid
+ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f 
@SYSCONFDIR@/quagga/ospf6d.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ospf6d.pid
 Restart=on-abort
 
 [Install]
diff --git a/meta-networking/recipes-protocols/quagga/files/ospfd.service 
b/meta-networking/recipes-protocols/quagga/files/ospfd.service
index f9f5031..0c62cbc 100644
--- a/meta-networking/recipes-protocols/quagga/files/ospfd.service
+++ b/meta-networking/recipes-protocols/quagga/files/ospfd.service
@@ -7,7 +7,9 @@ ConditionPathExists=@SYSCONFDIR@/quagga/ospfd.conf
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/default/quagga
-ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f /etc/quagga/ospfd.conf
+PIDFile=@localstatedir@/run/quagga/ospfd.pid
+ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f @SYSCONFDIR@/quagga/ospfd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ospfd.pid
 Restart=on-abort
 
 [Install]
diff --git a/meta-networking/recipes-protocols/quagga/files/ripd.service 
b/meta-networking/recipes-protocols/quagga/files/ripd.service
index 5dfd28b..1d20389 100644
--- a/meta-networking/recipes-protocols/quagga/files/ripd.service
+++ b/meta-networking/recipes-protocols/quagga/files/ripd.service
@@ -7,7 +7,9 @@ ConditionPathExists=@SYSCONFDIR@/quagga/ripd.conf
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/default/quagga
-ExecStart=@SBINDIR@/ripd -d $ripd_options -f /etc/quagga/ripd.conf
+PIDFile=@localstatedir@/run/quagga/ripd.pid
+ExecStart=@SBINDIR@/ripd -d $ripd_options -f @SYSCONFDIR@/quagga/ripd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ripd.pid
 Restart=on-abort
 
 [Install]
diff --git a/meta-networking/recipes-protocols/quagga/files/ripngd.service 
b/meta-networking/recipes-protocols/quagga/files/ripngd.service
index 72562d5..0355ad1 100644
--- a/meta-networking/recipes-protocols/quagga/files/ripngd.service
+++ b/meta-networking/recipes-protocols/quagga/files/ripngd.service
@@ -7,7 +7,9 @@ ConditionPathExists=@SYSCONFDIR@/quagga/ripngd.conf
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/default/quagga
-ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f /etc/quagga/ripngd.conf
+PIDFile=@localstatedir@/run/quagga/ripngd.pid
+ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f 
@SYSCONFDIR@/quagga/ripngd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ripngd.pid
 Restart=on-abort
 
 [Install]
diff --git a/meta-networking/recipes-protocols/quagga/files/zebra.service 
b/meta-networking/recipes-protocols/quagga/files/zebra.service
index afdd9e5..e4fb6c8 100644
--- a/meta-networking/recipes-protocols/quagga/files/zebra.service
+++ b/meta-networking/recipes-protocols/quagga/files/zebra.service
@@ -7,8 +7,10 @@ ConditionPathExists=@SYSCONFDIR@/quagga/zebra.conf
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/zebra.pid
 ExecStartPre=@BASE_SBINDIR@/ip route flush proto zebra
-ExecStart=@SBINDIR@/zebra -d $zebra_options -f /etc/quagga/zebra.conf
+ExecStart=@SBINDIR@/zebra -d $zebra_options -f @SYSCONFDIR@/quagga/zebra.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/zebra.pid
 Restart=on-abort
 
 [Install]
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc 
b/meta-networking/recipes-protocols/quagga/quagga.inc
index 071e8d4..2f0b515 100644
--- a/meta-networking/recipes-protocols/quagga/quagga.inc
+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -145,6 +145,8 @@ do_install () {
     sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
         -e 's,@SYSCONFDIR@,${sysconfdir},g' \
         -e 's,@SBINDIR@,${sbindir},g' \
+        -e 's,@base_bindir@,${base_bindir},g' \
+        -e 's,@localstatedir@,${localstatedir},g' \
         -i ${D}${systemd_unitdir}/system/*.service
 }
 
-- 
1.8.4.2

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to