summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3319fb)
raw | patch | inline | side by side (parent: e3319fb)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 22 May 2010 16:32:48 +0000 (16:32 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 22 May 2010 16:32:48 +0000 (16:32 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18632 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-client | patch | blob | history |
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index a098515049c290af094ffbda547e27c8084d49ad..56200d9964557078bc8530c094f7acf8de4b250f 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
use IO::Socket::INET;
use NetAddr::IP;
use Crypt::Rijndael;
-use GOsaSI::GosaSupportDaemon;
use Digest::MD5 qw(md5_hex md5 md5_base64);
use MIME::Base64;
use XML::Simple;
use File::Spec;
use File::Pid;
use Net::ARP;
+use GOsaSI::GosaSupportDaemon;
use POE qw(Component::Server::TCP Wheel::FollowTail Wheel::Run);
use Fcntl;
daemon_log("shutting down gosa-si-client", 1);
-# to be changed crude !!
-# system("kill `ps -C gosa-si-server -o pid=`");
+ # shtudown the client by telling the poe kernel
$global_kernel->yield('shutdown');
+ #removing the opts file
unlink ('/var/run/gosa-si/gosa-si-client.opts');
+ #removing the fifo for communication
unlink ($fai_com_fifo);
-
+
+ #removing the pid
$pid->remove or warn "Could not remove $pid_file\n";
exit(0);
sub find_servers {
# add gosa-si-server address from config file at first position of server list
- #my $server_check_cfg = Config::IniFiles->new( -file => $cfg_file );
my $server_check_cfg = Config::IniFiles->new( -file => $config );
# Parse servers string
}
}
+
sub start_daemon {
if( ! $foreground ) {
open STDIN, '+>/dev/null' or die "Can't read /dev/null: $!";
open STDOUT, '+>&STDIN' or die "Can't write to /dev/null: $!";
open STDERR, '+>&STDIN' or die "Can't write to /dev/null: $!";
- defined(my $child_pid = fork) or die "Can't fork: $!";
- exit if $child_pid;
+ defined($pid = fork) or die "Can't fork: $!";
+ exit if $pid;
setsid or die "Can't start a new session: $!";
}
return;
# read and set config parameters
&read_configfile($config, %cfg_defaults);
-# create pid file
-&create_pid($pid, $pid_file);
-
# daemonize the program
&start_daemon($foreground);
+# create pid file
+&create_pid($pid, $pid_file);
+
# Determine root uid and adm gid, used for creating log files
&get_perms_admin($root_uid, $adm_gid);