diff options
| author | Chen Qi <Qi.Chen@windriver.com> | 2014-10-09 13:35:07 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-10 16:44:32 +0100 |
| commit | 90f370940b933a3eb8516ba8a11cb7011e60a68f (patch) | |
| tree | 90eaa288bdf78ec60e4a898e170da6f0e92840e1 | |
| parent | d3a56585195f07363d7bbc59292ba24cc532b286 (diff) | |
| download | poky-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.service | 9 | ||||
| -rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket | 8 | ||||
| -rw-r--r-- | meta/recipes-extended/rpcbind/rpcbind_0.2.1.bb | 5 |
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] |
| 2 | Description=RPC Bind | 2 | Description=RPC Bind Service |
| 3 | After=network.target | 3 | Requires=rpcbind.socket |
| 4 | Wants=rpcbind.target | ||
| 5 | Before=rpcbind.target | ||
| 6 | 4 | ||
| 7 | [Service] | 5 | [Service] |
| 8 | Type=forking | 6 | Type=forking |
| 9 | EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf | 7 | EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf |
| 10 | ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS | 8 | ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS |
| 11 | Restart=always | ||
| 12 | SuccessExitStatus=2 | 9 | SuccessExitStatus=2 |
| 13 | 10 | ||
| 14 | [Install] | 11 | [Install] |
| 15 | WantedBy=multi-user.target | 12 | 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 0000000000..d63c1d9720 --- /dev/null +++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=RPCbind Server Activation Socket | ||
| 3 | |||
| 4 | [Socket] | ||
| 5 | ListenStream=/var/run/rpcbind.sock | ||
| 6 | |||
| 7 | [Install] | ||
| 8 | 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 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" | |||
| 34 | INITSCRIPT_NAME = "rpcbind" | 35 | INITSCRIPT_NAME = "rpcbind" |
| 35 | INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." | 36 | INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ." |
| 36 | 37 | ||
| 37 | SYSTEMD_SERVICE_${PN} = "rpcbind.service" | 38 | SYSTEMD_SERVICE_${PN} = "rpcbind.service rpcbind.socket" |
| 38 | SYSTEMD_AUTO_ENABLE = "disable" | ||
| 39 | 39 | ||
| 40 | inherit useradd | 40 | inherit 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' \ |
