From b0aecb4ba5c3d7df6589c01f5a7c0427f5a75305 Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Tue, 29 Oct 2019 10:07:10 -0400 Subject: plumber: add -f (foreground) option (#288) In MacOS, services run by launchd must run in the foreground, since launchd manages forking and other resources. --- src/cmd/plumb/plumber.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cmd/plumb/plumber.c') diff --git a/src/cmd/plumb/plumber.c b/src/cmd/plumb/plumber.c index 2debf49b..c99282f0 100644 --- a/src/cmd/plumb/plumber.c +++ b/src/cmd/plumb/plumber.c @@ -7,6 +7,7 @@ #include "plumber.h" int debug; +int foreground=0; char *plumbfile; char *user; char *home; @@ -37,6 +38,9 @@ threadmain(int argc, char *argv[]) case 'd': debug = 1; break; + case 'f': + foreground = 1; + break; case 'p': plumbfile = ARGF(); break; @@ -69,7 +73,7 @@ threadmain(int argc, char *argv[]) */ printerrors = 0; makeports(rules); - startfsys(); + startfsys(foreground); threadexits(nil); } -- cgit v1.2.3