summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols
diff options
context:
space:
mode:
authorChong.Lu@windriver.com <Chong.Lu@windriver.com>2014-09-29 09:19:53 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2014-10-04 00:30:29 +0200
commit07e13c6b940288d5649a82a7c1c185ab9b24d4b4 (patch)
treea03be1204d09b3fcb41ea3318b8ce3b00d98bb95 /meta-networking/recipes-protocols
parenta97b89e72f218715d369e3db43c294154d9c377a (diff)
downloadmeta-openembedded-07e13c6b940288d5649a82a7c1c185ab9b24d4b4.tar.gz
quagga: add systemd service file
Add systemd service for quagga. Signed-off-by: Chong Lu <Chong.Lu@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-networking/recipes-protocols')
-rw-r--r--meta-networking/recipes-protocols/quagga/files/babeld.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/bgpd.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/isisd.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/ospf6d.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/ospfd.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/ripd.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/ripngd.service14
-rw-r--r--meta-networking/recipes-protocols/quagga/files/zebra.service15
-rw-r--r--meta-networking/recipes-protocols/quagga/quagga.inc49
9 files changed, 161 insertions, 1 deletions
diff --git a/meta-networking/recipes-protocols/quagga/files/babeld.service b/meta-networking/recipes-protocols/quagga/files/babeld.service
new file mode 100644
index 000000000..dd344b0b3
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/babeld.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=Babel routing daemon
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/babeld.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/babeld -d $babeld_options -f /etc/quagga/babeld.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/bgpd.service b/meta-networking/recipes-protocols/quagga/files/bgpd.service
new file mode 100644
index 000000000..164c81724
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/bgpd.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=BGP routing daemon
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/bgpd.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f /etc/quagga/bgpd.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/isisd.service b/meta-networking/recipes-protocols/quagga/files/isisd.service
new file mode 100644
index 000000000..9bfe7b65e
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/isisd.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=IS-IS routing daemon
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/isisd.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/isisd -d $isisd_options -f /etc/quagga/isisd.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/ospf6d.service b/meta-networking/recipes-protocols/quagga/files/ospf6d.service
new file mode 100644
index 000000000..4b8ebf802
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/ospf6d.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=OSPF routing daemon for IPv6
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/ospf6d.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f /etc/quagga/ospf6d.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/ospfd.service b/meta-networking/recipes-protocols/quagga/files/ospfd.service
new file mode 100644
index 000000000..f9f5031b4
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/ospfd.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=OSPF routing daemon
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/ospfd.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f /etc/quagga/ospfd.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/ripd.service b/meta-networking/recipes-protocols/quagga/files/ripd.service
new file mode 100644
index 000000000..5dfd28b3a
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/ripd.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=RIP routing daemon
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/ripd.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/ripd -d $ripd_options -f /etc/quagga/ripd.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/ripngd.service b/meta-networking/recipes-protocols/quagga/files/ripngd.service
new file mode 100644
index 000000000..936b81fb9
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/ripngd.service
@@ -0,0 +1,14 @@
1i[Unit]
2Description=RIP routing daemon for IPv6
3BindTo=zebra.service
4After=zebra.service
5ConditionPathExists=@SYSCONFDIR@/quagga/ripngd.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f /etc/quagga/ripngd.conf
11Restart=on-abort
12
13[Install]
14WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/files/zebra.service b/meta-networking/recipes-protocols/quagga/files/zebra.service
new file mode 100644
index 000000000..afdd9e52d
--- /dev/null
+++ b/meta-networking/recipes-protocols/quagga/files/zebra.service
@@ -0,0 +1,15 @@
1[Unit]
2Description=GNU Zebra routing manager
3Wants=network.target
4Before=network.target
5ConditionPathExists=@SYSCONFDIR@/quagga/zebra.conf
6
7[Service]
8Type=forking
9EnvironmentFile=-@SYSCONFDIR@/default/quagga
10ExecStartPre=@BASE_SBINDIR@/ip route flush proto zebra
11ExecStart=@SBINDIR@/zebra -d $zebra_options -f /etc/quagga/zebra.conf
12Restart=on-abort
13
14[Install]
15WantedBy=multi-user.target
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc
index 04ec05153..9bdd4d590 100644
--- a/meta-networking/recipes-protocols/quagga/quagga.inc
+++ b/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -31,13 +31,31 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz; \
31 file://quagga.pam \ 31 file://quagga.pam \
32 file://ripd-fix-two-bugs-after-received-SIGHUP.patch \ 32 file://ripd-fix-two-bugs-after-received-SIGHUP.patch \
33 file://quagga-Avoid-duplicate-connected-address.patch \ 33 file://quagga-Avoid-duplicate-connected-address.patch \
34 file://babeld.service \
35 file://bgpd.service \
36 file://isisd.service \
37 file://ospf6d.service \
38 file://ospfd.service \
39 file://ripd.service \
40 file://ripngd.service \
41 file://zebra.service \
34" 42"
35 43
36PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" 44PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
37PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap" 45PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
38PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam" 46PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam"
39 47
40inherit autotools update-rc.d useradd 48inherit autotools update-rc.d useradd systemd
49
50SYSTEMD_PACKAGES = "${PN} ${PN}-babeld ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd"
51SYSTEMD_SERVICE_${PN}-babeld = "babeld.service"
52SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service"
53SYSTEMD_SERVICE_${PN}-isisd = "isisd.service"
54SYSTEMD_SERVICE_${PN}-ospf6d = "ospf6d.service"
55SYSTEMD_SERVICE_${PN}-ospfd = "ospfd.service"
56SYSTEMD_SERVICE_${PN}-ripd = "ripd.service"
57SYSTEMD_SERVICE_${PN}-ripngd = "ripngd.service"
58SYSTEMD_SERVICE_${PN} = "zebra.service"
41 59
42EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \ 60EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \
43 --localstatedir=${localstatedir}/run/quagga \ 61 --localstatedir=${localstatedir}/run/quagga \
@@ -108,6 +126,35 @@ do_install () {
108 fi 126 fi
109 done 127 done
110 128
129 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
130 install -d ${D}${sysconfdir}/tmpfiles.d
131 echo "d /var/run/quagga 0755 quagga quagga -" \
132 > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
133 fi
134
135 # Remove sysinit script if sysvinit is not in DISTRO_FEATURES
136 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
137 rm -rf ${D}${sysconfdir}/init.d/
138 fi
139
140 install -d ${D}${systemd_unitdir}/system
141 for i in babeld bgpd isisd ospf6d ospfd ripd ripngd zebra; do
142 install -m 0644 ${WORKDIR}/$i.service ${D}${systemd_unitdir}/system
143 done
144 sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
145 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
146 -e 's,@SBINDIR@,${sbindir},g' \
147 -i ${D}${systemd_unitdir}/system/*.service
148}
149
150DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}"
151pkg_postinst_${PN} () {
152 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then
153 if [ -n "$D" ]; then
154 OPTS="--root=$D"
155 fi
156 systemctl $OPTS mask quagga.service
157 fi
111} 158}
112 159
113# Split into a main package and separate per-protocol packages 160# Split into a main package and separate per-protocol packages