Re: [PATCH] Make commandtest more robust wrt its execution environment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/24/2011 07:13 AM, Daniel P. Berrange wrote:
When executed from cron, commandtest would failure to correctly
identified daemon processes. Set session ID and process group

"would fail to correctly identify daemon processes".

ACK with those two typos corrected.

IDs at startup to ensure we have a consistent environment to
run in.

* tests/commandtest.c: Call setsid() and setpgid()
---
  tests/commandtest.c |    3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index 7157c51..dc2f8a1 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -730,6 +730,9 @@ mymain(int argc, char **argv)
      if (chdir("/tmp")<  0)
          return(EXIT_FAILURE);

+    setpgid(0, 0);
+    setsid();
+
      /* Kill off any inherited fds that might interfere with our
       * testing.  */
      fd = 3;

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]