summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea40a66)
raw | patch | inline | side by side (parent: ea40a66)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Jan 2008 13:28:05 +0000 (13:28 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 14 Jan 2008 13:28:05 +0000 (13:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8323 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-bus | patch | blob | history | |
gosa-si/gosa-si-server | patch | blob | history |
diff --git a/gosa-si/gosa-si-bus b/gosa-si/gosa-si-bus
index 330d205a94cab6caa121329a979eec9896b7e960..bca785bfedd78eb8ddea0e0d1aaeb93dd7b5dc89 100755 (executable)
--- a/gosa-si/gosa-si-bus
+++ b/gosa-si/gosa-si-bus
daemon_log("$0 started!", 1);
# Just fork, if we"re not in foreground mode
-if( ! $foreground ) { $pid = fork(); }
+if( ! $foreground ) {
+ chdir '/' or die "Can't chdir to /: $!";
+ open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
+ open STDOUT, '>>/dev/null' or die "Can't write to /dev/null: $!";
+ open STDERR, '>>/dev/null' or die "Can't write to /dev/null: $!";
+ defined($pid = fork) or die "Can't fork: $!";
+ exit if $pid;
+ setsid or die "Can't start a new session: $!";
+ umask 0;
+}
+
else { $pid = $$; }
# Do something useful - put our PID into the pid_file
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 8f2b3f3c62e58000b5fc8b4abb24a39e441f7444..807f86a85ec7d2caf523e43ddc82405918a060d0 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
# Just fork, if we"re not in foreground mode
if( ! $foreground ) {
- $pid = fork();
+ chdir '/' or die "Can't chdir to /: $!";
+ open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
+ open STDOUT, '>>/dev/null' or die "Can't write to /dev/null: $!";
+ open STDERR, '>>/dev/null' or die "Can't write to /dev/null: $!";
+ defined($pid = fork) or die "Can't fork: $!";
+ exit if $pid;
+ setsid or die "Can't start a new session: $!";
+ umask 0;
} else {
$pid = $$;
}
#}
#
-
##################################
#everything ready, okay, lets start
##################################