From: Gurucharan Shetty Date: Fri, 17 Jan 2014 18:43:03 +0000 (-0800) Subject: daemon-windows: Add users for windows services. X-Git-Tag: sliver-openvswitch-2.1.90-1~8^2~6 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=42dd41ef305bac8be801346e9232788d30f895bd;p=sliver-openvswitch.git daemon-windows: Add users for windows services. Start with ovs-vswitchd and ovsdb-server. Signed-off-by: Gurucharan Shetty --- diff --git a/manpages.mk b/manpages.mk index 7f59019e9..5d5df0315 100644 --- a/manpages.mk +++ b/manpages.mk @@ -38,6 +38,8 @@ ovsdb/ovsdb-server.1: \ lib/daemon-syn.man \ lib/daemon.man \ lib/memory-unixctl.man \ + lib/service-syn.man \ + lib/service.man \ lib/ssl-bootstrap-syn.man \ lib/ssl-bootstrap.man \ lib/ssl-syn.man \ @@ -56,6 +58,8 @@ lib/coverage-unixctl.man: lib/daemon-syn.man: lib/daemon.man: lib/memory-unixctl.man: +lib/service-syn.man: +lib/service.man: lib/ssl-bootstrap-syn.man: lib/ssl-bootstrap.man: lib/ssl-syn.man: @@ -232,6 +236,7 @@ vswitchd/ovs-vswitchd.8: \ lib/coverage-unixctl.man \ lib/daemon.man \ lib/memory-unixctl.man \ + lib/service.man \ lib/ssl-bootstrap.man \ lib/ssl.man \ lib/vlog-unixctl.man \ @@ -245,6 +250,7 @@ lib/common.man: lib/coverage-unixctl.man: lib/daemon.man: lib/memory-unixctl.man: +lib/service.man: lib/ssl-bootstrap.man: lib/ssl.man: lib/vlog-unixctl.man: diff --git a/ovsdb/ovsdb-server.1.in b/ovsdb/ovsdb-server.1.in index 269d4f420..6924d4203 100644 --- a/ovsdb/ovsdb-server.1.in +++ b/ovsdb/ovsdb-server.1.in @@ -17,6 +17,7 @@ ovsdb\-server \- Open vSwitch database server [\fB\-\-remote=\fIremote\fR]\&... [\fB\-\-run=\fIcommand\fR] .so lib/daemon-syn.man +.so lib/service-syn.man .so lib/vlog-syn.man .so lib/ssl-syn.man .so lib/ssl-bootstrap-syn.man @@ -92,6 +93,8 @@ run a single command, e.g.: \fBovsdb\-server\fR detaches only after it starts listening on all \ configured remotes. .so lib/daemon.man +.SS "Service Options" +.so lib/service.man .SS "Logging Options" .so lib/vlog.man .SS "Public Key Infrastructure Options" diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 4105a95a4..c24d355ae 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -136,6 +136,7 @@ main(int argc, char *argv[]) proctitle_init(argc, argv); set_program_name(argv[0]); + service_start(&argc, &argv); signal(SIGPIPE, SIG_IGN); process_init(); @@ -302,6 +303,9 @@ main(int argc, char *argv[]) } poll_timer_wait_until(status_timer); poll_block(); + if (should_service_stop()) { + exiting = true; + } } ovsdb_jsonrpc_server_destroy(jsonrpc); SHASH_FOR_EACH(node, &all_dbs) { @@ -319,6 +323,7 @@ main(int argc, char *argv[]) } } + service_stop(); return 0; } diff --git a/vswitchd/ovs-vswitchd.8.in b/vswitchd/ovs-vswitchd.8.in index 0dd091f26..d2544f7f1 100644 --- a/vswitchd/ovs-vswitchd.8.in +++ b/vswitchd/ovs-vswitchd.8.in @@ -86,11 +86,14 @@ only allow privileged users, such as the superuser, to use it. \fBovs\-vswitchd\fR emits a log message if \fBmlockall()\fR is unavailable or unsuccessful. . +.SS "Daemon Options" .ds DD \ \fBovs\-vswitchd\fR detaches only after it has connected to the \ database, retrieved the initial configuration, and set up that \ configuration. .so lib/daemon.man +.SS "Service Options" +.so lib/service.man .SS "Public Key Infrastructure Options" .so lib/ssl.man .so lib/ssl-bootstrap.man diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index 990e58f0a..9da2f4909 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -73,6 +73,7 @@ main(int argc, char *argv[]) proctitle_init(argc, argv); set_program_name(argv[0]); + service_start(&argc, &argv); remote = parse_options(argc, argv, &unixctl_path); signal(SIGPIPE, SIG_IGN); sighup = signal_register(SIGHUP); @@ -127,9 +128,13 @@ main(int argc, char *argv[]) poll_immediate_wake(); } poll_block(); + if (should_service_stop()) { + exiting = true; + } } bridge_exit(); unixctl_server_destroy(unixctl); + service_stop(); return 0; }