summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-10-09 13:35:07 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-10-10 16:44:32 +0100
commit90f370940b933a3eb8516ba8a11cb7011e60a68f (patch)
tree90eaa288bdf78ec60e4a898e170da6f0e92840e1
parentd3a56585195f07363d7bbc59292ba24cc532b286 (diff)
downloadpoky-90f370940b933a3eb8516ba8a11cb7011e60a68f.tar.gz
rpcbind: make service socket activated
Instead of setting 'Restart=always' in the service file, we should make the service socket activated, just like what Fedora does. (From OE-Core rev: 176e91ef28800adb6295b29c455b2efb91a01876) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/rpcbind.service9
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket8
-rw-r--r--meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb5
3 files changed, 14 insertions, 8 deletions
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
index 33ee268441..b3ae2541a0 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
@@ -1,15 +1,12 @@
1[Unit] 1[Unit]
2Description=RPC Bind 2Description=RPC Bind Service
3After=network.target 3Requires=rpcbind.socket
4Wants=rpcbind.target
5Before=rpcbind.target
6 4
7[Service] 5[Service]
8Type=forking 6Type=forking
9EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf 7EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
10ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS 8ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS
11Restart=always
12SuccessExitStatus=2 9SuccessExitStatus=2
13 10
14[Install] 11[Install]
15WantedBy=multi-user.target 12Also=rpcbind.socket
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
new file mode 100644
index 0000000000..d63c1d9720
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
@@ -0,0 +1,8 @@
1[Unit]
2Description=RPCbind Server Activation Socket
3
4[Socket]
5ListenStream=/var/run/rpcbind.sock
6
7[Install]
8WantedBy=sockets.target
diff --git a/meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb b/meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb
index 4a5562b7d2..b7324766f7 100644
--- a/meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb
+++ b/meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb
@@ -15,6 +15,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
15 file://init.d \ 15 file://init.d \
16 ${UCLIBCPATCHES} \ 16 ${UCLIBCPATCHES} \
17 file://rpcbind.conf \ 17 file://rpcbind.conf \
18 file://rpcbind.socket \
18 file://rpcbind.service \ 19 file://rpcbind.service \
19 " 20 "
20 21
@@ -34,8 +35,7 @@ PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
34INITSCRIPT_NAME = "rpcbind" 35INITSCRIPT_NAME = "rpcbind"
35INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." 36INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
36 37
37SYSTEMD_SERVICE_${PN} = "rpcbind.service" 38SYSTEMD_SERVICE_${PN} = "rpcbind.service rpcbind.socket"
38SYSTEMD_AUTO_ENABLE = "disable"
39 39
40inherit useradd 40inherit useradd
41 41
@@ -56,6 +56,7 @@ do_install_append () {
56 56
57 install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir} 57 install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
58 install -d ${D}${systemd_unitdir}/system 58 install -d ${D}${systemd_unitdir}/system
59 install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
59 install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system 60 install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
60 sed -i -e 's,@SBINDIR@,${sbindir},g' \ 61 sed -i -e 's,@SBINDIR@,${sbindir},g' \
61 -e 's,@SYSCONFDIR@,${sysconfdir},g' \ 62 -e 's,@SYSCONFDIR@,${sysconfdir},g' \