diff -up ypbind-mt-1.33/man/ypbind.8.systemd ypbind-mt-1.33/man/ypbind.8 --- ypbind-mt-1.33/man/ypbind.8.systemd 2011-06-13 12:44:54.420376848 +0200 +++ ypbind-mt-1.33/man/ypbind.8 2011-06-13 12:57:19.777377125 +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\-n, \-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.33/src/ypbind-mt.c.systemd ypbind-mt-1.33/src/ypbind-mt.c --- ypbind-mt-1.33/src/ypbind-mt.c.systemd 2011-04-29 16:33:11.000000000 +0200 +++ ypbind-mt-1.33/src/ypbind-mt.c 2011-06-13 12:55:10.185377077 +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; @@ -506,7 +507,7 @@ usage (int ret) output = stdout; fputs (_("Usage:\n"), output); - fputs (_("\typbind [-broadcast | -ypset | -ypsetme] [-f configfile]\n\t [-no-ping] [-broken-server] [-local-only] [-i ping-interval] [-debug] [-verbose]\n"), output); + fputs (_("\typbind [-broadcast | -ypset | -ypsetme] [-f configfile]\n\t [-no-ping] [-broken-server] [-local-only] [-i ping-interval] [-debug]\n\t [-verbose] [-n | -foreground]\n"), output); #ifdef USE_DBUS_NM fputs (_("\t [-no-dbus]\n"), output); #endif @@ -691,6 +692,9 @@ main (int argc, char **argv) else if (strcmp ("-d", argv[i]) == 0 || strcmp ("-debug", argv[i]) == 0) debug_flag = 1; + else if (strcmp ("-n", 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; @@ -833,7 +837,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;