diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-11-23 23:23:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-11-29 10:29:58 +0000 |
commit | afa94425a056f209ab78773f20c1c3873660bf98 (patch) | |
tree | a25b6f6b9b03dbd079a31536dfef770e6f4df093 | |
parent | c4790644f980e68b1577df4788053efc0c317b14 (diff) | |
download | poky-afa94425a056f209ab78773f20c1c3873660bf98.tar.gz |
unfs: update 0.9.22 -> 0.10.0
This is the first release in 13 years;
I have reviewed the accumulated patches, and dropped some of them
where purpose or issue being fixed is not clear. Specifically:
0001-Add-listen-action-for-a-tcp-socket.patch
0001-daemon.c-Libtirpc-porting-fixes.patch
fixed upstream in
https://github.com/unfs3/unfs3/commit/84ab475f93c0af437ece21770617603c508dee8c
0001-attr-fix-utime-for-symlink.patch
addresses an open issue in
https://github.com/unfs3/unfs3/issues/4
please rebase and re-submit as a PR if the problem is still present.
alternate_rpc_ports.patch
unnecessary as of
https://git.yoctoproject.org/poky/commit/?id=6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e
Command line options introduced by the patch no longer used anywhere.
fix_compile_warning.patch
merged upstream.
fix_pid_race_parent_writes_child_pid.patch
rebased and re-submitted upstream.
no-yywrap.patch
dropped as backport.
relative_max_socket_path_len.patch
needs to be re-submitted by the original author, purpose and reproducer scenario unclear.
rename_fh_cache.patch
merged upstream.
tcp_no_delay.patch
purpose and use case for oe unclear.
unfs3_parallel_build.patch
fixed upstream in
https://github.com/unfs3/unfs3/commit/987d32ca12222aeb48d46b4e1c9d39bab38ad431
https://github.com/unfs3/unfs3/commit/a39a78995ca8c6f8dd22da93dd60b4a1f8d32728
Drop -N option from oeqa nfs helper and runqemu helper;
the option was provided by tcp_no_delay.patch
and is not needed for the tests or qemu.
Drop ad hoc libtirpc support; upstream supports it directly now.
Drop the check for portmap/rpcbind, it is unnecessary as of
https://git.yoctoproject.org/poky/commit/?id=6bb9860ef7ba9c84fe9bd3a81aa6555f67ebd38e
(From OE-Core rev: fa2f7cf545137b071db97015bca5b70d77566cd8)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
14 files changed, 22 insertions, 653 deletions
diff --git a/meta/lib/oeqa/utils/nfs.py b/meta/lib/oeqa/utils/nfs.py index c1218656ce..b66ed42a58 100644 --- a/meta/lib/oeqa/utils/nfs.py +++ b/meta/lib/oeqa/utils/nfs.py | |||
@@ -30,7 +30,7 @@ def unfs_server(directory, logger = None): | |||
30 | 30 | ||
31 | nenv = dict(os.environ) | 31 | nenv = dict(os.environ) |
32 | nenv['PATH'] = "{0}/sbin:{0}/usr/sbin:{0}/usr/bin:".format(unfs_sysroot) + nenv.get('PATH', '') | 32 | nenv['PATH'] = "{0}/sbin:{0}/usr/sbin:{0}/usr/bin:".format(unfs_sysroot) + nenv.get('PATH', '') |
33 | cmd = Command(["unfsd", "-d", "-p", "-N", "-e", exports.name, "-n", str(nfsport), "-m", str(mountport)], | 33 | cmd = Command(["unfsd", "-d", "-p", "-e", exports.name, "-n", str(nfsport), "-m", str(mountport)], |
34 | bg = True, env = nenv, output_log = logger) | 34 | bg = True, env = nenv, output_log = logger) |
35 | cmd.run() | 35 | cmd.run() |
36 | yield nfsport, mountport | 36 | yield nfsport, mountport |
diff --git a/meta/recipes-devtools/unfs3/unfs3/0001-Add-listen-action-for-a-tcp-socket.patch b/meta/recipes-devtools/unfs3/unfs3/0001-Add-listen-action-for-a-tcp-socket.patch deleted file mode 100644 index e9b9d3df46..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/0001-Add-listen-action-for-a-tcp-socket.patch +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | From b42ab8e1aca951dd06c113159491b3fd5cf06f2e Mon Sep 17 00:00:00 2001 | ||
2 | From: Haiqing Bai <Haiqing.Bai@windriver.com> | ||
3 | Date: Thu, 24 Oct 2019 09:39:04 +0800 | ||
4 | Subject: [PATCH] Add "listen" action for a tcp socket which does not call | ||
5 | 'listen' after 'bind' | ||
6 | |||
7 | It is found that /usr/bin/unfsd customus 100% cpu after starting qemu with 'nfs' | ||
8 | option, and below lots of error messages shows when strace the process: | ||
9 | |||
10 | poll([{fd=3, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND},{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, | ||
11 | {fd=5, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND},{fd=6, events =POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], | ||
12 | 4, 2000) = 2 ([{fd=4, revents=POLLHUP},{fd=6, revents=POLLHUP}]) | ||
13 | accept(4, 0x7ffd5e6dddc0, [128]) = -1 EINVAL (Invalid argument) | ||
14 | accept(6, 0x7ffd5e6dddc0, [128]) = -1 EINVAL (Invalid argument) | ||
15 | |||
16 | % time seconds usecs/call calls errors syscall | ||
17 | ------ ----------- ----------- --------- --------- ---------------- | ||
18 | 70.87 0.005392 0 513886 513886 accept | ||
19 | 29.13 0.002216 0 256943 poll | ||
20 | 0.00 0.000000 0 4 read | ||
21 | |||
22 | The root cause is that 'listen' is not called for the binded | ||
23 | socket. The depended libtipc does not call 'listen' if found | ||
24 | the incomming socket is binded, so 'accept' reports the error | ||
25 | in the 'for' loop and cpu consumed. | ||
26 | |||
27 | Upstream-Status: Pending | ||
28 | |||
29 | Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> | ||
30 | --- | ||
31 | daemon.c | 7 +++++++ | ||
32 | 1 file changed, 7 insertions(+) | ||
33 | |||
34 | diff --git a/daemon.c b/daemon.c | ||
35 | index 028a181..4c85903 100644 | ||
36 | --- a/daemon.c | ||
37 | +++ b/daemon.c | ||
38 | @@ -814,6 +814,13 @@ static SVCXPRT *create_tcp_transport(unsigned int port) | ||
39 | fprintf(stderr, "Couldn't bind to tcp port %d\n", port); | ||
40 | exit(1); | ||
41 | } | ||
42 | + | ||
43 | + if (listen(sock, SOMAXCONN) < 0) { | ||
44 | + perror("listen"); | ||
45 | + fprintf(stderr, "Couldn't listen on the address \n"); | ||
46 | + close(sock); | ||
47 | + exit(1); | ||
48 | + } | ||
49 | } | ||
50 | |||
51 | transp = svctcp_create(sock, 0, 0); | ||
52 | -- | ||
53 | 1.9.1 | ||
54 | |||
diff --git a/meta/recipes-devtools/unfs3/unfs3/0001-attr-fix-utime-for-symlink.patch b/meta/recipes-devtools/unfs3/unfs3/0001-attr-fix-utime-for-symlink.patch deleted file mode 100644 index 6957d102b8..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/0001-attr-fix-utime-for-symlink.patch +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | From 3f4fcb62661059bad77a2e957b4621137797bc2f Mon Sep 17 00:00:00 2001 | ||
2 | From: Rui Wang <rui.wang@windriver.com> | ||
3 | Date: Fri, 15 Jun 2018 14:19:10 +0800 | ||
4 | Subject: [PATCH] attr: fix utime for symlink | ||
5 | |||
6 | unfs3 has an old defect that it can not change the timestamps of a | ||
7 | symlink file because it only uses utime(), which will follow the | ||
8 | symlink. This will not cause an error if the symlink points to an | ||
9 | existent file. But under some special situation, such as installing | ||
10 | a rpm package, rpm tool will create the symlink first and try to | ||
11 | modify the timestamps of it, when the target file is non-existent. | ||
12 | This will cause an ESTALE error. Making rpm tool ignore this error | ||
13 | is a solution, but not the best one. An acceptable approach is | ||
14 | Making unfs3 support lutimes(), which can modify the symlink file | ||
15 | itself. Considering not every system support this function, so a | ||
16 | function checking is necessary. | ||
17 | |||
18 | Upstream-Status: Submitted [https://sourceforge.net/p/unfs3/bugs/12/] | ||
19 | |||
20 | Signed-off-by: Rui Wang <rui.wang@windriver.com> | ||
21 | --- | ||
22 | attr.c | 15 +++++++++++---- | ||
23 | backend_unix.h | 2 ++ | ||
24 | configure.ac | 1 + | ||
25 | 3 files changed, 14 insertions(+), 4 deletions(-) | ||
26 | |||
27 | diff --git a/attr.c b/attr.c | ||
28 | index 73e5c75..427d0e2 100644 | ||
29 | --- a/attr.c | ||
30 | +++ b/attr.c | ||
31 | @@ -280,7 +280,7 @@ post_op_attr get_post_cached(struct svc_req * req) | ||
32 | static nfsstat3 set_time(const char *path, backend_statstruct buf, sattr3 new) | ||
33 | { | ||
34 | time_t new_atime, new_mtime; | ||
35 | - struct utimbuf utim; | ||
36 | + struct timeval stamps[2]; | ||
37 | int res; | ||
38 | |||
39 | /* set atime and mtime */ | ||
40 | @@ -302,10 +302,17 @@ static nfsstat3 set_time(const char *path, backend_statstruct buf, sattr3 new) | ||
41 | else /* DONT_CHANGE */ | ||
42 | new_mtime = buf.st_mtime; | ||
43 | |||
44 | - utim.actime = new_atime; | ||
45 | - utim.modtime = new_mtime; | ||
46 | + stamps[0].tv_sec = new_atime; | ||
47 | + stamps[0].tv_usec = 0; | ||
48 | + stamps[1].tv_sec = new_mtime; | ||
49 | + stamps[1].tv_usec = 0; | ||
50 | + | ||
51 | +#if HAVE_LUTIMES | ||
52 | + res = backend_lutimes(path, stamps); | ||
53 | +#else | ||
54 | + res = backend_utimes(path, stamps); | ||
55 | +#endif | ||
56 | |||
57 | - res = backend_utime(path, &utim); | ||
58 | if (res == -1) | ||
59 | return setattr_err(); | ||
60 | } | ||
61 | diff --git a/backend_unix.h b/backend_unix.h | ||
62 | index fbc2af3..813ffd3 100644 | ||
63 | --- a/backend_unix.h | ||
64 | +++ b/backend_unix.h | ||
65 | @@ -61,6 +61,8 @@ | ||
66 | #define backend_symlink symlink | ||
67 | #define backend_truncate truncate | ||
68 | #define backend_utime utime | ||
69 | +#define backend_utimes utimes | ||
70 | +#define backend_lutimes lutimes | ||
71 | #define backend_statstruct struct stat | ||
72 | #define backend_dirstream DIR | ||
73 | #define backend_statvfsstruct struct statvfs | ||
74 | diff --git a/configure.ac b/configure.ac | ||
75 | index aeec598..ea7f167 100644 | ||
76 | --- a/configure.ac | ||
77 | +++ b/configure.ac | ||
78 | @@ -37,6 +37,7 @@ AC_CHECK_FUNCS(setresuid setresgid) | ||
79 | AC_CHECK_FUNCS(vsyslog) | ||
80 | AC_CHECK_FUNCS(lchown) | ||
81 | AC_CHECK_FUNCS(setgroups) | ||
82 | +AC_CHECK_FUNCS(lutimes) | ||
83 | UNFS3_SOLARIS_RPC | ||
84 | UNFS3_PORTMAP_DEFINE | ||
85 | UNFS3_COMPILE_WARNINGS | ||
diff --git a/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch b/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Fix-race-window-for-writing-of-the-pid-file.patch index 46b187e5f3..20bbee90a0 100644 --- a/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch +++ b/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Fix-race-window-for-writing-of-the-pid-file.patch | |||
@@ -1,4 +1,7 @@ | |||
1 | daemon.c: Fix race window for writing of the pid file | 1 | From 212a947e776e7a25c1f2259615f461179bcb3663 Mon Sep 17 00:00:00 2001 |
2 | From: Alexander Kanavin <alex@linutronix.de> | ||
3 | Date: Wed, 23 Nov 2022 21:38:38 +0100 | ||
4 | Subject: [PATCH] daemon.c: Fix race window for writing of the pid file | ||
2 | 5 | ||
3 | The parent process should write the pid file such that the pid file | 6 | The parent process should write the pid file such that the pid file |
4 | will can be checked immediately following exit of the fork from the | 7 | will can be checked immediately following exit of the fork from the |
@@ -8,17 +11,18 @@ This allows external monitoring applications to watch the daemon | |||
8 | without having to add sleep calls to wait for the pid file be written | 11 | without having to add sleep calls to wait for the pid file be written |
9 | on a busy system. | 12 | on a busy system. |
10 | 13 | ||
14 | Upstream-Status: Submitted [https://github.com/unfs3/unfs3/pull/28] | ||
11 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | 15 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
12 | 16 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> | |
13 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
14 | |||
15 | --- | 17 | --- |
16 | daemon.c | 12 +++++++++--- | 18 | daemon.c | 12 +++++++++--- |
17 | 1 file changed, 9 insertions(+), 3 deletions(-) | 19 | 1 file changed, 9 insertions(+), 3 deletions(-) |
18 | 20 | ||
21 | diff --git a/daemon.c b/daemon.c | ||
22 | index ff53b7a..13b06a4 100644 | ||
19 | --- a/daemon.c | 23 | --- a/daemon.c |
20 | +++ b/daemon.c | 24 | +++ b/daemon.c |
21 | @@ -153,7 +153,7 @@ int get_socket_type(struct svc_req *rqst | 25 | @@ -166,7 +166,7 @@ int get_socket_type(struct svc_req *rqstp) |
22 | /* | 26 | /* |
23 | * write current pid to a file | 27 | * write current pid to a file |
24 | */ | 28 | */ |
@@ -27,7 +31,7 @@ Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | |||
27 | { | 31 | { |
28 | char buf[16]; | 32 | char buf[16]; |
29 | int fd, res, len; | 33 | int fd, res, len; |
30 | @@ -175,7 +175,7 @@ static void create_pid_file(void) | 34 | @@ -188,7 +188,7 @@ static void create_pid_file(void) |
31 | } | 35 | } |
32 | #endif | 36 | #endif |
33 | 37 | ||
@@ -36,7 +40,7 @@ Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | |||
36 | len = strlen(buf); | 40 | len = strlen(buf); |
37 | 41 | ||
38 | res = backend_pwrite(fd, buf, len, 0); | 42 | res = backend_pwrite(fd, buf, len, 0); |
39 | @@ -970,6 +970,10 @@ int main(int argc, char **argv) | 43 | @@ -1122,6 +1122,10 @@ int main(int argc, char **argv) |
40 | fprintf(stderr, "could not fork into background\n"); | 44 | fprintf(stderr, "could not fork into background\n"); |
41 | daemon_exit(0); | 45 | daemon_exit(0); |
42 | } | 46 | } |
@@ -47,7 +51,7 @@ Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | |||
47 | } | 51 | } |
48 | #endif /* WIN32 */ | 52 | #endif /* WIN32 */ |
49 | 53 | ||
50 | @@ -1006,8 +1010,10 @@ int main(int argc, char **argv) | 54 | @@ -1161,8 +1165,10 @@ int main(int argc, char **argv) |
51 | /* no umask to not screw up create modes */ | 55 | /* no umask to not screw up create modes */ |
52 | umask(0); | 56 | umask(0); |
53 | 57 | ||
@@ -59,3 +63,6 @@ Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | |||
59 | 63 | ||
60 | /* initialize internal stuff */ | 64 | /* initialize internal stuff */ |
61 | fh_cache_init(); | 65 | fh_cache_init(); |
66 | -- | ||
67 | 2.30.2 | ||
68 | |||
diff --git a/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch b/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch deleted file mode 100644 index 6eee6748f9..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/0001-daemon.c-Libtirpc-porting-fixes.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | From c7a2a65d6c2a433312540c207860740d6e4e7629 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 11 Mar 2018 17:32:54 -0700 | ||
4 | Subject: [PATCH] daemon.c: Libtirpc porting fixes | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | --- | ||
8 | Upstream-Status: Pending | ||
9 | |||
10 | daemon.c | 4 ++-- | ||
11 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/daemon.c b/daemon.c | ||
14 | index 22f30f6..028a181 100644 | ||
15 | --- a/daemon.c | ||
16 | +++ b/daemon.c | ||
17 | @@ -117,7 +117,7 @@ void logmsg(int prio, const char *fmt, ...) | ||
18 | */ | ||
19 | struct in_addr get_remote(struct svc_req *rqstp) | ||
20 | { | ||
21 | - return (svc_getcaller(rqstp->rq_xprt))->sin_addr; | ||
22 | + return ((struct sockaddr_in*)svc_getcaller(rqstp->rq_xprt))->sin_addr; | ||
23 | } | ||
24 | |||
25 | /* | ||
26 | @@ -125,7 +125,7 @@ struct in_addr get_remote(struct svc_req *rqstp) | ||
27 | */ | ||
28 | short get_port(struct svc_req *rqstp) | ||
29 | { | ||
30 | - return (svc_getcaller(rqstp->rq_xprt))->sin_port; | ||
31 | + return ((struct sockaddr_in*)svc_getcaller(rqstp->rq_xprt))->sin_port; | ||
32 | } | ||
33 | |||
34 | /* | ||
35 | -- | ||
36 | 2.16.2 | ||
37 | |||
diff --git a/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch b/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch deleted file mode 100644 index ff745d4774..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch +++ /dev/null | |||
@@ -1,158 +0,0 @@ | |||
1 | Add ability to specify rcp port numbers | ||
2 | |||
3 | In order to run more than one unfs server on a host system, you must | ||
4 | be able to specify alternate rpc port numbers. | ||
5 | |||
6 | Jason Wessel <jason.wessel@windriver.com> | ||
7 | |||
8 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
9 | |||
10 | --- | ||
11 | daemon.c | 44 +++++++++++++++++++++++++++++++------------- | ||
12 | mount.c | 4 ++-- | ||
13 | 2 files changed, 33 insertions(+), 15 deletions(-) | ||
14 | |||
15 | --- a/daemon.c | ||
16 | +++ b/daemon.c | ||
17 | @@ -78,6 +78,8 @@ int opt_testconfig = FALSE; | ||
18 | struct in_addr opt_bind_addr; | ||
19 | int opt_readable_executables = FALSE; | ||
20 | char *opt_pid_file = NULL; | ||
21 | +int nfs_prog = NFS3_PROGRAM; | ||
22 | +int mount_prog = MOUNTPROG; | ||
23 | |||
24 | /* Register with portmapper? */ | ||
25 | int opt_portmapper = TRUE; | ||
26 | @@ -206,7 +208,7 @@ static void parse_options(int argc, char | ||
27 | { | ||
28 | |||
29 | int opt = 0; | ||
30 | - char *optstring = "bcC:de:hl:m:n:prstTuwi:"; | ||
31 | + char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:"; | ||
32 | |||
33 | while (opt != -1) { | ||
34 | opt = getopt(argc, argv, optstring); | ||
35 | @@ -261,8 +263,24 @@ static void parse_options(int argc, char | ||
36 | printf | ||
37 | ("\t-r report unreadable executables as readable\n"); | ||
38 | printf("\t-T test exports file and exit\n"); | ||
39 | + printf("\t-x <port> alternate NFS RPC port\n"); | ||
40 | + printf("\t-y <port> alternate MOUNTD RPC port\n"); | ||
41 | exit(0); | ||
42 | break; | ||
43 | + case 'x': | ||
44 | + nfs_prog = strtol(optarg, NULL, 10); | ||
45 | + if (nfs_prog == 0) { | ||
46 | + fprintf(stderr, "Invalid NFS RPC port\n"); | ||
47 | + exit(1); | ||
48 | + } | ||
49 | + break; | ||
50 | + case 'y': | ||
51 | + mount_prog = strtol(optarg, NULL, 10); | ||
52 | + if (mount_prog == 0) { | ||
53 | + fprintf(stderr, "Invalid MOUNTD RPC port\n"); | ||
54 | + exit(1); | ||
55 | + } | ||
56 | + break; | ||
57 | case 'l': | ||
58 | opt_bind_addr.s_addr = inet_addr(optarg); | ||
59 | if (opt_bind_addr.s_addr == (unsigned) -1) { | ||
60 | @@ -347,12 +365,12 @@ void daemon_exit(int error) | ||
61 | #endif /* WIN32 */ | ||
62 | |||
63 | if (opt_portmapper) { | ||
64 | - svc_unregister(MOUNTPROG, MOUNTVERS1); | ||
65 | - svc_unregister(MOUNTPROG, MOUNTVERS3); | ||
66 | + svc_unregister(mount_prog, MOUNTVERS1); | ||
67 | + svc_unregister(mount_prog, MOUNTVERS3); | ||
68 | } | ||
69 | |||
70 | if (opt_portmapper) { | ||
71 | - svc_unregister(NFS3_PROGRAM, NFS_V3); | ||
72 | + svc_unregister(nfs_prog, NFS_V3); | ||
73 | } | ||
74 | |||
75 | if (error == SIGSEGV) | ||
76 | @@ -657,13 +675,13 @@ static void mountprog_3(struct svc_req * | ||
77 | static void register_nfs_service(SVCXPRT * udptransp, SVCXPRT * tcptransp) | ||
78 | { | ||
79 | if (opt_portmapper) { | ||
80 | - pmap_unset(NFS3_PROGRAM, NFS_V3); | ||
81 | + pmap_unset(nfs_prog, NFS_V3); | ||
82 | } | ||
83 | |||
84 | if (udptransp != NULL) { | ||
85 | /* Register NFS service for UDP */ | ||
86 | if (!svc_register | ||
87 | - (udptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3, | ||
88 | + (udptransp, nfs_prog, NFS_V3, nfs3_program_3, | ||
89 | opt_portmapper ? IPPROTO_UDP : 0)) { | ||
90 | fprintf(stderr, "%s\n", | ||
91 | "unable to register (NFS3_PROGRAM, NFS_V3, udp)."); | ||
92 | @@ -674,7 +692,7 @@ static void register_nfs_service(SVCXPRT | ||
93 | if (tcptransp != NULL) { | ||
94 | /* Register NFS service for TCP */ | ||
95 | if (!svc_register | ||
96 | - (tcptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3, | ||
97 | + (tcptransp, nfs_prog, NFS_V3, nfs3_program_3, | ||
98 | opt_portmapper ? IPPROTO_TCP : 0)) { | ||
99 | fprintf(stderr, "%s\n", | ||
100 | "unable to register (NFS3_PROGRAM, NFS_V3, tcp)."); | ||
101 | @@ -686,14 +704,14 @@ static void register_nfs_service(SVCXPRT | ||
102 | static void register_mount_service(SVCXPRT * udptransp, SVCXPRT * tcptransp) | ||
103 | { | ||
104 | if (opt_portmapper) { | ||
105 | - pmap_unset(MOUNTPROG, MOUNTVERS1); | ||
106 | - pmap_unset(MOUNTPROG, MOUNTVERS3); | ||
107 | + pmap_unset(mount_prog, MOUNTVERS1); | ||
108 | + pmap_unset(mount_prog, MOUNTVERS3); | ||
109 | } | ||
110 | |||
111 | if (udptransp != NULL) { | ||
112 | /* Register MOUNT service (v1) for UDP */ | ||
113 | if (!svc_register | ||
114 | - (udptransp, MOUNTPROG, MOUNTVERS1, mountprog_3, | ||
115 | + (udptransp, mount_prog, MOUNTVERS1, mountprog_3, | ||
116 | opt_portmapper ? IPPROTO_UDP : 0)) { | ||
117 | fprintf(stderr, "%s\n", | ||
118 | "unable to register (MOUNTPROG, MOUNTVERS1, udp)."); | ||
119 | @@ -702,7 +720,7 @@ static void register_mount_service(SVCXP | ||
120 | |||
121 | /* Register MOUNT service (v3) for UDP */ | ||
122 | if (!svc_register | ||
123 | - (udptransp, MOUNTPROG, MOUNTVERS3, mountprog_3, | ||
124 | + (udptransp, mount_prog, MOUNTVERS3, mountprog_3, | ||
125 | opt_portmapper ? IPPROTO_UDP : 0)) { | ||
126 | fprintf(stderr, "%s\n", | ||
127 | "unable to register (MOUNTPROG, MOUNTVERS3, udp)."); | ||
128 | @@ -713,7 +731,7 @@ static void register_mount_service(SVCXP | ||
129 | if (tcptransp != NULL) { | ||
130 | /* Register MOUNT service (v1) for TCP */ | ||
131 | if (!svc_register | ||
132 | - (tcptransp, MOUNTPROG, MOUNTVERS1, mountprog_3, | ||
133 | + (tcptransp, mount_prog, MOUNTVERS1, mountprog_3, | ||
134 | opt_portmapper ? IPPROTO_TCP : 0)) { | ||
135 | fprintf(stderr, "%s\n", | ||
136 | "unable to register (MOUNTPROG, MOUNTVERS1, tcp)."); | ||
137 | @@ -722,7 +740,7 @@ static void register_mount_service(SVCXP | ||
138 | |||
139 | /* Register MOUNT service (v3) for TCP */ | ||
140 | if (!svc_register | ||
141 | - (tcptransp, MOUNTPROG, MOUNTVERS3, mountprog_3, | ||
142 | + (tcptransp, mount_prog, MOUNTVERS3, mountprog_3, | ||
143 | opt_portmapper ? IPPROTO_TCP : 0)) { | ||
144 | fprintf(stderr, "%s\n", | ||
145 | "unable to register (MOUNTPROG, MOUNTVERS3, tcp)."); | ||
146 | --- a/mount.c | ||
147 | +++ b/mount.c | ||
148 | @@ -155,8 +155,8 @@ mountres3 *mountproc_mnt_3_svc(dirpath * | ||
149 | /* error out if not version 3 */ | ||
150 | if (rqstp->rq_vers != 3) { | ||
151 | logmsg(LOG_INFO, | ||
152 | - "%s attempted mount with unsupported protocol version", | ||
153 | - inet_ntoa(get_remote(rqstp))); | ||
154 | + "%s attempted mount with unsupported protocol version: %i", | ||
155 | + inet_ntoa(get_remote(rqstp)), rqstp->rq_vers); | ||
156 | result.fhs_status = MNT3ERR_INVAL; | ||
157 | return &result; | ||
158 | } | ||
diff --git a/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch b/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch deleted file mode 100644 index aada014117..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | daemon.c: Check exit code of chdir() | ||
2 | |||
3 | Stop the compile warning and fix the code to act on a chdir() failure. | ||
4 | If this one does fail something is very, very wrong. | ||
5 | |||
6 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
7 | |||
8 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
9 | |||
10 | --- | ||
11 | daemon.c | 3 ++- | ||
12 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
13 | |||
14 | --- a/daemon.c | ||
15 | +++ b/daemon.c | ||
16 | @@ -964,7 +964,8 @@ int main(int argc, char **argv) | ||
17 | sigaction(SIGALRM, &act, NULL); | ||
18 | |||
19 | /* don't make directory we started in busy */ | ||
20 | - chdir("/"); | ||
21 | + if(chdir("/") < 0) | ||
22 | + daemon_exit(0); | ||
23 | |||
24 | /* detach from terminal */ | ||
25 | if (opt_detach) { | ||
diff --git a/meta/recipes-devtools/unfs3/unfs3/no-yywrap.patch b/meta/recipes-devtools/unfs3/unfs3/no-yywrap.patch deleted file mode 100644 index e3496814d8..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/no-yywrap.patch +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | Upstream-Status: Backport [https://github.com/unfs3/unfs3/commit/3fa0568e6ef96e045286afe18444bc28fe93962b] | ||
2 | |||
3 | diff --git a/Config/exports.l b/Config/exports.l | ||
4 | index 662603c..7e7c4fc 100644 | ||
5 | --- a/Config/exports.l | ||
6 | +++ b/Config/exports.l | ||
7 | @@ -50,6 +50,7 @@ OLDNET {IP}"/"{IP} | ||
8 | |||
9 | %option nounput | ||
10 | %option noinput | ||
11 | +%option noyywrap | ||
12 | |||
13 | %% | ||
14 | |||
diff --git a/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch b/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch deleted file mode 100644 index 219dd35aec..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | nfs.c: Allow max sa.sun_path for a localdomain socket with the user nfs-server | ||
2 | |||
3 | There is a hard limit for the kernel of 108 characters for a | ||
4 | localdomain socket name. To avoid problems with the user nfs | ||
5 | server it should maximize the number of characters by using | ||
6 | a relative path on the server side. | ||
7 | |||
8 | Previously the nfs-server used the absolute path name passed to | ||
9 | the sa.sunpath arg for binding the socket and this has caused | ||
10 | problems for both the X server and UST binaries which make | ||
11 | heavy use of named sockets with long names. | ||
12 | |||
13 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
14 | |||
15 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
16 | |||
17 | --- | ||
18 | nfs.c | 29 +++++++++++++++++++++++++++-- | ||
19 | 1 file changed, 27 insertions(+), 2 deletions(-) | ||
20 | |||
21 | --- a/nfs.c | ||
22 | +++ b/nfs.c | ||
23 | @@ -672,6 +672,7 @@ SYMLINK3res *nfsproc3_symlink_3_svc(SYML | ||
24 | } | ||
25 | |||
26 | #ifndef WIN32 | ||
27 | +static char pathbuf_tmp[NFS_MAXPATHLEN + NFS_MAXNAMLEN + 1]; | ||
28 | |||
29 | /* | ||
30 | * create Unix socket | ||
31 | @@ -680,17 +681,41 @@ static int mksocket(const char *path, mo | ||
32 | { | ||
33 | int res, sock; | ||
34 | struct sockaddr_un addr; | ||
35 | + unsigned int len = strlen(path); | ||
36 | |||
37 | sock = socket(PF_UNIX, SOCK_STREAM, 0); | ||
38 | - addr.sun_family = AF_UNIX; | ||
39 | - strcpy(addr.sun_path, path); | ||
40 | res = sock; | ||
41 | if (res != -1) { | ||
42 | + addr.sun_family = AF_UNIX; | ||
43 | + if (len < sizeof(addr.sun_path) -1) { | ||
44 | + strcpy(addr.sun_path, path); | ||
45 | + } else { | ||
46 | + char *ptr; | ||
47 | + res = -1; | ||
48 | + if (len >= sizeof(path)) | ||
49 | + goto out; | ||
50 | + strcpy(pathbuf_tmp, path); | ||
51 | + ptr = strrchr(pathbuf_tmp,'/'); | ||
52 | + if (ptr) { | ||
53 | + *ptr = '\0'; | ||
54 | + ptr++; | ||
55 | + if (chdir(pathbuf_tmp)) | ||
56 | + goto out; | ||
57 | + } else { | ||
58 | + ptr = pathbuf_tmp; | ||
59 | + } | ||
60 | + if (strlen(ptr) >= sizeof(addr.sun_path)) | ||
61 | + goto out; | ||
62 | + strcpy(addr.sun_path, ptr); | ||
63 | + } | ||
64 | umask(~mode); | ||
65 | res = | ||
66 | bind(sock, (struct sockaddr *) &addr, | ||
67 | sizeof(addr.sun_family) + strlen(addr.sun_path)); | ||
68 | umask(0); | ||
69 | +out: | ||
70 | + if (chdir("/")) | ||
71 | + fprintf(stderr, "Internal failure to chdir /\n"); | ||
72 | close(sock); | ||
73 | } | ||
74 | return res; | ||
diff --git a/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch b/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch deleted file mode 100644 index e6d89530f8..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | From: Jason Wessel <jason.wessel@windriver.com> | ||
2 | Date: Sat, 23 Feb 2013 08:49:08 -0600 | ||
3 | Subject: [PATCH] fh_cache: fix statle nfs handle on rename problem | ||
4 | |||
5 | The following test case fails with modern linunx kernels which cache | ||
6 | the renamed inode. | ||
7 | |||
8 | % mkdir a;mkdir b;mv b a/;ls -l a | ||
9 | ls: a/b: Stale NFS file handle | ||
10 | |||
11 | The issue is that nfserver was not updating the fh_cache with the new | ||
12 | location of the inode, when it moves directories. | ||
13 | |||
14 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
15 | |||
16 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
17 | |||
18 | --- | ||
19 | fh_cache.c | 12 ++++++++++++ | ||
20 | fh_cache.h | 1 + | ||
21 | nfs.c | 2 ++ | ||
22 | 3 files changed, 15 insertions(+) | ||
23 | |||
24 | --- a/fh_cache.c | ||
25 | +++ b/fh_cache.c | ||
26 | @@ -199,6 +199,18 @@ static char *fh_cache_lookup(uint32 dev, | ||
27 | } | ||
28 | |||
29 | /* | ||
30 | + * update a fh inode cache for an operation like rename | ||
31 | + */ | ||
32 | +void fh_cache_update(nfs_fh3 fh, char *path) | ||
33 | +{ | ||
34 | + unfs3_fh_t *obj = (void *) fh.data.data_val; | ||
35 | + backend_statstruct buf; | ||
36 | + | ||
37 | + if (backend_lstat(path, &buf) != -1) { | ||
38 | + fh_cache_add(obj->dev, buf.st_ino, path); | ||
39 | + } | ||
40 | +} | ||
41 | +/* | ||
42 | * resolve a filename into a path | ||
43 | * cache-using wrapper for fh_decomp_raw | ||
44 | */ | ||
45 | --- a/fh_cache.h | ||
46 | +++ b/fh_cache.h | ||
47 | @@ -19,5 +19,6 @@ unfs3_fh_t fh_comp(const char *path, str | ||
48 | unfs3_fh_t *fh_comp_ptr(const char *path, struct svc_req *rqstp, int need_dir); | ||
49 | |||
50 | char *fh_cache_add(uint32 dev, uint64 ino, const char *path); | ||
51 | +void fh_cache_update(nfs_fh3 fh, char *path); | ||
52 | |||
53 | #endif | ||
54 | --- a/nfs.c | ||
55 | +++ b/nfs.c | ||
56 | @@ -876,6 +876,8 @@ RENAME3res *nfsproc3_rename_3_svc(RENAME | ||
57 | res = backend_rename(from_obj, to_obj); | ||
58 | if (res == -1) | ||
59 | result.status = rename_err(); | ||
60 | + /* Update the fh_cache with moved inode value */ | ||
61 | + fh_cache_update(argp->to.dir, to_obj); | ||
62 | } | ||
63 | } | ||
64 | |||
diff --git a/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch b/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch deleted file mode 100644 index b3521c63eb..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | daemon.c: Add option for tcp no delay | ||
2 | |||
3 | Allow the NFS tcp sockets to conditionally use TCP_NODELAY | ||
4 | |||
5 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
6 | |||
7 | --- | ||
8 | daemon.c | 9 ++++++++- | ||
9 | 1 file changed, 8 insertions(+), 1 deletion(-) | ||
10 | |||
11 | --- a/daemon.c | ||
12 | +++ b/daemon.c | ||
13 | @@ -17,6 +17,7 @@ | ||
14 | #ifndef WIN32 | ||
15 | #include <sys/socket.h> | ||
16 | #include <netinet/in.h> | ||
17 | +#include <netinet/tcp.h> | ||
18 | #include <arpa/inet.h> | ||
19 | #include <syslog.h> | ||
20 | #else /* WIN32 */ | ||
21 | @@ -75,6 +76,7 @@ unsigned int opt_mount_port = NFS_PORT; | ||
22 | int opt_singleuser = FALSE; | ||
23 | int opt_brute_force = FALSE; | ||
24 | int opt_testconfig = FALSE; | ||
25 | +int opt_tcp_nodelay = FALSE; | ||
26 | struct in_addr opt_bind_addr; | ||
27 | int opt_readable_executables = FALSE; | ||
28 | char *opt_pid_file = NULL; | ||
29 | @@ -208,7 +210,7 @@ static void parse_options(int argc, char | ||
30 | { | ||
31 | |||
32 | int opt = 0; | ||
33 | - char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:"; | ||
34 | + char *optstring = "bcC:de:hl:m:Nn:prstTuwi:x:y:"; | ||
35 | |||
36 | while (opt != -1) { | ||
37 | opt = getopt(argc, argv, optstring); | ||
38 | @@ -295,6 +297,9 @@ static void parse_options(int argc, char | ||
39 | exit(1); | ||
40 | } | ||
41 | break; | ||
42 | + case 'N': | ||
43 | + opt_tcp_nodelay = TRUE; | ||
44 | + break; | ||
45 | case 'n': | ||
46 | opt_nfs_port = strtol(optarg, NULL, 10); | ||
47 | if (opt_nfs_port == 0) { | ||
48 | @@ -802,6 +807,8 @@ static SVCXPRT *create_tcp_transport(uns | ||
49 | sin.sin_addr.s_addr = opt_bind_addr.s_addr; | ||
50 | sock = socket(PF_INET, SOCK_STREAM, 0); | ||
51 | setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on)); | ||
52 | + if (opt_tcp_nodelay) | ||
53 | + setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); | ||
54 | if (bind(sock, (struct sockaddr *) &sin, sizeof(struct sockaddr))) { | ||
55 | perror("bind"); | ||
56 | fprintf(stderr, "Couldn't bind to tcp port %d\n", port); | ||
diff --git a/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch b/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch deleted file mode 100644 index 6f64dd5b3e..0000000000 --- a/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | Fix parallel build dependency issue | ||
2 | |||
3 | If building with make -j2 the lib.a will not get built in time. | ||
4 | |||
5 | Jason Wessel <jason.wessel@windriver.com> | ||
6 | |||
7 | Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/ | ||
8 | |||
9 | --- | ||
10 | Config/Makefile.in | 3 +++ | ||
11 | Makefile.in | 3 ++- | ||
12 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
13 | |||
14 | --- a/Makefile.in | ||
15 | +++ b/Makefile.in | ||
16 | @@ -29,7 +29,8 @@ DESTDIR = | ||
17 | |||
18 | VPATH = $(srcdir) | ||
19 | |||
20 | -all: subdirs unfsd$(EXEEXT) | ||
21 | +all: subdirs | ||
22 | + $(MAKE) unfsd$(EXEEXT) | ||
23 | |||
24 | unfsd$(EXEEXT): $(OBJS) $(CONFOBJ) $(EXTRAOBJ) | ||
25 | $(CC) -o $@ $(OBJS) $(CONFOBJ) $(EXTRAOBJ) $(LDFLAGS) | ||
26 | --- a/Config/Makefile.in | ||
27 | +++ b/Config/Makefile.in | ||
28 | @@ -16,6 +16,9 @@ lib.a: $(OBJS) | ||
29 | $(AR) crs lib.a $(OBJS) | ||
30 | |||
31 | y.tab.h y.tab.c: $(srcdir)/exports.y | ||
32 | +y.tab.h: y.tab.c | ||
33 | + | ||
34 | +y.tab.c: $(srcdir)/exports.y | ||
35 | $(YACC) -d $(srcdir)/exports.y | ||
36 | |||
37 | y.tab.o: y.tab.c $(srcdir)/exports.h $(top_srcdir)/nfs.h $(top_srcdir)/mount.h $(top_srcdir)/daemon.h | ||
diff --git a/meta/recipes-devtools/unfs3/unfs3_git.bb b/meta/recipes-devtools/unfs3/unfs3_git.bb index 66016a2949..606c103a79 100644 --- a/meta/recipes-devtools/unfs3/unfs3_git.bb +++ b/meta/recipes-devtools/unfs3/unfs3_git.bb | |||
@@ -11,35 +11,16 @@ DEPENDS = "flex-native bison-native flex" | |||
11 | DEPENDS += "libtirpc" | 11 | DEPENDS += "libtirpc" |
12 | DEPENDS:append:class-nativesdk = " flex-nativesdk" | 12 | DEPENDS:append:class-nativesdk = " flex-nativesdk" |
13 | 13 | ||
14 | ASNEEDED = "" | ||
15 | |||
16 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |
17 | SRC_URI = "git://github.com/unfs3/unfs3.git;protocol=https;branch=master \ | 15 | SRC_URI = "git://github.com/unfs3/unfs3.git;protocol=https;branch=master \ |
18 | file://unfs3_parallel_build.patch \ | 16 | file://0001-daemon.c-Fix-race-window-for-writing-of-the-pid-file.patch \ |
19 | file://alternate_rpc_ports.patch \ | ||
20 | file://fix_pid_race_parent_writes_child_pid.patch \ | ||
21 | file://fix_compile_warning.patch \ | ||
22 | file://rename_fh_cache.patch \ | ||
23 | file://relative_max_socket_path_len.patch \ | ||
24 | file://tcp_no_delay.patch \ | ||
25 | file://0001-daemon.c-Libtirpc-porting-fixes.patch \ | ||
26 | file://0001-attr-fix-utime-for-symlink.patch \ | ||
27 | file://0001-Add-listen-action-for-a-tcp-socket.patch \ | ||
28 | file://no-yywrap.patch \ | ||
29 | " | 17 | " |
30 | SRCREV = "c12a5c69a8d59be6916cbd0e0f41c159f1962425" | 18 | SRCREV = "c8f2d2cd4529955419bad0e163f88d47ff176b8d" |
31 | UPSTREAM_CHECK_GITTAGREGEX = "unfs3\-(?P<pver>\d+(\.\d+)+)" | 19 | UPSTREAM_CHECK_GITTAGREGEX = "unfs3\-(?P<pver>\d+(\.\d+)+)" |
32 | 20 | ||
33 | PV = "0.9.22+${SRCPV}" | 21 | PV = "0.10.0" |
34 | 22 | ||
35 | BBCLASSEXTEND = "native nativesdk" | 23 | BBCLASSEXTEND = "native nativesdk" |
36 | 24 | ||
37 | inherit autotools | 25 | inherit autotools pkgconfig |
38 | EXTRA_OECONF:append:class-native = " --sbindir=${bindir}" | 26 | EXTRA_OECONF:append:class-native = " --sbindir=${bindir}" |
39 | CFLAGS:append = " -I${STAGING_INCDIR}/tirpc" | ||
40 | EXTRA_OECONF:append = " LIBS=-ltirpc" | ||
41 | |||
42 | # Turn off these header detects else the inode search | ||
43 | # will walk entire file systems and this is a real problem | ||
44 | # if you have 2 TB of files to walk in your file system | ||
45 | CACHED_CONFIGUREVARS = "ac_cv_header_mntent_h=no ac_cv_header_sys_mnttab_h=no" | ||
diff --git a/scripts/runqemu-export-rootfs b/scripts/runqemu-export-rootfs index 384c091713..c1fff7fcb3 100755 --- a/scripts/runqemu-export-rootfs +++ b/scripts/runqemu-export-rootfs | |||
@@ -74,26 +74,11 @@ MOUNTD_PORT=${MOUNTD_PORT:=$[ 3048 + 2 * $NFS_INSTANCE ]} | |||
74 | 74 | ||
75 | ## For debugging you would additionally add | 75 | ## For debugging you would additionally add |
76 | ## --debug all | 76 | ## --debug all |
77 | UNFSD_OPTS="-p -N -i $NFSPID -e $EXPORTS -n $NFSD_PORT -m $MOUNTD_PORT" | 77 | UNFSD_OPTS="-p -i $NFSPID -e $EXPORTS -n $NFSD_PORT -m $MOUNTD_PORT" |
78 | 78 | ||
79 | # See how we were called. | 79 | # See how we were called. |
80 | case "$1" in | 80 | case "$1" in |
81 | start) | 81 | start) |
82 | PORTMAP_RUNNING=`ps -ef | grep portmap | grep -v grep` | ||
83 | RPCBIND_RUNNING=`ps -ef | grep rpcbind | grep -v grep` | ||
84 | if [[ "x$PORTMAP_RUNNING" = "x" && "x$RPCBIND_RUNNING" = "x" ]]; then | ||
85 | echo "=======================================================" | ||
86 | echo "Error: neither rpcbind nor portmap appear to be running" | ||
87 | echo "Please install and start one of these services first" | ||
88 | echo "=======================================================" | ||
89 | echo "Tip: for recent Ubuntu hosts, run:" | ||
90 | echo " sudo apt-get install rpcbind" | ||
91 | echo "Then add OPTIONS=\"-i -w\" to /etc/default/rpcbind and run" | ||
92 | echo " sudo service portmap restart" | ||
93 | |||
94 | exit 1 | ||
95 | fi | ||
96 | |||
97 | echo "Creating exports file..." | 82 | echo "Creating exports file..." |
98 | echo "$NFS_EXPORT_DIR (rw,no_root_squash,no_all_squash,insecure)" > $EXPORTS | 83 | echo "$NFS_EXPORT_DIR (rw,no_root_squash,no_all_squash,insecure)" > $EXPORTS |
99 | 84 | ||