This patch allows using run_northd in ovn-ctl which
results in running northd without detaching

Signed-off-by: Michal Nasiadka <[email protected]>
---
 utilities/ovn-ctl    | 14 ++++++++++++++
 utilities/ovn-lib.in |  2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/utilities/ovn-ctl b/utilities/ovn-ctl
index 3b62ca9b7..2fd18fd16 100755

--- a/utilities/ovn-ctl
+++ b/utilities/ovn-ctl
@@ -538,6 +538,11 @@ run_nb_ovsdb() {
     start_nb_ovsdb
 }
 
+run_northd() {
+    OVN_NORTHD_DETACH=no
+    start_northd
+}
+
 run_sb_ovsdb() {
     DB_SB_DETACH=no
     start_sb_ovsdb
@@ -614,6 +619,9 @@ start_northd () {
         if test X"$OVN_NORTHD_SSL_SERVER_NAME" != X; then
             set "$@" --ssl-server-name=$OVN_NORTHD_SSL_SERVER_NAME
         fi
+        if test X"$OVN_NORTHD_DETACH" != X; then
+            export DETACH=no
+        fi
 
         [ "$OVN_USER" != "" ] && set "$@" --user "$OVN_USER"
 
@@ -1026,6 +1034,8 @@ set_defaults () {
 
     MONITOR="yes"
 
+    DETACH="yes"
+
     DB_NB_DETACH="yes"
     DB_SB_DETACH="yes"
 
@@ -1219,6 +1229,7 @@ Commands:
   demote_ovnnb                demote ovn northbound db active server to backup
   demote_ovnsb                demote ovn southbound db active server to backup
   run_nb_ovsdb                run ovn northbound db ovsdb-server process
+  run_northd                  run ovn northd process
   run_sb_ovsdb                run ovn southbound db ovsdb-server process
   promote_ic_nb               promote ovn ic-northbound db backup server to 
active
   promote_ic_sb               promote ovn ic-southbound db backup server to 
active
@@ -1699,6 +1710,9 @@ case $command in
     run_nb_ovsdb)
         run_nb_ovsdb
         ;;
+    run_northd)
+        run_northd
+        ;;
     run_sb_ovsdb)
         run_sb_ovsdb
         ;;
diff --git a/utilities/ovn-lib.in b/utilities/ovn-lib.in
index 5a0766816..c2c98957b 100644
--- a/utilities/ovn-lib.in
+++ b/utilities/ovn-lib.in
@@ -130,7 +130,7 @@ start_ovn_daemon () {
     # pidfile and monitoring
     ovn_install_dir "$ovn_rundir"
     set "$@" --pidfile="$ovn_rundir/$daemon.pid"
-    set "$@" --detach
+    test X"$DETACH" = Xno || set "$@" --detach
     test X"$MONITOR" = Xno || set "$@" --monitor
 
     chown -R $INSTALL_USER:$INSTALL_GROUP $ovn_logdir
-- 
2.50.1 (Apple Git-155)
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to