[Opensrf-commits] r993 - trunk/src/perlmods/OpenSRF

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 4 19:52:08 EDT 2007


Author: miker
Date: 2007-07-04 19:48:21 -0400 (Wed, 04 Jul 2007)
New Revision: 993

Modified:
   trunk/src/perlmods/OpenSRF/System.pm
Log:
do the process separation dance on server bootstrapping, just like with the C code

Modified: trunk/src/perlmods/OpenSRF/System.pm
===================================================================
--- trunk/src/perlmods/OpenSRF/System.pm	2007-07-04 20:08:15 UTC (rev 992)
+++ trunk/src/perlmods/OpenSRF/System.pm	2007-07-04 23:48:21 UTC (rev 993)
@@ -10,7 +10,7 @@
 use OpenSRF::Utils::LogServer;
 #use OpenSRF::DOM;
 use OpenSRF::EX qw/:try/;
-use POSIX ":sys_wait_h";
+use POSIX qw/setsid :sys_wait_h/;
 use OpenSRF::Utils::Config; 
 use OpenSRF::Utils::SettingsParser;
 use OpenSRF::Utils::SettingsClient;
@@ -127,7 +127,13 @@
 	my $bsconfig = OpenSRF::Utils::Config->current;
 
 	# Start a process group and make me the captain
-	setpgrp( 0, 0 ); 
+	exit if (OpenSRF::Utils::safe_fork());
+	chdir('/');
+	setsid(); 
+	close STDIN;
+	close STDOUT;
+	close STDERR;
+
 	$0 = "OpenSRF System";
 
 	# -----------------------------------------------



More information about the opensrf-commits mailing list