ypbind/ypbind-mt-1.32-systemd.patch

68 lines
2.3 KiB
Diff

diff -up ypbind-mt-1.32/man/ypbind.8.systemd ypbind-mt-1.32/man/ypbind.8
--- ypbind-mt-1.32/man/ypbind.8.systemd 2011-04-14 14:28:24.558085630 +0200
+++ ypbind-mt-1.32/man/ypbind.8 2011-04-14 14:28:24.596085630 +0200
@@ -171,7 +171,7 @@ ypbind \- NIS binding process
.SH "Synopsis"
.fam C
.HP \w'\fBypbind\fR\ 'u
-\fBypbind\fR [\-c] [\-d | \-debug] [\-verbose] [\-broadcast] [\-broken\-server] [\-ypset] [\-ypsetme] [\-no\-ping] [\-f\ \fIconfigfile\fR] [\-local\-only] [\-ping\-interval\ \fIping\-interval\fR] [\-no\-dbus]
+\fBypbind\fR [\-c] [\-d | \-debug] [\-n | \-foreground] [\-verbose] [\-broadcast] [\-broken\-server] [\-ypset] [\-ypsetme] [\-no\-ping] [\-f\ \fIconfigfile\fR] [\-local\-only] [\-ping\-interval\ \fIping\-interval\fR] [\-no\-dbus]
.fam
.fam C
.HP \w'\fBypbind\fR\ 'u
@@ -292,6 +292,12 @@ in debug mode\&.
will not put itself into background, and error messages and debug output are written to standard error\&.
.RE
.PP
+\fB\-foreground\fR
+.RS 4
+\fBypbind\fR
+will not put itself into background\&.
+.RE
+.PP
\fB\-verbose\fR
.RS 4
Causes
@@ -365,6 +371,11 @@ contains the process id of the currently
\fBypbind\fR
master process\&.
.RE
+.PP
+/lib/systemd/system/ypbind\&.service
+.RS 4
+systemd native service file\&.
+.RE
.SH "SEE ALSO"
.PP
diff -up ypbind-mt-1.32/src/ypbind-mt.c.systemd ypbind-mt-1.32/src/ypbind-mt.c
--- ypbind-mt-1.32/src/ypbind-mt.c.systemd 2009-11-19 11:29:00.000000000 +0100
+++ ypbind-mt-1.32/src/ypbind-mt.c 2011-04-14 14:28:24.598085629 +0200
@@ -71,6 +71,7 @@ const char *configfile = "/etc/yp.conf";
int ypset = SET_NO;
int use_broadcast = 0;
int broken_server = 0;
+int foreground_flag = 0;
int ping_interval = 20;
int local_only = 0;
int port = -1;
@@ -688,6 +689,9 @@ main (int argc, char **argv)
else if (strcmp ("-d", argv[i]) == 0 ||
strcmp ("-debug", argv[i]) == 0)
debug_flag = 1;
+ else if (strcmp ("-f", argv[i]) == 0 ||
+ strcmp ("-foreground", argv[i]) == 0)
+ foreground_flag = 1;
else if (strcmp ("-v", argv[i]) == 0 ||
strcmp ("-verbose", argv[i]) == 0)
verbose_flag = 1;
@@ -830,7 +834,7 @@ main (int argc, char **argv)
log_msg (LOG_DEBUG, "[Welcome to ypbind-mt, version %s]\n", VERSION);
log_msg (LOG_DEBUG, "ping interval is %d seconds\n", ping_interval);
}
- else
+ else if (! foreground_flag)
{
int j;