Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] nfs-utils: fix to start nfs-server correctly in systemd images
@ 2015-07-08  8:07 Chen Qi
  2015-07-08  8:07 ` [PATCH 1/1] nfs-utils: fix to start nfs-server correctly in systemd Chen Qi
  0 siblings, 1 reply; 4+ messages in thread
From: Chen Qi @ 2015-07-08  8:07 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit df6ddc4bf9795212fda87f9d401893eb254074da:

  file: fix long-options (2015-07-07 23:57:14 +0100)

are available in the git repository at:

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

Chen Qi (1):
  nfs-utils: fix to start nfs-server correctly in systemd

 .../nfs-utils/nfs-utils/proc-fs-nfsd.mount                   |  8 ++++++++
 meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb       | 12 +++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount

-- 
1.9.1



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

* [PATCH 1/1] nfs-utils: fix to start nfs-server correctly in systemd
  2015-07-08  8:07 [PATCH 0/1] nfs-utils: fix to start nfs-server correctly in systemd images Chen Qi
@ 2015-07-08  8:07 ` Chen Qi
  2015-07-08  8:11   ` Mike Looijmans
  0 siblings, 1 reply; 4+ messages in thread
From: Chen Qi @ 2015-07-08  8:07 UTC (permalink / raw)
  To: openembedded-core

1. Change RRECOMMENDS to RDEPENDS for kernel-module-nfsd because this kernel
   module is a necessity for nfs server.

2. Add proc-fs-nfsd.mount systemd unit file because it's needed for nfs server
   to start correctly.

After this change, in a systemd based image, we can use `systemctl start
nfs-server' to start the nfs server and things would work correctly.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../nfs-utils/nfs-utils/proc-fs-nfsd.mount                   |  8 ++++++++
 meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb       | 12 +++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount

diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
new file mode 100644
index 0000000..630801b
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=NFSD configuration filesystem
+After=systemd-modules-load.service
+
+[Mount]
+What=nfsd
+Where=/proc/fs/nfsd
+Type=nfsd
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
index 0bcd65e..fa56c1f 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
 DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3"
 RDEPENDS_${PN}-client = "rpcbind bash"
 RDEPENDS_${PN} = "${PN}-client bash"
-RRECOMMENDS_${PN} = "kernel-module-nfsd"
+RDEPENDS_${PN} = "kernel-module-nfsd"
 
 inherit useradd
 
@@ -28,6 +28,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
            file://nfs-server.service \
            file://nfs-mountd.service \
            file://nfs-statd.service \
+           file://proc-fs-nfsd.mount \
            file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
            file://nfs-utils-debianize-start-statd.patch \
 "
@@ -87,6 +88,8 @@ FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
 FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
 RDEPENDS_${PN}-stats = "python"
 
+FILES_${PN} += "${systemd_unitdir}"
+
 # Make clean needed because the package comes with
 # precompiled 64-bit objects that break the build
 do_compile_prepend() {
@@ -108,6 +111,13 @@ do_install_append () {
 	sed -i -e 's,@SBINDIR@,${sbindir},g' \
 		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
 		${D}${systemd_unitdir}/system/*.service
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+	    install -d ${D}${sysconfdir}/modules-load.d
+	    echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
+	    install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
+	    install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+	    ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
+	fi
 
 	# kernel code as of 3.8 hard-codes this path as a default
 	install -d ${D}/var/lib/nfs/v4recovery
-- 
1.9.1



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

* Re: [PATCH 1/1] nfs-utils: fix to start nfs-server correctly in systemd
  2015-07-08  8:07 ` [PATCH 1/1] nfs-utils: fix to start nfs-server correctly in systemd Chen Qi
@ 2015-07-08  8:11   ` Mike Looijmans
  2015-07-08  8:43     ` ChenQi
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Looijmans @ 2015-07-08  8:11 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

On 08-07-15 10:07, Chen Qi wrote:
> 1. Change RRECOMMENDS to RDEPENDS for kernel-module-nfsd because this kernel
>     module is a necessity for nfs server.

No it is not! Like any kernel module, it can be built in, and then there will 
be no such package, and the package becomes uninstallable.

That is the reason that kernel-module-* dependencies are (almost) always 
RRECOMMENDS.

Moving this to RDEPENDS will break things on configurations where the module 
is built in.

(Maybe some day the kernel will RPROVIDE such packages, that would solve it)


> 2. Add proc-fs-nfsd.mount systemd unit file because it's needed for nfs server
>     to start correctly.
>
> After this change, in a systemd based image, we can use `systemctl start
> nfs-server' to start the nfs server and things would work correctly.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>   .../nfs-utils/nfs-utils/proc-fs-nfsd.mount                   |  8 ++++++++
>   meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb       | 12 +++++++++++-
>   2 files changed, 19 insertions(+), 1 deletion(-)
>   create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
>
> diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
> new file mode 100644
> index 0000000..630801b
> --- /dev/null
> +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
> @@ -0,0 +1,8 @@
> +[Unit]
> +Description=NFSD configuration filesystem
> +After=systemd-modules-load.service
> +
> +[Mount]
> +What=nfsd
> +Where=/proc/fs/nfsd
> +Type=nfsd
> diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
> index 0bcd65e..fa56c1f 100644
> --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
> +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
> @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
>   DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3"
>   RDEPENDS_${PN}-client = "rpcbind bash"
>   RDEPENDS_${PN} = "${PN}-client bash"
> -RRECOMMENDS_${PN} = "kernel-module-nfsd"
> +RDEPENDS_${PN} = "kernel-module-nfsd"
>
>   inherit useradd
>
> @@ -28,6 +28,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
>              file://nfs-server.service \
>              file://nfs-mountd.service \
>              file://nfs-statd.service \
> +           file://proc-fs-nfsd.mount \
>              file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
>              file://nfs-utils-debianize-start-statd.patch \
>   "
> @@ -87,6 +88,8 @@ FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
>   FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
>   RDEPENDS_${PN}-stats = "python"
>
> +FILES_${PN} += "${systemd_unitdir}"
> +
>   # Make clean needed because the package comes with
>   # precompiled 64-bit objects that break the build
>   do_compile_prepend() {
> @@ -108,6 +111,13 @@ do_install_append () {
>   	sed -i -e 's,@SBINDIR@,${sbindir},g' \
>   		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
>   		${D}${systemd_unitdir}/system/*.service
> +	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
> +	    install -d ${D}${sysconfdir}/modules-load.d
> +	    echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
> +	    install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
> +	    install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
> +	    ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
> +	fi
>
>   	# kernel code as of 3.8 hard-codes this path as a default
>   	install -d ${D}/var/lib/nfs/v4recovery
>



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

* Re: [PATCH 1/1] nfs-utils: fix to start nfs-server correctly in systemd
  2015-07-08  8:11   ` Mike Looijmans
@ 2015-07-08  8:43     ` ChenQi
  0 siblings, 0 replies; 4+ messages in thread
From: ChenQi @ 2015-07-08  8:43 UTC (permalink / raw)
  To: Mike Looijmans, openembedded-core

On 07/08/2015 04:11 PM, Mike Looijmans wrote:
> On 08-07-15 10:07, Chen Qi wrote:
>> 1. Change RRECOMMENDS to RDEPENDS for kernel-module-nfsd because this 
>> kernel
>>     module is a necessity for nfs server.
>
> No it is not! Like any kernel module, it can be built in, and then 
> there will be no such package, and the package becomes uninstallable.
>
> That is the reason that kernel-module-* dependencies are (almost) 
> always RRECOMMENDS.
>
> Moving this to RDEPENDS will break things on configurations where the 
> module is built in.
>
> (Maybe some day the kernel will RPROVIDE such packages, that would 
> solve it)
>
>
OK. Thanks for explaining it.
I'll change it back and send out V2.

//Chen Qi

>> 2. Add proc-fs-nfsd.mount systemd unit file because it's needed for 
>> nfs server
>>     to start correctly.
>>
>> After this change, in a systemd based image, we can use `systemctl start
>> nfs-server' to start the nfs server and things would work correctly.
>>
>> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
>> ---
>>   .../nfs-utils/nfs-utils/proc-fs-nfsd.mount |  8 ++++++++
>>   meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb       | 12 
>> +++++++++++-
>>   2 files changed, 19 insertions(+), 1 deletion(-)
>>   create mode 100644 
>> meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
>>
>> diff --git 
>> a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount 
>> b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
>> new file mode 100644
>> index 0000000..630801b
>> --- /dev/null
>> +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
>> @@ -0,0 +1,8 @@
>> +[Unit]
>> +Description=NFSD configuration filesystem
>> +After=systemd-modules-load.service
>> +
>> +[Mount]
>> +What=nfsd
>> +Where=/proc/fs/nfsd
>> +Type=nfsd
>> diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb 
>> b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
>> index 0bcd65e..fa56c1f 100644
>> --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
>> +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
>> @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = 
>> "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
>>   DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3"
>>   RDEPENDS_${PN}-client = "rpcbind bash"
>>   RDEPENDS_${PN} = "${PN}-client bash"
>> -RRECOMMENDS_${PN} = "kernel-module-nfsd"
>> +RDEPENDS_${PN} = "kernel-module-nfsd"
>>
>>   inherit useradd
>>
>> @@ -28,6 +28,7 @@ SRC_URI = 
>> "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
>>              file://nfs-server.service \
>>              file://nfs-mountd.service \
>>              file://nfs-statd.service \
>> +           file://proc-fs-nfsd.mount \
>> file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
>>              file://nfs-utils-debianize-start-statd.patch \
>>   "
>> @@ -87,6 +88,8 @@ FILES_${PN}-client = "${base_sbindir}/*mount.nfs* 
>> ${sbindir}/*statd \
>>   FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
>>   RDEPENDS_${PN}-stats = "python"
>>
>> +FILES_${PN} += "${systemd_unitdir}"
>> +
>>   # Make clean needed because the package comes with
>>   # precompiled 64-bit objects that break the build
>>   do_compile_prepend() {
>> @@ -108,6 +111,13 @@ do_install_append () {
>>       sed -i -e 's,@SBINDIR@,${sbindir},g' \
>>           -e 's,@SYSCONFDIR@,${sysconfdir},g' \
>>           ${D}${systemd_unitdir}/system/*.service
>> +    if 
>> ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; 
>> then
>> +        install -d ${D}${sysconfdir}/modules-load.d
>> +        echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
>> +        install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount 
>> ${D}${systemd_unitdir}/system/
>> +        install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
>> +        ln -sf ../proc-fs-nfsd.mount 
>> ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
>> +    fi
>>
>>       # kernel code as of 3.8 hard-codes this path as a default
>>       install -d ${D}/var/lib/nfs/v4recovery
>>
>
>
>



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

end of thread, other threads:[~2015-07-08  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08  8:07 [PATCH 0/1] nfs-utils: fix to start nfs-server correctly in systemd images Chen Qi
2015-07-08  8:07 ` [PATCH 1/1] nfs-utils: fix to start nfs-server correctly in systemd Chen Qi
2015-07-08  8:11   ` Mike Looijmans
2015-07-08  8:43     ` ChenQi

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