Accepting request 264790 from home:kukuk:NIS
Update to rpcbind 0.2.2 and port most patches to it. 6 are still missing. - Split off 0003-systemd-no-dualmode.patch from 0001-systemd-enhancements.patch for easier upstream submission. - Split off 0004-systemd-sd_notify.patch from 0001-systemd-enhancements.patch for easier upstream submission. - Rename 0001-systemd-enhancements.patch to 0001-systemd-unit-files.patch - Update to latest rpcbind 0.2.2 upstream release. - Following patches are upstream: - 0001-Fix-building-one-systems-w-out-nss.h.patch - 0002-Rename-configure.in-to-configure.ac.patch - 0003-rpcbind-rpcuser-not-being-set-in-Makefile.am.patch - 0004-Silence-a-warning-about-setgroups-being-implicitly-d.patch - Adjust following patches: - 0005-Remove-obsolete-function-in6_fillscopeid.patch - 0006-In-init_transport-move-creation-of-COTS-sockets-clos.patch - 0018-configure-check-for-nss.h.patch - Obsolete patches: - 0015-When-using-systemd-activation-make-rpcbind-notify-sy.patch - 0016-Notify-systemd-unconditionally.patch - 0012-Support-systemd-activation.patch - 0013-socket-activation-Fix-rpcbind.service-to-use-separat.patch - 0017-Pull-the-sysconfig-file-into-rpcbind.service-and-use.patch - 0025-rpcinfo-warmstat_no-warning-about-missing-file.patch - 0026-systemd-no-default-dep - 0027-socket-before-service.patch - 0028-rpcbind-after-var-run.patch - 0029-rpcbind-sd-notify-stupid-errmsg.patch - New patches: - 0001-systemd-enhancements.patch - 0002-rpcinfo_warmstart-no_warning_about_missing_file.patch OBS-URL: https://build.opensuse.org/request/show/264790 OBS-URL: https://build.opensuse.org/package/show/network/rpcbind?expand=0&rev=51
This commit is contained in:
parent
3c8bc5a794
commit
c213227f60
@ -1,35 +0,0 @@
|
||||
From c4814d539434391df4dfa61551e5e2e96947326d Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Thu, 21 Feb 2013 10:39:33 -0500
|
||||
Subject: [PATCH 01/24] Fix building one systems w/out nss.h
|
||||
|
||||
The nss.h header is glibc-specific, so use the existing HAVE_NSS_H define
|
||||
to avoid including/using it when it is not available.
|
||||
|
||||
URL: http://bugs.gentoo.org/458024
|
||||
Reported-by: Mark Reiche <porphyr@gmx.de>
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
src/rpcbind.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index 9a0504d..83dbe93 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -67,7 +67,11 @@
|
||||
#include <pwd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
+#ifdef HAVE_NSS_H
|
||||
#include <nss.h>
|
||||
+#else
|
||||
+static inline void __nss_configure_lookup(const char *db, const char *s) {}
|
||||
+#endif
|
||||
#include "rpcbind.h"
|
||||
|
||||
/*#define RPCBIND_DEBUG*/
|
||||
--
|
||||
1.7.12.4
|
||||
|
65
0001-systemd-unit-files.patch
Normal file
65
0001-systemd-unit-files.patch
Normal file
@ -0,0 +1,65 @@
|
||||
Add systemd unit files
|
||||
|
||||
Signed-off-by: Thorsten Kukuk <kukuk@suse.de>
|
||||
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am 2014/12/10 13:27:31
|
||||
@@ -45,6 +45,14 @@
|
||||
AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD
|
||||
|
||||
rpcbind_LDADD += $(SYSTEMD_LIBS)
|
||||
+
|
||||
+systemd/rpcbind.service: systemd/rpcbind.service.in Makefile
|
||||
+ sed -e 's,@bindir\@,$(bindir),g' \
|
||||
+ < $< > $@ || rm $@
|
||||
+
|
||||
+systemdsystemunit_DATA = \
|
||||
+ systemd/rpcbind.service \
|
||||
+ systemd/rpcbind.socket
|
||||
endif
|
||||
|
||||
rpcinfo_SOURCES = src/rpcinfo.c
|
||||
--- a/systemd/.gitignore
|
||||
+++ b/systemd/.gitignore 2014/12/10 13:27:31
|
||||
@@ -0,0 +1 @@
|
||||
+rpcbind.service
|
||||
--- a/systemd/rpcbind.service.in
|
||||
+++ b/systemd/rpcbind.service.in 2014/12/10 13:27:31
|
||||
@@ -0,0 +1,16 @@
|
||||
+[Unit]
|
||||
+Description=RPC Bind
|
||||
+Documentation=man:rpcbind(8)
|
||||
+DefaultDependencies=no
|
||||
+Requires=rpcbind.socket
|
||||
+Wants=var-run.mount
|
||||
+After=var-run.mount
|
||||
+
|
||||
+[Service]
|
||||
+Type=notify
|
||||
+EnvironmentFile=-/etc/sysconfig/rpcbind
|
||||
+ExecStart=@bindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
+Also=rpcbind.socket
|
||||
--- a/systemd/rpcbind.socket
|
||||
+++ b/systemd/rpcbind.socket 2014/12/10 13:27:58
|
||||
@@ -0,0 +1,18 @@
|
||||
+[Unit]
|
||||
+Description=RPCbind Server Activation Socket
|
||||
+DefaultDependencies=no
|
||||
+Wants=rpcbind.target
|
||||
+Before=rpcbind.target
|
||||
+
|
||||
+[Socket]
|
||||
+ListenStream=/run/rpcbind.sock
|
||||
+
|
||||
+# RPC netconfig can't handle ipv6/ipv4 dual sockets
|
||||
+BindIPv6Only=ipv6-only
|
||||
+ListenStream=0.0.0.0:111
|
||||
+ListenDatagram=0.0.0.0:111
|
||||
+ListenStream=[::]:111
|
||||
+ListenDatagram=[::]:111
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
@ -1,109 +0,0 @@
|
||||
From 5618b2f89a752e8bacf9f7c847fd99484a9d3bbc Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Tue, 26 Mar 2013 10:59:42 -0400
|
||||
Subject: [PATCH 02/24] Rename configure.in to configure.ac
|
||||
|
||||
Newer autotools wants this to end in .ac.
|
||||
|
||||
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
configure.ac | 39 +++++++++++++++++++++++++++++++++++++++
|
||||
configure.in | 39 ---------------------------------------
|
||||
2 files changed, 39 insertions(+), 39 deletions(-)
|
||||
create mode 100644 configure.ac
|
||||
delete mode 100644 configure.in
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
new file mode 100644
|
||||
index 0000000..2b67720
|
||||
--- /dev/null
|
||||
+++ b/configure.ac
|
||||
@@ -0,0 +1,39 @@
|
||||
+AC_INIT(rpcbind, 0.2.0)
|
||||
+
|
||||
+AM_INIT_AUTOMAKE
|
||||
+AC_CONFIG_SRCDIR([src/rpcbind.c])
|
||||
+AC_PREFIX_DEFAULT(/usr)
|
||||
+AC_PROG_CC
|
||||
+
|
||||
+AC_ARG_ENABLE([libwrap],
|
||||
+ AS_HELP_STRING([--enable-libwrap], [Enables host name checking through tcpd @<:@default=no@:>@]))
|
||||
+AM_CONDITIONAL(LIBWRAP, test x$enable_libwrap = xyes)
|
||||
+
|
||||
+AC_ARG_ENABLE([debug],
|
||||
+ AS_HELP_STRING([--enable-debug], [Turns on rpcbind debugging @<:@default=no@:>@]))
|
||||
+AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
|
||||
+
|
||||
+AC_ARG_ENABLE([warmstarts],
|
||||
+ AS_HELP_STRING([--enable-warmstarts], [Enables Warm Starts @<:@default=no@:>@]))
|
||||
+AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes)
|
||||
+
|
||||
+AC_ARG_WITH([statedir],
|
||||
+ AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/tmp@:>@])
|
||||
+ ,, [with_statedir=/tmp])
|
||||
+AC_SUBST([statedir], [$with_statedir])
|
||||
+
|
||||
+AC_ARG_WITH([rpcuser],
|
||||
+ AS_HELP_STRING([--with-rpcuser=ARG], [use ARG for RPC @<:@default=root@:>@]),
|
||||
+ ,, [with_rpcuser=root])
|
||||
+AC_SUBST([rpcuser], [$with_rpcuser])
|
||||
+
|
||||
+PKG_CHECK_MODULES([TIRPC], [libtirpc])
|
||||
+
|
||||
+AS_IF([test x$enable_libwrap = xyes], [
|
||||
+ AC_CHECK_LIB([wrap], [hosts_access], ,
|
||||
+ AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
|
||||
+])
|
||||
+
|
||||
+AC_SEARCH_LIBS([pthread_create], [pthread])
|
||||
+
|
||||
+AC_OUTPUT([Makefile])
|
||||
diff --git a/configure.in b/configure.in
|
||||
deleted file mode 100644
|
||||
index 2b67720..0000000
|
||||
--- a/configure.in
|
||||
+++ /dev/null
|
||||
@@ -1,39 +0,0 @@
|
||||
-AC_INIT(rpcbind, 0.2.0)
|
||||
-
|
||||
-AM_INIT_AUTOMAKE
|
||||
-AC_CONFIG_SRCDIR([src/rpcbind.c])
|
||||
-AC_PREFIX_DEFAULT(/usr)
|
||||
-AC_PROG_CC
|
||||
-
|
||||
-AC_ARG_ENABLE([libwrap],
|
||||
- AS_HELP_STRING([--enable-libwrap], [Enables host name checking through tcpd @<:@default=no@:>@]))
|
||||
-AM_CONDITIONAL(LIBWRAP, test x$enable_libwrap = xyes)
|
||||
-
|
||||
-AC_ARG_ENABLE([debug],
|
||||
- AS_HELP_STRING([--enable-debug], [Turns on rpcbind debugging @<:@default=no@:>@]))
|
||||
-AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
|
||||
-
|
||||
-AC_ARG_ENABLE([warmstarts],
|
||||
- AS_HELP_STRING([--enable-warmstarts], [Enables Warm Starts @<:@default=no@:>@]))
|
||||
-AM_CONDITIONAL(WARMSTART, test x$enable_warmstarts = xyes)
|
||||
-
|
||||
-AC_ARG_WITH([statedir],
|
||||
- AS_HELP_STRING([--with-statedir=ARG], [use ARG as state dir @<:@default=/tmp@:>@])
|
||||
- ,, [with_statedir=/tmp])
|
||||
-AC_SUBST([statedir], [$with_statedir])
|
||||
-
|
||||
-AC_ARG_WITH([rpcuser],
|
||||
- AS_HELP_STRING([--with-rpcuser=ARG], [use ARG for RPC @<:@default=root@:>@]),
|
||||
- ,, [with_rpcuser=root])
|
||||
-AC_SUBST([rpcuser], [$with_rpcuser])
|
||||
-
|
||||
-PKG_CHECK_MODULES([TIRPC], [libtirpc])
|
||||
-
|
||||
-AS_IF([test x$enable_libwrap = xyes], [
|
||||
- AC_CHECK_LIB([wrap], [hosts_access], ,
|
||||
- AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
|
||||
-])
|
||||
-
|
||||
-AC_SEARCH_LIBS([pthread_create], [pthread])
|
||||
-
|
||||
-AC_OUTPUT([Makefile])
|
||||
--
|
||||
1.7.12.4
|
||||
|
25
0002-rpcinfo_warmstart-no_warning_about_missing_file.patch
Normal file
25
0002-rpcinfo_warmstart-no_warning_about_missing_file.patch
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Don't print an error message on warmstart if the
|
||||
startup files don't exist.
|
||||
|
||||
Signed-off-by: Thorsten Kukuk <kukuk@suse.de>
|
||||
|
||||
--- a/src/warmstart.c
|
||||
+++ b/src/warmstart.c 2014/12/10 15:04:42
|
||||
@@ -101,13 +101,13 @@
|
||||
{
|
||||
FILE *fp;
|
||||
XDR xdrs;
|
||||
-
|
||||
+
|
||||
if (debugging)
|
||||
fprintf(stderr, "rpcbind: using '%s' startup file\n", filename);
|
||||
|
||||
- if ((fp = fopen(filename, "r")) == NULL) {
|
||||
+ if (((fp = fopen(filename, "r")) == NULL) && errno != ENOENT) {
|
||||
syslog(LOG_ERR,
|
||||
- "Cannot open '%s' file for reading, errno %d (%s)",
|
||||
+ "Cannot open '%s' file for reading, errno %d (%s)",
|
||||
filename, errno, strerror(errno));
|
||||
goto error;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
From b3b031b07cc5909aaf964f9d4cf46f6097769320 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Dickson <steved@redhat.com>
|
||||
Date: Wed, 21 Aug 2013 14:40:22 -0400
|
||||
Subject: [PATCH 03/24] rpcbind: rpcuser not being set in Makefile.am
|
||||
|
||||
Commit 8d7a0708 cause a regression where the rpcuser id was not
|
||||
being set, which in turn cause rpcbind to immediately exit.
|
||||
This patch removes the extra ',' that was in the AC_ARG_WITH
|
||||
statement in the configure.ac file.
|
||||
|
||||
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 2b67720..1cf42d3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -23,7 +23,7 @@ AC_ARG_WITH([statedir],
|
||||
AC_SUBST([statedir], [$with_statedir])
|
||||
|
||||
AC_ARG_WITH([rpcuser],
|
||||
- AS_HELP_STRING([--with-rpcuser=ARG], [use ARG for RPC @<:@default=root@:>@]),
|
||||
+ AS_HELP_STRING([--with-rpcuser=ARG], [use ARG for RPC @<:@default=root@:>@])
|
||||
,, [with_rpcuser=root])
|
||||
AC_SUBST([rpcuser], [$with_rpcuser])
|
||||
|
||||
--
|
||||
1.7.12.4
|
||||
|
58
0003-systemd-no-dualmode.patch
Normal file
58
0003-systemd-no-dualmode.patch
Normal file
@ -0,0 +1,58 @@
|
||||
Systemd will, by default, pass a socket that provides both IPv4 and
|
||||
IPv6 services. RPC netconfig requires that sockets be either IPv4
|
||||
or IPv6. Add a warning to rpcbind should the user encounter an issue.
|
||||
|
||||
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
|
||||
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c 2014/12/10 13:48:28
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
+#include <netinet/in.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/rpc_com.h>
|
||||
#ifdef PORTMAP
|
||||
@@ -277,6 +285,31 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Normally systemd will open sockets in dual ipv4/ipv6 mode.
|
||||
+ * That won't work with netconfig and we'll only match
|
||||
+ * the ipv6 socket. Convert it to IPV6_V6ONLY and issue
|
||||
+ * a warning for the user to fix their systemd config.
|
||||
+ */
|
||||
+static int
|
||||
+handle_ipv6_socket(int fd)
|
||||
+{
|
||||
+ int opt;
|
||||
+ socklen_t len = sizeof(opt);
|
||||
+
|
||||
+ if (getsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, &len)) {
|
||||
+ syslog(LOG_ERR, "failed to get ipv6 socket opts: %m");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (opt) /* socket is already in V6ONLY mode */
|
||||
+ return 0;
|
||||
+
|
||||
+ syslog(LOG_ERR, "systemd has passed an IPv4/IPv6 dual-mode socket.");
|
||||
+ syslog(LOG_ERR, "Please fix your systemd config by specifying IPv4 and IPv6 sockets separately and using BindIPv6Only=ipv6-only.");
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Adds the entry into the rpcbind database.
|
||||
* If PORTMAP, then for UDP and TCP, it adds the entries for version 2 also
|
||||
* Returns 0 if succeeds, else fails
|
||||
@@ -361,6 +394,9 @@
|
||||
goto error;
|
||||
}
|
||||
|
||||
+ if (sa.sa.sa_family == AF_INET6 && handle_ipv6_socket(fd))
|
||||
+ goto error;
|
||||
+
|
||||
/* Copy the address */
|
||||
taddr.addr.maxlen = taddr.addr.len = addrlen;
|
||||
taddr.addr.buf = malloc(addrlen);
|
@ -1,26 +0,0 @@
|
||||
From 2b08a74a9be128a46cefae87354e21e67f506bc0 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Kirch <okir@suse.de>
|
||||
Date: Tue, 20 Aug 2013 11:43:13 +0200
|
||||
Subject: [PATCH 04/24] Silence a warning about setgroups() being implicitly
|
||||
defined
|
||||
|
||||
Signed-off-by: Olaf Kirch <okir@suse.de>
|
||||
---
|
||||
src/rpcbind.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index 83dbe93..7ed72bc 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -65,6 +65,7 @@
|
||||
#include <syslog.h>
|
||||
#include <err.h>
|
||||
#include <pwd.h>
|
||||
+#include <grp.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_NSS_H
|
||||
--
|
||||
1.7.12.4
|
||||
|
20
0004-systemd-sd_notify.patch
Normal file
20
0004-systemd-sd_notify.patch
Normal file
@ -0,0 +1,20 @@
|
||||
Always notify systemd that rpcbind is ready and running.
|
||||
|
||||
Signed-off-by: Thorsten Kukuk <kukuk@suse.de>
|
||||
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c 2014/12/10 13:48:28
|
||||
@@ -268,6 +269,13 @@
|
||||
|
||||
network_init();
|
||||
|
||||
+#ifdef SYSTEMD
|
||||
+ /* Try to notify system of successful startup, regardless of whether we
|
||||
+ * used systemd socket activation or not. When started from the command
|
||||
+ * line, this should not hurt either.
|
||||
+ */
|
||||
+ sd_notify(0, "READY=1");
|
||||
+#endif
|
||||
my_svc_run();
|
||||
syslog(LOG_ERR, "svc_run returned unexpectedly");
|
||||
rpcbind_abort();
|
@ -19,7 +19,7 @@ diff --git a/src/util.c b/src/util.c
|
||||
index 9a5fb69..a6c835b 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -71,9 +71,6 @@ static struct sockaddr_in6 *local_in6;
|
||||
@@ -71,9 +71,6 @@
|
||||
#endif
|
||||
|
||||
static int bitmaskcmp __P((void *, void *, void *, int));
|
||||
@ -29,7 +29,7 @@ index 9a5fb69..a6c835b 100644
|
||||
|
||||
/*
|
||||
* For all bits set in "mask", compare the corresponding bits in
|
||||
@@ -93,26 +90,6 @@ bitmaskcmp(void *dst, void *src, void *mask, int bytelen)
|
||||
@@ -93,28 +90,6 @@
|
||||
}
|
||||
|
||||
/*
|
||||
@ -41,12 +41,14 @@ index 9a5fb69..a6c835b 100644
|
||||
-in6_fillscopeid(struct sockaddr_in6 *sin6)
|
||||
-{
|
||||
- u_int16_t ifindex;
|
||||
- u_int16_t *addr;
|
||||
-
|
||||
- if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
|
||||
- ifindex = ntohs(*(u_int16_t *)&sin6->sin6_addr.s6_addr[2]);
|
||||
- addr = (u_int16_t *)&sin6->sin6_addr.s6_addr[2];
|
||||
- ifindex = ntohs(*addr);
|
||||
- if (sin6->sin6_scope_id == 0 && ifindex != 0) {
|
||||
- sin6->sin6_scope_id = ifindex;
|
||||
- *(u_int16_t *)&sin6->sin6_addr.s6_addr[2] = 0;
|
||||
- *addr = 0;
|
||||
- }
|
||||
- }
|
||||
-}
|
||||
@ -56,7 +58,7 @@ index 9a5fb69..a6c835b 100644
|
||||
* Find a server address that can be used by `caller' to contact
|
||||
* the local service specified by `serv_uaddr'. If `clnt_uaddr' is
|
||||
* non-NULL, it is used instead of `caller' as a hint suggesting
|
||||
@@ -209,7 +186,6 @@ addrmerge(struct netbuf *caller, char *serv_uaddr, char *clnt_uaddr,
|
||||
@@ -211,7 +186,6 @@
|
||||
* a link-local address then use the scope id to see
|
||||
* which one.
|
||||
*/
|
||||
@ -64,6 +66,4 @@ index 9a5fb69..a6c835b 100644
|
||||
if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(ifsa)) &&
|
||||
IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(caller_sa)) &&
|
||||
IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa))) {
|
||||
--
|
||||
1.7.12.4
|
||||
|
||||
|
@ -13,9 +13,9 @@ diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index 7ed72bc..f562f7a 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -309,18 +309,6 @@ init_transport(struct netconfig *nconf)
|
||||
}
|
||||
#endif
|
||||
@@ -389,18 +389,6 @@
|
||||
if (my_xprt != NULL)
|
||||
goto got_socket;
|
||||
|
||||
- /*
|
||||
- * XXX - using RPC library internal functions. For NC_TPI_CLTS
|
||||
@ -29,10 +29,10 @@ index 7ed72bc..f562f7a 100644
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (!__rpc_nconf2sockinfo(nconf, &si)) {
|
||||
syslog(LOG_ERR, "cannot get information for %s",
|
||||
nconf->nc_netid);
|
||||
@@ -487,6 +475,12 @@ init_transport(struct netconfig *nconf)
|
||||
if ((strcmp(nconf->nc_netid, "local") == 0) ||
|
||||
(strcmp(nconf->nc_netid, "unix") == 0)) {
|
||||
memset(&sun, 0, sizeof sun);
|
||||
@@ -561,6 +549,12 @@
|
||||
if (!checkbind)
|
||||
return 1;
|
||||
} else { /* NC_TPI_COTS */
|
||||
@ -45,6 +45,3 @@ index 7ed72bc..f562f7a 100644
|
||||
if ((strcmp(nconf->nc_netid, "local") != 0) &&
|
||||
(strcmp(nconf->nc_netid, "unix") != 0)) {
|
||||
if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
|
||||
--
|
||||
1.7.12.4
|
||||
|
||||
|
@ -1,372 +0,0 @@
|
||||
From d92c22d7e8d476b7772ce4e3d8e23200d0048b45 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Kirch <okir@suse.de>
|
||||
Date: Tue, 20 Aug 2013 11:26:42 +0200
|
||||
Subject: [PATCH 12/24] Support systemd activation.
|
||||
|
||||
This code is loosely based on previous work by Tom Gundersen <teg@jklm.no>.
|
||||
|
||||
Signed-off-by: Olaf Kirch <okir@suse.de>
|
||||
---
|
||||
Makefile.am | 15 ++++
|
||||
configure.ac | 11 +++
|
||||
src/rpcbind.c | 172 ++++++++++++++++++++++++++++++++++++---------
|
||||
systemd/.gitignore | 1 +
|
||||
systemd/rpcbind.service.in | 9 +++
|
||||
systemd/rpcbind.socket | 12 ++++
|
||||
6 files changed, 188 insertions(+), 32 deletions(-)
|
||||
create mode 100644 systemd/.gitignore
|
||||
create mode 100644 systemd/rpcbind.service.in
|
||||
create mode 100644 systemd/rpcbind.socket
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index d10c906..df755dd 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -38,6 +38,21 @@ rpcbind_SOURCES = \
|
||||
src/warmstart.c
|
||||
rpcbind_LDADD = $(TIRPC_LIBS)
|
||||
|
||||
+if SYSTEMD
|
||||
+AM_CPPFLAGS += $(SYSTEMD_CFLAGS) -DSYSTEMD
|
||||
+
|
||||
+rpcbind_LDADD += $(SYSTEMD_LIBS)
|
||||
+
|
||||
+systemd/rpcbind.service: systemd/rpcbind.service.in Makefile
|
||||
+ sed -e 's,@bindir\@,$(bindir),g' \
|
||||
+ < $< > $@ || rm $@
|
||||
+
|
||||
+systemdsystemunit_DATA = \
|
||||
+ systemd/rpcbind.service \
|
||||
+ systemd/rpcbind.socket
|
||||
+
|
||||
+endif
|
||||
+
|
||||
rpcinfo_SOURCES = src/rpcinfo.c
|
||||
rpcinfo_LDADD = $(TIRPC_LIBS)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 1cf42d3..a94933b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -29,6 +29,17 @@ AC_SUBST([rpcuser], [$with_rpcuser])
|
||||
|
||||
PKG_CHECK_MODULES([TIRPC], [libtirpc])
|
||||
|
||||
+PKG_PROG_PKG_CONFIG
|
||||
+AC_ARG_WITH([systemdsystemunitdir],
|
||||
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
|
||||
+ if test "x$with_systemdsystemunitdir" != xno -a "x$with_systemdsystemunitdir" != "x"; then
|
||||
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
+ PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon])
|
||||
+ fi
|
||||
+AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
+
|
||||
+
|
||||
AS_IF([test x$enable_libwrap = xyes], [
|
||||
AC_CHECK_LIB([wrap], [hosts_access], ,
|
||||
AC_MSG_ERROR([libwrap support requested but unable to find libwrap]))
|
||||
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index 3b753c6..baf1ac0 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -56,6 +56,9 @@
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
+#ifdef SYSTEMD
|
||||
+#include <systemd/sd-daemon.h>
|
||||
+#endif
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
@@ -100,6 +103,9 @@ int runasdaemon = 0;
|
||||
int insecure = 0;
|
||||
int oldstyle_local = 0;
|
||||
int verboselog = 0;
|
||||
+#ifdef SYSTEMD
|
||||
+int systemd_activation = 0;
|
||||
+#endif
|
||||
|
||||
char **hosts = NULL;
|
||||
int nhosts = 0;
|
||||
@@ -123,6 +129,10 @@ static char superuser[] = "superuser";
|
||||
|
||||
int main __P((int, char *[]));
|
||||
|
||||
+static void init_transports_daemon __P((void));
|
||||
+#ifdef SYSTEMD
|
||||
+static void init_transports_systemd __P((void));
|
||||
+#endif
|
||||
static int init_transport __P((struct netconfig *));
|
||||
static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
|
||||
struct netbuf *));
|
||||
@@ -132,11 +142,15 @@ static void parseargs __P((int, char *[]));
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
- struct netconfig *nconf;
|
||||
- void *nc_handle; /* Net config handle */
|
||||
struct rlimit rl;
|
||||
int maxrec = RPC_MAXDATASIZE;
|
||||
|
||||
+#ifdef SYSTEMD
|
||||
+ /* See whether we've been activated by systemd */
|
||||
+ if (sd_listen_fds(0) > 0)
|
||||
+ systemd_activation = 1;
|
||||
+#endif
|
||||
+
|
||||
parseargs(argc, argv);
|
||||
|
||||
/* Check that another rpcbind isn't already running. */
|
||||
@@ -167,29 +181,14 @@ main(int argc, char *argv[])
|
||||
*/
|
||||
__nss_configure_lookup("services", "files");
|
||||
|
||||
- nc_handle = setnetconfig(); /* open netconfig file */
|
||||
- if (nc_handle == NULL) {
|
||||
- syslog(LOG_ERR, "could not read /etc/netconfig");
|
||||
- exit(1);
|
||||
- }
|
||||
-
|
||||
- nconf = getnetconfigent("local");
|
||||
- if (nconf == NULL)
|
||||
- nconf = getnetconfigent("unix");
|
||||
- if (nconf == NULL) {
|
||||
- syslog(LOG_ERR, "%s: can't find local transport\n", argv[0]);
|
||||
- exit(1);
|
||||
- }
|
||||
-
|
||||
rpc_control(RPC_SVC_CONNMAXREC_SET, &maxrec);
|
||||
|
||||
- init_transport(nconf);
|
||||
-
|
||||
- while ((nconf = getnetconfig(nc_handle))) {
|
||||
- if (nconf->nc_flag & NC_VISIBLE)
|
||||
- init_transport(nconf);
|
||||
- }
|
||||
- endnetconfig(nc_handle);
|
||||
+#ifdef SYSTEMD
|
||||
+ if (systemd_activation)
|
||||
+ init_transports_systemd();
|
||||
+ else
|
||||
+#endif
|
||||
+ init_transports_daemon();
|
||||
|
||||
#ifdef PORTMAP
|
||||
if (!udptrans)
|
||||
@@ -571,17 +570,29 @@ rpcbind_register_transport(struct netconfig *nconf, SVCXPRT *xprt, struct netbuf
|
||||
* <0: error - ignore this netid
|
||||
*/
|
||||
static int
|
||||
-rpcbind_init_endpoint(struct netconfig *nconf, const char *hostname)
|
||||
+rpcbind_init_endpoint(struct netconfig *nconf, const char *hostname, int fd)
|
||||
{
|
||||
struct t_bind taddr;
|
||||
SVCXPRT *my_xprt = NULL;
|
||||
- int r, fd = -1;
|
||||
+ int r;
|
||||
|
||||
memset(&taddr, 0, sizeof(taddr));
|
||||
|
||||
- r = create_transport_socket(nconf, hostname, &taddr.addr, &fd);
|
||||
- if (r <= 0)
|
||||
- return r;
|
||||
+ if (fd < 0) {
|
||||
+ r = create_transport_socket(nconf, hostname, &taddr.addr, &fd);
|
||||
+ if (r <= 0)
|
||||
+ return r;
|
||||
+ } else {
|
||||
+ struct sockaddr_storage addr;
|
||||
+ socklen_t alen = sizeof(addr);
|
||||
+
|
||||
+ if (getsockname(fd, (struct sockaddr *) &addr, &alen) < 0) {
|
||||
+ syslog(LOG_ERR, "cannot get address for socket fd %d", fd);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ sockaddr2netbuf((struct sockaddr *) &addr, alen, &taddr.addr);
|
||||
+ }
|
||||
|
||||
my_xprt = (SVCXPRT *)svc_tli_create(fd, nconf, &taddr, RPC_MAXDATASIZE, RPC_MAXDATASIZE);
|
||||
if (my_xprt == (SVCXPRT *)NULL) {
|
||||
@@ -645,12 +656,12 @@ init_transport(struct netconfig *nconf)
|
||||
/* Ensure that we always bind to loopback */
|
||||
switch (si.si_af) {
|
||||
case AF_INET:
|
||||
- if (rpcbind_init_endpoint(nconf, "127.0.0.1") > 0)
|
||||
+ if (rpcbind_init_endpoint(nconf, "127.0.0.1", -1) > 0)
|
||||
numbound++;
|
||||
break;
|
||||
|
||||
case AF_INET6:
|
||||
- if (rpcbind_init_endpoint(nconf, "::1") > 0)
|
||||
+ if (rpcbind_init_endpoint(nconf, "::1", -1) > 0)
|
||||
numbound++;
|
||||
break;
|
||||
}
|
||||
@@ -662,7 +673,7 @@ init_transport(struct netconfig *nconf)
|
||||
if (strcmp("*", hostname) == 0)
|
||||
hostname = NULL;
|
||||
|
||||
- r = rpcbind_init_endpoint(nconf, hostname);
|
||||
+ r = rpcbind_init_endpoint(nconf, hostname, -1);
|
||||
if (r < 0)
|
||||
return 1;
|
||||
if (r > 0)
|
||||
@@ -672,7 +683,7 @@ init_transport(struct netconfig *nconf)
|
||||
if (numbound == 0)
|
||||
return 1;
|
||||
} else {
|
||||
- if (rpcbind_init_endpoint(nconf, NULL) <= 0)
|
||||
+ if (rpcbind_init_endpoint(nconf, NULL, -1) <= 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -699,6 +710,103 @@ init_transport(struct netconfig *nconf)
|
||||
}
|
||||
|
||||
static void
|
||||
+init_transports_daemon(void)
|
||||
+{
|
||||
+ void *nc_handle;
|
||||
+ struct netconfig *nconf;
|
||||
+
|
||||
+ nc_handle = setnetconfig(); /* open netconfig file */
|
||||
+ if (nc_handle == NULL) {
|
||||
+ syslog(LOG_ERR, "could not read /etc/netconfig");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ nconf = getnetconfigent("local");
|
||||
+ if (nconf == NULL)
|
||||
+ nconf = getnetconfigent("unix");
|
||||
+ if (nconf == NULL) {
|
||||
+ syslog(LOG_ERR, "rpcbind: can't find local transport\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ init_transport(nconf);
|
||||
+
|
||||
+ while ((nconf = getnetconfig(nc_handle))) {
|
||||
+ if (nconf->nc_flag & NC_VISIBLE)
|
||||
+ init_transport(nconf);
|
||||
+ }
|
||||
+ endnetconfig(nc_handle);
|
||||
+}
|
||||
+
|
||||
+#ifdef SYSTEMD
|
||||
+static struct netconfig *
|
||||
+sockinfo2nconf(void **handlep, const struct __rpc_sockinfo *match)
|
||||
+{
|
||||
+ struct netconfig *nconf;
|
||||
+
|
||||
+ if (*handlep)
|
||||
+ endnetconfig(*handlep);
|
||||
+ *handlep = setnetconfig();
|
||||
+
|
||||
+ while ((nconf = getnetconfig(*handlep))) {
|
||||
+ struct __rpc_sockinfo si;
|
||||
+
|
||||
+ if (!__rpc_nconf2sockinfo(nconf, &si))
|
||||
+ continue;
|
||||
+
|
||||
+ if (si.si_af == match->si_af
|
||||
+ && si.si_socktype == match->si_socktype
|
||||
+ && si.si_proto == match->si_proto)
|
||||
+ return nconf;
|
||||
+ }
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+init_transports_systemd()
|
||||
+{
|
||||
+ void *nc_handle = NULL;
|
||||
+ int nfds, n;
|
||||
+
|
||||
+ if ((nfds = sd_listen_fds(0)) < 0) {
|
||||
+ syslog(LOG_ERR, "failed to acquire systemd sockets: %s", strerror(-nfds));
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (nfds >= 16) {
|
||||
+ syslog(LOG_ERR, "too many sockets passed by systemd (%u)", nfds);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ for (n = 0; n < nfds; ++n) {
|
||||
+ struct netconfig *nconf;
|
||||
+ struct __rpc_sockinfo si;
|
||||
+ int fd;
|
||||
+
|
||||
+ fd = SD_LISTEN_FDS_START + n;
|
||||
+
|
||||
+ if (!__rpc_fd2sockinfo(fd, &si)) {
|
||||
+ syslog(LOG_ERR, "cannot get socket information for fd %d", fd);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ /* Now find the netconfig entry matching this transport */
|
||||
+ if ((nconf = sockinfo2nconf(&nc_handle, &si)) == NULL) {
|
||||
+ syslog(LOG_ERR, "not netconfig for socket fd %d", fd);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ if (rpcbind_init_endpoint(nconf, NULL, fd) <= 0) {
|
||||
+ syslog(LOG_ERR, "unable to create transport for socket fd %d", fd);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (nc_handle)
|
||||
+ endnetconfig(nc_handle);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static void
|
||||
rbllist_add(rpcprog_t prog, rpcvers_t vers, struct netconfig *nconf,
|
||||
struct netbuf *addr)
|
||||
{
|
||||
diff --git a/systemd/.gitignore b/systemd/.gitignore
|
||||
new file mode 100644
|
||||
index 0000000..b7b4561
|
||||
--- /dev/null
|
||||
+++ b/systemd/.gitignore
|
||||
@@ -0,0 +1 @@
|
||||
+rpcbind.service
|
||||
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
|
||||
new file mode 100644
|
||||
index 0000000..58ae5de
|
||||
--- /dev/null
|
||||
+++ b/systemd/rpcbind.service.in
|
||||
@@ -0,0 +1,9 @@
|
||||
+[Unit]
|
||||
+Description=RPC Bind
|
||||
+
|
||||
+[Service]
|
||||
+ExecStart=@bindir@/rpcbind -w -f
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
+Also=rpcbind.socket
|
||||
diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket
|
||||
new file mode 100644
|
||||
index 0000000..ad5fd62
|
||||
--- /dev/null
|
||||
+++ b/systemd/rpcbind.socket
|
||||
@@ -0,0 +1,12 @@
|
||||
+[Unit]
|
||||
+Description=RPCbind Server Activation Socket
|
||||
+Wants=rpcbind.target
|
||||
+Before=rpcbind.target
|
||||
+
|
||||
+[Socket]
|
||||
+ListenStream=/var/run/rpcbind.sock
|
||||
+ListenStream=111
|
||||
+ListenDatagram=111
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,98 +0,0 @@
|
||||
From 487918f173a899ce39b426ceeaa830d3c45fbd2d Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Mahoney <jeffm@suse.com>
|
||||
Date: Tue, 20 Aug 2013 15:20:13 +0200
|
||||
Subject: [PATCH 13/24] socket-activation: Fix rpcbind.service to use separate
|
||||
sockets
|
||||
|
||||
systemd will, by default, pass a socket that provides both IPv4 and
|
||||
IPv6 services. RPC netconfig requires that sockets be either IPv4
|
||||
or IPv6.
|
||||
|
||||
This patch fixes the rpcbind.socket unit file and adds a warning
|
||||
to rpcbind should the user encounter an issue.
|
||||
|
||||
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
|
||||
---
|
||||
src/rpcbind.c | 29 +++++++++++++++++++++++++++++
|
||||
systemd/rpcbind.socket | 11 ++++++++---
|
||||
2 files changed, 37 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index baf1ac0..aec0510 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <sys/file.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
+#include <netinet/in.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/rpc_com.h>
|
||||
#ifdef PORTMAP
|
||||
@@ -561,6 +562,31 @@ rpcbind_register_transport(struct netconfig *nconf, SVCXPRT *xprt, struct netbuf
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Normally systemd will open sockets in dual ipv4/ipv6 mode.
|
||||
+ * That won't work with netconfig and we'll only match
|
||||
+ * the ipv6 socket. Convert it to IPV6_V6ONLY and issue
|
||||
+ * a warning for the user to fix their systemd config.
|
||||
+ */
|
||||
+static int
|
||||
+handle_ipv6_socket(int fd)
|
||||
+{
|
||||
+ int opt;
|
||||
+ socklen_t len = sizeof(opt);
|
||||
+
|
||||
+ if (getsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, &len)) {
|
||||
+ syslog(LOG_ERR, "failed to get ipv6 socket opts: %m");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (opt) /* socket is already in V6ONLY mode */
|
||||
+ return 0;
|
||||
+
|
||||
+ syslog(LOG_ERR, "systemd has passed an IPv4/IPv6 dual-mode socket.");
|
||||
+ syslog(LOG_ERR, "Please fix your systemd config by specifying IPv4 and IPv6 sockets separately and using BindIPv6Only=ipv6-only.");
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* This will create a server socket for the given netid, bound to the
|
||||
* address specified by @hostname
|
||||
*
|
||||
@@ -591,6 +617,9 @@ rpcbind_init_endpoint(struct netconfig *nconf, const char *hostname, int fd)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+ if (addr.ss_family == AF_INET6 && handle_ipv6_socket(fd))
|
||||
+ return -1;
|
||||
+
|
||||
sockaddr2netbuf((struct sockaddr *) &addr, alen, &taddr.addr);
|
||||
}
|
||||
|
||||
diff --git a/systemd/rpcbind.socket b/systemd/rpcbind.socket
|
||||
index ad5fd62..0b0c1d3 100644
|
||||
--- a/systemd/rpcbind.socket
|
||||
+++ b/systemd/rpcbind.socket
|
||||
@@ -4,9 +4,14 @@ Wants=rpcbind.target
|
||||
Before=rpcbind.target
|
||||
|
||||
[Socket]
|
||||
-ListenStream=/var/run/rpcbind.sock
|
||||
-ListenStream=111
|
||||
-ListenDatagram=111
|
||||
+ListenStream=/run/rpcbind.sock
|
||||
+
|
||||
+# RPC netconfig can't handle ipv6/ipv4 dual sockets
|
||||
+BindIPv6Only=ipv6-only
|
||||
+ListenStream=0.0.0.0:111
|
||||
+ListenDatagram=0.0.0.0:111
|
||||
+ListenStream=[::]:111
|
||||
+ListenDatagram=[::]:111
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,43 +0,0 @@
|
||||
From 117cc8049b1dec667507f7824ccae3cd1d8b31fb Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Kirch <okir@suse.de>
|
||||
Date: Tue, 20 Aug 2013 16:01:59 +0200
|
||||
Subject: [PATCH 15/24] When using systemd activation, make rpcbind notify
|
||||
system when ready to service requests
|
||||
|
||||
Signed-off-by: Olaf Kirch <okir@suse.de>
|
||||
---
|
||||
src/rpcbind.c | 5 ++++-
|
||||
systemd/rpcbind.service.in | 1 +
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index 50c042c..6d1f1a3 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -260,7 +260,10 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
network_init();
|
||||
-
|
||||
+#ifdef SYSTEMD
|
||||
+ if (systemd_activation)
|
||||
+ sd_notify(0, "READY=1");
|
||||
+#endif
|
||||
my_svc_run();
|
||||
rpcbind_log_error("svc_run returned unexpectedly");
|
||||
rpcbind_abort();
|
||||
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
|
||||
index 58ae5de..527d07b 100644
|
||||
--- a/systemd/rpcbind.service.in
|
||||
+++ b/systemd/rpcbind.service.in
|
||||
@@ -2,6 +2,7 @@
|
||||
Description=RPC Bind
|
||||
|
||||
[Service]
|
||||
+Type=notify
|
||||
ExecStart=@bindir@/rpcbind -w -f
|
||||
|
||||
[Install]
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,40 +0,0 @@
|
||||
From 114b974116d44201a4dba6b7e9311f0ffb318ee3 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Kirch <okir@suse.de>
|
||||
Date: Fri, 10 Jan 2014 11:29:40 +0100
|
||||
Subject: [PATCH 16/24] Notify systemd unconditionally
|
||||
|
||||
rpcbind may be started from systemd with or without socket activation.
|
||||
However, in both cases systemd would expect to be notified of successful
|
||||
startup.
|
||||
|
||||
If we're started from the command line, calling sd_notify doesn't do
|
||||
any harm either; it will just silently fail.
|
||||
|
||||
Signed-off-by: Olaf Kirch <okir@suse.de>
|
||||
---
|
||||
src/rpcbind.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||
index 6d1f1a3..b070c32 100644
|
||||
--- a/src/rpcbind.c
|
||||
+++ b/src/rpcbind.c
|
||||
@@ -260,9 +260,13 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
network_init();
|
||||
+
|
||||
#ifdef SYSTEMD
|
||||
- if (systemd_activation)
|
||||
- sd_notify(0, "READY=1");
|
||||
+ /* Try to notify system of successful startup, regardless of whether we
|
||||
+ * used systemd socket activation or not. When started from the command
|
||||
+ * line, this should not hurt either.
|
||||
+ */
|
||||
+ rpcbind_log_error("sd_notify returns %d\n", sd_notify(0, "READY=1"));
|
||||
#endif
|
||||
my_svc_run();
|
||||
rpcbind_log_error("svc_run returned unexpectedly");
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,27 +0,0 @@
|
||||
From 343c55b1137efae9e7d469ec5b5972ca70f1cc80 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Kirch <okir@suse.de>
|
||||
Date: Tue, 14 Jan 2014 16:19:04 +0100
|
||||
Subject: [PATCH 17/24] Pull the sysconfig file into rpcbind.service and use
|
||||
|
||||
Signed-off-by: Olaf Kirch <okir@suse.de>
|
||||
---
|
||||
systemd/rpcbind.service.in | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
|
||||
index 527d07b..1f5b596 100644
|
||||
--- a/systemd/rpcbind.service.in
|
||||
+++ b/systemd/rpcbind.service.in
|
||||
@@ -3,7 +3,8 @@ Description=RPC Bind
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
-ExecStart=@bindir@/rpcbind -w -f
|
||||
+EnvironmentFile=-/etc/sysconfig/rpcbind
|
||||
+ExecStart=@bindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
--
|
||||
1.7.12.4
|
||||
|
@ -1,7 +1,4 @@
|
||||
From 87b31d8406e6049fb4facfc483f4d8c9339d6f46 Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Kirch <okir@suse.de>
|
||||
Date: Tue, 14 Jan 2014 16:40:55 +0100
|
||||
Subject: [PATCH 18/24] configure: check for <nss.h>
|
||||
configure: check for <nss.h>
|
||||
|
||||
There's code in rpcbind that tries to configure nss lookups so that it
|
||||
avoids NIS when resolving user names or service names. Unfortunately, this
|
||||
@ -13,18 +10,12 @@ Signed-off-by: Olaf Kirch <okir@suse.de>
|
||||
configure.ac | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 6d91dcd..8cdd08f 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -40,6 +40,7 @@ AC_ARG_WITH([systemdsystemunitdir],
|
||||
fi
|
||||
AM_CONDITIONAL(SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
@@ -55,4 +55,6 @@
|
||||
|
||||
AC_SEARCH_LIBS([pthread_create], [pthread])
|
||||
|
||||
+AC_CHECK_HEADERS(nss.h)
|
||||
|
||||
AS_IF([test x$enable_libwrap = xyes], [
|
||||
AC_CHECK_LIB([wrap], [hosts_access], ,
|
||||
--
|
||||
1.7.12.4
|
||||
|
||||
+
|
||||
AC_OUTPUT([Makefile])
|
||||
|
@ -1,16 +0,0 @@
|
||||
--- src/warmstart.c
|
||||
+++ src/warmstart.c 2014/02/26 14:18:39
|
||||
@@ -106,9 +106,10 @@
|
||||
fprintf(stderr, "rpcbind: using '%s' startup file\n", filename);
|
||||
|
||||
if ((fp = fopen(filename, "r")) == NULL) {
|
||||
- rpcbind_log_error(
|
||||
- "Cannot open '%s' file for reading, errno %d (%s)",
|
||||
- filename, errno, strerror(errno));
|
||||
+ if (errno != ENOENT)
|
||||
+ rpcbind_log_error(
|
||||
+ "Cannot open '%s' file for reading, errno %d (%s)",
|
||||
+ filename, errno, strerror(errno));
|
||||
goto error;
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
rpcbind needs to start before everything is setup, so DefaultDependencies
|
||||
just get in the way
|
||||
|
||||
|
||||
References: bnc#860246
|
||||
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||
|
||||
---
|
||||
systemd/rpcbind.service.in | 1 +
|
||||
systemd/rpcbind.socket | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
--- rpcbind-0.2.1_rc4.orig/systemd/rpcbind.service.in
|
||||
+++ rpcbind-0.2.1_rc4/systemd/rpcbind.service.in
|
||||
@@ -1,5 +1,6 @@
|
||||
[Unit]
|
||||
Description=RPC Bind
|
||||
+DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
--- rpcbind-0.2.1_rc4.orig/systemd/rpcbind.socket
|
||||
+++ rpcbind-0.2.1_rc4/systemd/rpcbind.socket
|
||||
@@ -1,5 +1,6 @@
|
||||
[Unit]
|
||||
Description=RPCbind Server Activation Socket
|
||||
+DefaultDependencies=no
|
||||
Wants=rpcbind.target
|
||||
Before=rpcbind.target
|
||||
|
@ -1,37 +0,0 @@
|
||||
Ignore exit state of two and also be sure that rpcbind.service will
|
||||
trigger rpcbind.socket before its own start which the fulfill rpcbind.target
|
||||
|
||||
References: bnc#870158, bnc#860246
|
||||
Signed-off-by: Werner Fink <werner@suse.de>
|
||||
|
||||
---
|
||||
systemd/rpcbind.service.in | 3 +++
|
||||
systemd/rpcbind.socket | 1 +
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
--- rpcbind-0.2.1_rc4/systemd/rpcbind.service.in
|
||||
+++ rpcbind-0.2.1_rc4/systemd/rpcbind.service.in 2014-03-31 10:29:29.262735423 +0000
|
||||
@@ -1,11 +1,14 @@
|
||||
[Unit]
|
||||
Description=RPC Bind
|
||||
+Documentation=man:rpcbind(8)
|
||||
DefaultDependencies=no
|
||||
+Requires=rpcbind.socket
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
EnvironmentFile=-/etc/sysconfig/rpcbind
|
||||
ExecStart=@bindir@/rpcbind $RPCBIND_OPTIONS -w -f
|
||||
+SuccessExitStatus=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
--- rpcbind-0.2.1_rc4/systemd/rpcbind.socket
|
||||
+++ rpcbind-0.2.1_rc4/systemd/rpcbind.socket 2014-03-31 10:30:12.799480612 +0000
|
||||
@@ -1,5 +1,6 @@
|
||||
[Unit]
|
||||
Description=RPCbind Server Activation Socket
|
||||
+Documentation=man:rpcbind(8)
|
||||
DefaultDependencies=no
|
||||
Wants=rpcbind.target
|
||||
Before=rpcbind.target
|
@ -1,20 +0,0 @@
|
||||
rpcbind service wants /var/run mounted before started
|
||||
|
||||
References: bnc#881518
|
||||
Signed-off-by: Werner Fink <werner@suse.de>
|
||||
|
||||
---
|
||||
systemd/rpcbind.service.in | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- rpcbind-0.2.1_rc4/systemd/rpcbind.service.in
|
||||
+++ rpcbind-0.2.1_rc4/systemd/rpcbind.service.in 2014-06-05 12:45:47.267340658 +0000
|
||||
@@ -3,6 +3,8 @@ Description=RPC Bind
|
||||
Documentation=man:rpcbind(8)
|
||||
DefaultDependencies=no
|
||||
Requires=rpcbind.socket
|
||||
+Wants=var-run.mount
|
||||
+After=var-run.mount
|
||||
|
||||
[Service]
|
||||
Type=notify
|
@ -1,22 +0,0 @@
|
||||
A stupid error/debug thingie crept into the patch set which shouldn't be there.
|
||||
Nuking it. See bnc#881663
|
||||
|
||||
Signed-off-by: okir@suse.de
|
||||
|
||||
---
|
||||
src/rpcbind.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: rpcbind-0.2.1_rc4/src/rpcbind.c
|
||||
===================================================================
|
||||
--- rpcbind-0.2.1_rc4.orig/src/rpcbind.c
|
||||
+++ rpcbind-0.2.1_rc4/src/rpcbind.c
|
||||
@@ -266,7 +266,7 @@ main(int argc, char *argv[])
|
||||
* used systemd socket activation or not. When started from the command
|
||||
* line, this should not hurt either.
|
||||
*/
|
||||
- rpcbind_log_error("sd_notify returns %d\n", sd_notify(0, "READY=1"));
|
||||
+ sd_notify(0, "READY=1");
|
||||
#endif
|
||||
my_svc_run();
|
||||
rpcbind_log_error("svc_run returned unexpectedly");
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:66c75f8a7400c4c8608d861a32fbce26facd424e98663c4669ad786977691e9d
|
||||
size 457513
|
3
rpcbind-0.2.2.tar.bz2
Normal file
3
rpcbind-0.2.2.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:13dbc8c796dbe0ce8df873007bea0490c8460b56202d918c9eb6fa0358a08f29
|
||||
size 112793
|
@ -1,3 +1,47 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 11 13:07:09 CET 2014 - kukuk@suse.de
|
||||
|
||||
- Split off 0003-systemd-no-dualmode.patch from
|
||||
0001-systemd-enhancements.patch for easier upstream submission.
|
||||
- Split off 0004-systemd-sd_notify.patch from
|
||||
0001-systemd-enhancements.patch for easier upstream submission.
|
||||
- Rename 0001-systemd-enhancements.patch to 0001-systemd-unit-files.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 9 15:52:01 CET 2014 - kukuk@suse.de
|
||||
|
||||
- Update to latest rpcbind 0.2.2 upstream release.
|
||||
- Following patches are upstream:
|
||||
- 0001-Fix-building-one-systems-w-out-nss.h.patch
|
||||
- 0002-Rename-configure.in-to-configure.ac.patch
|
||||
- 0003-rpcbind-rpcuser-not-being-set-in-Makefile.am.patch
|
||||
- 0004-Silence-a-warning-about-setgroups-being-implicitly-d.patch
|
||||
- Adjust following patches:
|
||||
- 0005-Remove-obsolete-function-in6_fillscopeid.patch
|
||||
- 0006-In-init_transport-move-creation-of-COTS-sockets-clos.patch
|
||||
- 0018-configure-check-for-nss.h.patch
|
||||
- Obsolete patches:
|
||||
- 0015-When-using-systemd-activation-make-rpcbind-notify-sy.patch
|
||||
- 0016-Notify-systemd-unconditionally.patch
|
||||
- 0012-Support-systemd-activation.patch
|
||||
- 0013-socket-activation-Fix-rpcbind.service-to-use-separat.patch
|
||||
- 0017-Pull-the-sysconfig-file-into-rpcbind.service-and-use.patch
|
||||
- 0025-rpcinfo-warmstat_no-warning-about-missing-file.patch
|
||||
- 0026-systemd-no-default-dep
|
||||
- 0027-socket-before-service.patch
|
||||
- 0028-rpcbind-after-var-run.patch
|
||||
- 0029-rpcbind-sd-notify-stupid-errmsg.patch
|
||||
- New patches:
|
||||
- 0001-systemd-enhancements.patch
|
||||
- 0002-rpcinfo_warmstart-no_warning_about_missing_file.patch
|
||||
- Disabled patches:
|
||||
- 0008-First-part-of-init_transport-refactoring.patch
|
||||
- 0009-init_transport-move-the-registration-code-into-a-sep.patch
|
||||
- 0010-Fix-the-behavior-when-specifying-the-h-option.patch
|
||||
- 0011-Clean-up-the-way-we-handle-the-h-option-in-init_tran.patch
|
||||
- 0014-When-using-systemd-redirect-syslog-calls-to-the-syst.patch
|
||||
- 0024-rpcinfo-remove-obsolete-function-get_inet_address.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 12 15:05:00 CET 2014 - kukuk@suse.de
|
||||
|
||||
|
74
rpcbind.spec
74
rpcbind.spec
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: rpcbind
|
||||
Version: 0.2.1_rc4
|
||||
Version: 0.2.2
|
||||
Release: 0
|
||||
Summary: Transport independent RPC portmapper
|
||||
License: BSD-4-Clause
|
||||
@ -35,37 +35,25 @@ BuildRequires: tcpd-devel
|
||||
BuildRequires: pkgconfig(libsystemd-daemon)
|
||||
PreReq: %fillup_prereq
|
||||
Requires(pre): /usr/sbin/useradd
|
||||
|
||||
# The next three are from upstream, applied directly on top of rc4.
|
||||
Patch0: 0001-Fix-building-one-systems-w-out-nss.h.patch
|
||||
Patch1: 0002-Rename-configure.in-to-configure.ac.patch
|
||||
Patch2: 0003-rpcbind-rpcuser-not-being-set-in-Makefile.am.patch
|
||||
Patch3: 0004-Silence-a-warning-about-setgroups-being-implicitly-d.patch
|
||||
Patch4: 0005-Remove-obsolete-function-in6_fillscopeid.patch
|
||||
Patch5: 0006-In-init_transport-move-creation-of-COTS-sockets-clos.patch
|
||||
Patch6: 0007-The-use-of-AI_NUMERICHOST-in-init_transport-is-broke.patch
|
||||
Patch7: 0008-First-part-of-init_transport-refactoring.patch
|
||||
Patch8: 0009-init_transport-move-the-registration-code-into-a-sep.patch
|
||||
Patch9: 0010-Fix-the-behavior-when-specifying-the-h-option.patch
|
||||
Patch10: 0011-Clean-up-the-way-we-handle-the-h-option-in-init_tran.patch
|
||||
Patch11: 0012-Support-systemd-activation.patch
|
||||
Patch12: 0013-socket-activation-Fix-rpcbind.service-to-use-separat.patch
|
||||
Patch13: 0014-When-using-systemd-redirect-syslog-calls-to-the-syst.patch
|
||||
Patch14: 0015-When-using-systemd-activation-make-rpcbind-notify-sy.patch
|
||||
Patch15: 0016-Notify-systemd-unconditionally.patch
|
||||
Patch16: 0017-Pull-the-sysconfig-file-into-rpcbind.service-and-use.patch
|
||||
Patch17: 0018-configure-check-for-nss.h.patch
|
||||
Patch18: 0019-rpcinfo-ip_ping-clean-up-client-ping-create-destroy.patch
|
||||
Patch19: 0020-rpcinfo-introduce-new-helper-function-ip_getclient.patch
|
||||
Patch20: 0021-rpcinfo-make-t-u-options-support-IPv6-addresses-too.patch
|
||||
Patch21: 0022-rpcinfo-remove-obsolete-function-clnt_com_create.patch
|
||||
Patch22: 0023-Make-rpcinfo-p-support-IPv6-addresses-too.patch
|
||||
Patch23: 0024-rpcinfo-remove-obsolete-function-get_inet_address.patch
|
||||
Patch24: 0025-rpcinfo-warmstat_no-warning-about-missing-file.patch
|
||||
Patch25: 0026-systemd-no-default-dep
|
||||
Patch26: 0027-socket-before-service.patch
|
||||
Patch27: 0028-rpcbind-after-var-run.patch
|
||||
Patch28: 0029-rpcbind-sd-notify-stupid-errmsg.patch
|
||||
Patch1: 0001-systemd-unit-files.patch
|
||||
Patch2: 0002-rpcinfo_warmstart-no_warning_about_missing_file.patch
|
||||
Patch3: 0003-systemd-no-dualmode.patch
|
||||
Patch4: 0004-systemd-sd_notify.patch
|
||||
Patch5: 0005-Remove-obsolete-function-in6_fillscopeid.patch
|
||||
Patch6: 0006-In-init_transport-move-creation-of-COTS-sockets-clos.patch
|
||||
Patch7: 0007-The-use-of-AI_NUMERICHOST-in-init_transport-is-broke.patch
|
||||
Patch8: 0008-First-part-of-init_transport-refactoring.patch
|
||||
Patch9: 0009-init_transport-move-the-registration-code-into-a-sep.patch
|
||||
Patch10: 0010-Fix-the-behavior-when-specifying-the-h-option.patch
|
||||
Patch11: 0011-Clean-up-the-way-we-handle-the-h-option-in-init_tran.patch
|
||||
Patch14: 0014-When-using-systemd-redirect-syslog-calls-to-the-syst.patch
|
||||
Patch18: 0018-configure-check-for-nss.h.patch
|
||||
Patch19: 0019-rpcinfo-ip_ping-clean-up-client-ping-create-destroy.patch
|
||||
Patch20: 0020-rpcinfo-introduce-new-helper-function-ip_getclient.patch
|
||||
Patch21: 0021-rpcinfo-make-t-u-options-support-IPv6-addresses-too.patch
|
||||
Patch22: 0022-rpcinfo-remove-obsolete-function-clnt_com_create.patch
|
||||
Patch23: 0023-Make-rpcinfo-p-support-IPv6-addresses-too.patch
|
||||
Patch24: 0024-rpcinfo-remove-obsolete-function-get_inet_address.patch
|
||||
|
||||
%define statefile /var/lib/portmap.state
|
||||
%{?systemd_requires}
|
||||
@ -81,7 +69,6 @@ regards to portmap.
|
||||
%prep
|
||||
%setup -q
|
||||
cp %{SOURCE4} .
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
@ -89,27 +76,18 @@ cp %{SOURCE4} .
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
#%patch8 -p1
|
||||
#%patch9 -p1
|
||||
#%patch10 -p1
|
||||
#%patch11 -p1
|
||||
#%patch14 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch24 -p0
|
||||
%patch25 -p1
|
||||
%patch26 -p1
|
||||
%patch27 -p1
|
||||
%patch28 -p1
|
||||
#%patch24 -p0
|
||||
|
||||
%build
|
||||
autoreconf -fiv
|
||||
|
Loading…
Reference in New Issue
Block a user