diff mbox

[ovs-dev,rhel,--user,5/7] ovn: add --user option to ovn-ctl.

Message ID 1447966722-18204-5-git-send-email-azhou@ovn.org
State Changes Requested
Headers show

Commit Message

Andy Zhou Nov. 19, 2015, 8:58 p.m. UTC
ovs-ctl now takes --user option to start OVS daemons under the user
specified. This is a similar change in OVN to launch OVN daemons
under the specified user.

Signed-off-by: Andy Zhou <azhou@ovn.org>
---
 ovn/utilities/ovn-ctl       | 6 ++++++
 ovn/utilities/ovn-ctl.8.xml | 4 ++++
 2 files changed, 10 insertions(+)

Comments

Ben Pfaff Nov. 24, 2015, 11:28 p.m. UTC | #1
On Thu, Nov 19, 2015 at 12:58:40PM -0800, Andy Zhou wrote:
> ovs-ctl now takes --user option to start OVS daemons under the user
> specified. This is a similar change in OVN to launch OVN daemons
> under the specified user.
> 
> Signed-off-by: Andy Zhou <azhou@ovn.org>

In two places in the documentation, I think USER should be USER[:GROUP].

Acked-by: Ben Pfaff <blp@ovn.org>
diff mbox

Patch

diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index 3e2ccf9..b49f37d 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -108,6 +108,8 @@  set_defaults () {
 
     OVS_RUNDIR=${OVS_RUNDIR:-${rundir}}
     OVN_RUNDIR=${OVN_RUNDIR:-${OVS_RUNDIR}}
+
+    USER="root:root"
 }
 
 set_option () {
@@ -145,6 +147,7 @@  Options:
   --ovn-northd-wrapper=WRAPPER   run with a wrapper like valgrind for debugging
   --ovn-controller-priority=NICE     set ovn-northd's niceness (default: $OVN_CONTROLLER_PRIORITY)
   --ovn-controller-wrapper=WRAPPER   run with a wrapper like valgrind for debugging
+  --user=USER                    run as 'USER' (default: root:root)
   -h, --help                     display this help message
 
 File location options:
@@ -206,6 +209,9 @@  do
             ;;
     esac
 done
+
+set_ovs_user_group $USER
+
 case $command in
     start_northd)
         start_northd
diff --git a/ovn/utilities/ovn-ctl.8.xml b/ovn/utilities/ovn-ctl.8.xml
index 89ad934..ced6384 100644
--- a/ovn/utilities/ovn-ctl.8.xml
+++ b/ovn/utilities/ovn-ctl.8.xml
@@ -26,6 +26,7 @@ 
     <p><code>--ovn-northd-wrapper=<var>WRAPPER</var></code></p>
     <p><code>--ovn-controller-priority=<var>NICE</var></code></p>
     <p><code>--ovn-controller-wrapper=<var>WRAPPER</var></code></p>
+    <p><code>--user=<var>USER</var></code></p>
     <p><code>-h</code> | <code>--help</code></p>
 
     <h1>File location options</h1>
@@ -47,4 +48,7 @@ 
     <p><code># ovn-ctl start_northd</code></p>
     <p><code># ovn-ctl start_controller</code></p>
 
+    <h2>Run as the ovs user</h2>
+    <p><code># ovn-ctl --user=ovs:ovs start_controller</code></p>
+
 </manpage>