Alon Bar-Lev has uploaded a new change for review.

Change subject: packaging: engine-service: do not fail if setsid fails
......................................................................

packaging: engine-service: do not fail if setsid fails

setsid fails if already session leader.

Change-Id: I7092aa2d009875fcf45c560a6d480901016d5273
Signed-off-by: Alon Bar-Lev <alo...@redhat.com>
---
M packaging/fedora/engine-service.py.in
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/16/13416/1

diff --git a/packaging/fedora/engine-service.py.in 
b/packaging/fedora/engine-service.py.in
index 28dce86..8f1170d 100644
--- a/packaging/fedora/engine-service.py.in
+++ b/packaging/fedora/engine-service.py.in
@@ -570,9 +570,14 @@
 
     # Then close standard input and some other security measures:
     os.close(0)
-    os.setsid()
     os.chdir("/")
 
+    # setsid fails if already group leader
+    try:
+        os.setsid()
+    except OSError:
+        pass
+
     # Then open the console log and redirect standard output and errors to it:
     engineConsoleFd = os.open(engineConsoleLogFile, os.O_CREAT | os.O_WRONLY | 
os.O_APPEND, 0660)
     os.dup2(engineConsoleFd, 1)


--
To view, visit http://gerrit.ovirt.org/13416
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7092aa2d009875fcf45c560a6d480901016d5273
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to