[ovs-dev] [PATCH V3 2/4] ovs-ofctl: Fixed PID file naming on windows

Paul Boca pboca at cloudbasesolutions.com
Tue Jun 7 15:09:02 UTC 2016


Hi!

I think I created a confusion here.
I meant relative path. If a –pidfile was given “abc.pid” then this would be ignored
because it doesn’t contain ‘:’ and the app name would be used instead.
With my patch “abc.pid” gets expanded to <rundir>\abc.pi.

This is for Windows only. I will update the patch description.

Thanks,
Paul

From: Guru Shetty [mailto:guru at ovn.org]
Sent: Tuesday, June 7, 2016 6:03 PM
To: Paul Boca
Cc: dev at openvswitch.org
Subject: Re: [ovs-dev] [PATCH V3 2/4] ovs-ofctl: Fixed PID file naming on windows



On 7 June 2016 at 01:00, Paul Boca <pboca at cloudbasesolutions.com<mailto:pboca at cloudbasesolutions.com>> wrote:
If an absolute path is given to --pidfile parameter (not containing ':')
then the application name is used for PID file, ignoring the given name.

What is an example of absolute path that does not include ":"? Would that be something like "/foo/bar/name.pid"? If so, doesn't your patch return something like "/var/run/openvswitch/foo/bar/name.pid" ? That looks wrong to me.


Signed-off-by: Paul-Daniel Boca <pboca at cloudbasesolutions.com<mailto:pboca at cloudbasesolutions.com>>
---
V2: Updated commit message
---
 lib/daemon-windows.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c
index ac71aa1..8cf0fea 100644
--- a/lib/daemon-windows.c
+++ b/lib/daemon-windows.c
@@ -485,8 +485,12 @@ daemon_become_new_user(bool access_datapath OVS_UNUSED)
 char *
 make_pidfile_name(const char *name)
 {
-    if (name && strchr(name, ':')) {
-        return xstrdup(name);
+    if (name) {
+        if (strchr(name, ':')) {
+            return xstrdup(name);
+        } else {
+            return xasprintf("%s/%s", ovs_rundir(), name);
+        }
     } else {
         return xasprintf("%s/%s.pid", ovs_rundir(), program_name);
     }
--
2.7.2.windows.1
_______________________________________________
dev mailing list
dev at openvswitch.org<mailto:dev at openvswitch.org>
http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list