forked from rpms/rpcbind
- Made initscript LSB compliant (bz 614193)
- Added no fork patch
This commit is contained in:
parent
3c85c93d52
commit
940cb45f46
72
rpcbind-0.2.0-nofork.patch
Normal file
72
rpcbind-0.2.0-nofork.patch
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
commit eb36cf198795b09c1ba796044fc99fa40c5a2b33
|
||||||
|
Author: Lennart Poettering <lennart@poettering.net>
|
||||||
|
Date: Tue Jul 13 15:52:18 2010 -0400
|
||||||
|
|
||||||
|
rpcbind: add no-fork mode
|
||||||
|
|
||||||
|
Signed-off-by: Lennart Poettering <lennart@poettering.net>
|
||||||
|
Signed-off-by: Steve Dickson <steved@redhat.com>
|
||||||
|
|
||||||
|
diff --git a/man/rpcbind.8 b/man/rpcbind.8
|
||||||
|
index 32806d4..c5b8fb7 100644
|
||||||
|
--- a/man/rpcbind.8
|
||||||
|
+++ b/man/rpcbind.8
|
||||||
|
@@ -82,6 +82,8 @@ during operation, and will abort on certain errors if
|
||||||
|
is also specified.
|
||||||
|
With this option, the name-to-address translation consistency
|
||||||
|
checks are shown in detail.
|
||||||
|
+.It Fl f
|
||||||
|
+Do not fork and become a background process.
|
||||||
|
.It Fl h
|
||||||
|
Specify specific IP addresses to bind to for UDP requests.
|
||||||
|
This option
|
||||||
|
diff --git a/src/rpcbind.c b/src/rpcbind.c
|
||||||
|
index c8f0d9f..63023e1 100644
|
||||||
|
--- a/src/rpcbind.c
|
||||||
|
+++ b/src/rpcbind.c
|
||||||
|
@@ -77,6 +77,7 @@
|
||||||
|
|
||||||
|
int debugging = 0; /* Tell me what's going on */
|
||||||
|
int doabort = 0; /* When debugging, do an abort on errors */
|
||||||
|
+int dofork = 1; /* fork? */
|
||||||
|
|
||||||
|
rpcblist_ptr list_rbl; /* A list of version 3/4 rpcbind services */
|
||||||
|
|
||||||
|
@@ -213,8 +214,8 @@ main(int argc, char *argv[])
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
- } else {
|
||||||
|
- if (daemon(0, 0))
|
||||||
|
+ } else if (dofork) {
|
||||||
|
+ if (daemon(0, 0))
|
||||||
|
err(1, "fork failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -740,7 +741,7 @@ parseargs(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
oldstyle_local = 1;
|
||||||
|
- while ((c = getopt(argc, argv, "adh:ilsw")) != -1) {
|
||||||
|
+ while ((c = getopt(argc, argv, "adh:ilswf")) != -1) {
|
||||||
|
switch (c) {
|
||||||
|
case 'a':
|
||||||
|
doabort = 1; /* when debugging, do an abort on */
|
||||||
|
@@ -767,13 +768,16 @@ parseargs(int argc, char *argv[])
|
||||||
|
case 's':
|
||||||
|
runasdaemon = 1;
|
||||||
|
break;
|
||||||
|
+ case 'f':
|
||||||
|
+ dofork = 0;
|
||||||
|
+ break;
|
||||||
|
#ifdef WARMSTART
|
||||||
|
case 'w':
|
||||||
|
warmstart = 1;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
default: /* error */
|
||||||
|
- fprintf(stderr, "usage: rpcbind [-adhilsw]\n");
|
||||||
|
+ fprintf(stderr, "usage: rpcbind [-adhilswf]\n");
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
}
|
40
rpcbind.init
40
rpcbind.init
@ -12,7 +12,6 @@
|
|||||||
# config: /etc/sysconfig/rpcbind
|
# config: /etc/sysconfig/rpcbind
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This is an interactive program, we need the current locale
|
# This is an interactive program, we need the current locale
|
||||||
[ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
|
[ -f /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh
|
||||||
# We can't Japanese on normal console at boot time, so force LANG=C.
|
# We can't Japanese on normal console at boot time, so force LANG=C.
|
||||||
@ -25,23 +24,29 @@ fi
|
|||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/init.d/functions
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
# Source networking configuration.
|
||||||
|
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
|
||||||
|
|
||||||
prog="rpcbind"
|
prog="rpcbind"
|
||||||
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
||||||
|
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
|
uid=`id | cut -d\( -f1 | cut -d= -f2`
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
# Get config.
|
|
||||||
if [ -f /etc/sysconfig/network ]; then
|
|
||||||
. /etc/sysconfig/network
|
|
||||||
else
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
# Check that networking is up.
|
# Check that networking is up.
|
||||||
[ "$NETWORKING" = "yes" ] || exit 6
|
[ "$NETWORKING" = "yes" ] || exit 6
|
||||||
|
|
||||||
[ -f /sbin/$prog ] || exit 5
|
[ -f /sbin/$prog ] || exit 5
|
||||||
|
|
||||||
|
# Make sure the rpcbind is not already running.
|
||||||
|
if status $prog > /dev/null ; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only root can start the service
|
||||||
|
[ $uid -ne 0 ] && exit 4
|
||||||
|
|
||||||
echo -n $"Starting $prog: "
|
echo -n $"Starting $prog: "
|
||||||
daemon $prog $RPCBIND_ARGS $1
|
daemon $prog $RPCBIND_ARGS $1
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
@ -74,19 +79,22 @@ case "$1" in
|
|||||||
status)
|
status)
|
||||||
status $prog
|
status $prog
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
restart | reload| force-reload)
|
||||||
stop
|
$0 stop
|
||||||
start
|
$0 start
|
||||||
|
RETVAL=$?
|
||||||
;;
|
;;
|
||||||
condrestart)
|
condrestart | try-restart)
|
||||||
if [ -f /var/lock/subsys/$prog ]; then
|
if [ -f /var/lock/subsys/$prog ]; then
|
||||||
stop
|
$0 stop
|
||||||
start -w
|
$0 start -w
|
||||||
|
RETVAL=$?
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart}"
|
||||||
exit 1
|
RETVAL=2
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $?
|
exit $RETVAL
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: rpcbind
|
Name: rpcbind
|
||||||
Version: 0.2.0
|
Version: 0.2.0
|
||||||
Release: 5%{?dist}
|
Release: 6%{?dist}
|
||||||
Summary: Universal Addresses to RPC Program Number Mapper
|
Summary: Universal Addresses to RPC Program Number Mapper
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
License: GPL
|
License: GPL
|
||||||
@ -14,6 +14,7 @@ Source1: rpcbind.init
|
|||||||
|
|
||||||
Patch100: rpcbind-0.2.0-usage-fix.patch
|
Patch100: rpcbind-0.2.0-usage-fix.patch
|
||||||
Patch101: rpcbind-0.2.0-soreuseaddr-listner.patch
|
Patch101: rpcbind-0.2.0-soreuseaddr-listner.patch
|
||||||
|
Patch102: rpcbind-0.2.0-nofork.patch
|
||||||
|
|
||||||
Requires: glibc-common setup
|
Requires: glibc-common setup
|
||||||
Conflicts: man-pages < 2.43-12
|
Conflicts: man-pages < 2.43-12
|
||||||
@ -37,6 +38,7 @@ RPC calls on a server on that machine.
|
|||||||
%setup -q
|
%setup -q
|
||||||
%patch100 -p1
|
%patch100 -p1
|
||||||
%patch101 -p1
|
%patch101 -p1
|
||||||
|
%patch102 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ifarch s390 s390x
|
%ifarch s390 s390x
|
||||||
@ -122,6 +124,10 @@ fi
|
|||||||
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
|
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jul 13 2010 Steve Dickson <steved@redhat.com> - 0.2.0-6
|
||||||
|
- Made initscript LSB compliant (bz 614193)
|
||||||
|
- Added no fork patch
|
||||||
|
|
||||||
* Tue Jul 6 2010 Steve Dickson <steved@redhat.com> - 0.2.0-5
|
* Tue Jul 6 2010 Steve Dickson <steved@redhat.com> - 0.2.0-5
|
||||||
- Set SO_REUSEADDR on listening sockets (bz 597356)
|
- Set SO_REUSEADDR on listening sockets (bz 597356)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user