Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] rpcbind: make service socket activated
@ 2014-10-09  5:35 Chen Qi
  2014-10-09  5:35 ` [PATCH 1/1] " Chen Qi
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Qi @ 2014-10-09  5:35 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 16cedc3bce6fc37543e9ef053cd7c589e523ca1c:

  package_ipk.bbclass: Fix SRC_URI whitespace handling (2014-10-06 16:03:03 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ChenQi/rpcbind-systemd
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/rpcbind-systemd

Chen Qi (1):
  rpcbind: make service socket activated

 meta/recipes-extended/rpcbind/rpcbind/rpcbind.service | 9 +++------
 meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket  | 8 ++++++++
 meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb        | 5 +++--
 3 files changed, 14 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket

-- 
1.9.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] rpcbind: make service socket activated
  2014-10-09  5:35 [PATCH 0/1] rpcbind: make service socket activated Chen Qi
@ 2014-10-09  5:35 ` Chen Qi
  0 siblings, 0 replies; 2+ messages in thread
From: Chen Qi @ 2014-10-09  5:35 UTC (permalink / raw)
  To: openembedded-core

Instead of setting 'Restart=always' in the service file, we should
make the service socket activated, just like what Fedora does.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-extended/rpcbind/rpcbind/rpcbind.service | 9 +++------
 meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket  | 8 ++++++++
 meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb        | 5 +++--
 3 files changed, 14 insertions(+), 8 deletions(-)
 create mode 100644 meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket

diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
index 33ee268..b3ae254 100644
--- a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
@@ -1,15 +1,12 @@
 [Unit]
-Description=RPC Bind
-After=network.target
-Wants=rpcbind.target
-Before=rpcbind.target
+Description=RPC Bind Service
+Requires=rpcbind.socket
 
 [Service]
 Type=forking
 EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
 ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS
-Restart=always
 SuccessExitStatus=2
 
 [Install]
-WantedBy=multi-user.target
+Also=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 0000000..d63c1d9
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPCbind Server Activation Socket
+
+[Socket]
+ListenStream=/var/run/rpcbind.sock
+
+[Install]
+WantedBy=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 4a5562b..b732476 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 \
            file://init.d \
            ${UCLIBCPATCHES} \
            file://rpcbind.conf \
+           file://rpcbind.socket \
            file://rpcbind.service \
           "
 
@@ -34,8 +35,7 @@ PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
 INITSCRIPT_NAME = "rpcbind"
 INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
 
-SYSTEMD_SERVICE_${PN} = "rpcbind.service"
-SYSTEMD_AUTO_ENABLE = "disable"
+SYSTEMD_SERVICE_${PN} = "rpcbind.service rpcbind.socket"
 
 inherit useradd
 
@@ -56,6 +56,7 @@ do_install_append () {
 
 	install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
 	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
 	install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
 	sed -i -e 's,@SBINDIR@,${sbindir},g' \
 		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-09  5:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09  5:35 [PATCH 0/1] rpcbind: make service socket activated Chen Qi
2014-10-09  5:35 ` [PATCH 1/1] " Chen Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox