summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 68351b6)
raw | patch | inline | side by side (parent: 68351b6)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 16 May 2010 22:02:38 +0000 (22:02 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sun, 16 May 2010 22:02:38 +0000 (22:02 +0000) |
- Cleanup of some fonctions
- Added dump configuration to gosa-si-client
- Cleaned usage to give better explanations
- added new options to manpages
- Renomed GOSA::GOSa to GOsa::SI to be more perl compliant and more clean
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18483 594d385d-05f5-0310-b6e9-bd551577e9d8
- Added dump configuration to gosa-si-client
- Cleaned usage to give better explanations
- added new options to manpages
- Renomed GOSA::GOSa to GOsa::SI to be more perl compliant and more clean
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18483 594d385d-05f5-0310-b6e9-bd551577e9d8
35 files changed:
diff --git a/gosa-si/client.conf b/gosa-si/client.conf
index 7859d5e8608c2fe541b796fb49e15f3a01e1acea..88008aee523007ec5a6fa2595a68f5f9a1757cb0 100644 (file)
--- a/gosa-si/client.conf
+++ b/gosa-si/client.conf
[General]
-log-file = /var/log/gosa-si-client.log
-pid-file = /var/run/gosa-si-client.pid
+log-file = /var/log/gosa-si/gosa-si-client.log
+pid-file = /var/run/gosa-si/gosa-si-client.pid
[Client]
fai-logpath = /var/log/fai/fai.log
index ffb00f3d71b5b667928a6efba0cd5789c9969ae8..c157003549480987b00d09e6a4c266696551eb3f 100644 (file)
use strict;
use warnings;
+
+use File::Basename;
+use GOsaSI::GosaSupportDaemon;
+
use Exporter;
use Fcntl;
-use GOSA::GosaSupportDaemon;
-use File::Basename;
+
our @ISA = qw(Exporter);
my $chrony_file = "/etc/chrony/chrony.conf";
my $syslog_file = "/etc/syslog.conf";
+# why is it re read here, the config is read at the start of the program no !!
my %cfg_defaults = (
"client" => {
"ldap" => [\$ldap_enabled, 1],
### Start ######################################################################
+# why not using the config read in the main ?? !!
&main::read_configfile($main::cfg_file, %cfg_defaults);
close($FD_FILE);
}
- return;
+ return;
}
-
+# should be the first function of each module of gosa-si !!
sub get_events {
return \@events;
}
# registrated at new daemon
&main::register_at_server();
- return;
+ return;
}
$main::server_key = $new_server_key;
}
- return;
+ return;
}
&main::daemon_log("Hardware detection done!", 4);
&write_to_file('goto-hardware-detection-stop', $fai_logpath);
-
- &main::send_msg_hash_to_target(
- &main::create_xml_hash("detected_hardware", $main::client_address, $main::server_address, $result),
- $main::server_address,
- $main::server_key,
+
+ &main::send_msg_hash_to_target(
+ &main::create_xml_hash("detected_hardware", $main::client_address, $main::server_address, $result),
+ $main::server_address,
+ $main::server_key,
);
return;
index 8070221a486fd85c3d3e8658e624706bcac92a5b..d0846f615667396c441235f47f411ffbfa85a9c7 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
+use GOsaSI::GosaSupportDaemon;
use MIME::Base64;
+use Exporter;
+
our @ISA = qw(Exporter);
my @events = (
index 3afc78386f30f694eae37b0ae93f266758eb9f83..4a304eb9304d70b99dacfe85499e0cc500b97b43 100644 (file)
=cut
-
package gosaTriggered;
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use MIME::Base64;
use File::Temp qw/ tempfile/;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
index 62420fe18af48594df451cd92c442106d4c68d20..a335948ddbbe12e0984477bb674ca9faaa5b753f 100644 (file)
my $target = @{$msg_hash->{'target'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
- my $Datei = "/var/run/gosa-si-client.activated";
+ my $Datei = "/var/run/gosa-si/gosa-si-client.activated";
open(my $FILE, ">", "$Datei");
print $FILE "$msg\n";
close($FILE);
index 39cf3f47612eecc9ad354c4eae0ae295a8ca30b5..a4ccd33bc923fbd168d3108ef8a52ade39805207 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use Authen::Krb5;
use Authen::Krb5::Admin qw(:constants);
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
"password" => [\$krb_password, ""],
},
);
+# why not using the main::read_configfile, the code seems exactly the same
&krb5_read_configfile($main::cfg_file, %cfg_defaults);
index b823237d9d0306e3306c72cd2638bf3a0a85349c..241dc07b69f90c192154133ac9dd505cf68df12e 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
BEGIN {}
END {}
my $ts_load_file;
my $waiting_for_ts_info;
my %cfg_defaults = (
- "client" => {
- "ts-load-file" => [\$ts_load_file, "/var/run/gosa-si-client-ts-load.txt"],
- "waiting-for-ts-info" => [\$waiting_for_ts_info, 5],
- },
+ "client" => {
+ "ts-load-file" => [\$ts_load_file, "/var/run/gosa-si/gosa-si-client-ts-load.txt"],
+ "waiting-for-ts-info" => [\$waiting_for_ts_info, 5],
+ },
);
+
+# to be removed ugly !! why not using main::_read_configfile
&GOSA::GosaSupportDaemon::read_configfile($main::cfg_file, %cfg_defaults);
index c5ee3dd4c048d129760f8b36e21d263de4a44ca5..43552af74f900fa326a3943a9c3887806c3eaf88 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use MIME::Base64;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
index fede17e5fafb8a458939f9326a773684ecfed6a6..5f3241a570f0f4705d807e505c8d5096f4ad424c 100644 (file)
# /etc/default/gosa-si - configure the init script
START_CLIENT=1
-DEBUG=-vvv
+DEBUG=-vvvvvvv
index 2d13e8f1014b88ea5c838427755c7fa1bb5e4473..0cab98e299586ac67238867afdf319b6eccc740f 100644 (file)
/etc/default
-/usr/share/perl5/GOSA
+/usr/share/perl5/GOsaSI
+/var/run/gosa-si
+/var/log/gosa-si
index 9a9cb9268e53685cfb5f6d1a940107785293263b..69e74e4e93c09bac38da7186c6f08c21c171534e 100755 (executable)
CLIENT="gosa-si-client"
DAEMON_SERVER="/usr/sbin/${SERVER}"
DAEMON_CLIENT="/usr/sbin/${CLIENT}"
-PIDFILE_SERVER="/var/run/${SERVER}.pid"
-PIDFILE_CLIENT="/var/run/${CLIENT}.pid"
+PIDFILE_SERVER="/var/run/gosa-si/${SERVER}.pid"
+PIDFILE_CLIENT="/var/run/gosa-si/${CLIENT}.pid"
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
index 4fede15d3acb2547daf430e405b3e24de71bbf36..1e14d1848df022ad24a1c86b3e33136615ebea3a 100644 (file)
-modules/GosaSupportDaemon.pm usr/share/perl5/GOSA
-modules/DBsqlite.pm usr/share/perl5/GOSA
+modules/GosaSupportDaemon.pm usr/share/perl5/GOsaSI
+modules/DBsqlite.pm usr/share/perl5/GOsaSI
modules/ArpWatch.pm usr/share/perl5/POE/Component
diff --git a/gosa-si/debian/rules b/gosa-si/debian/rules
index 1ad15fefa9b6d900dc8dc131080b290951c51263..e62500e472ff0c4f92a0ea64fb57869e0785c873 100755 (executable)
--- a/gosa-si/debian/rules
+++ b/gosa-si/debian/rules
-for i in *; do \
cp -R $$i debian/tmp ; \
done
- -find debian/tmp -name '*.svn' -type d -exec rm -rf {} \; 2> /dev/null
-
- -for i in gosa-si-client gosa-si-server modules/GosaPackages.pm modules/ClientPackages.pm modules/ServerPackages.pm server/events/*; do sed -i 's/use GosaSupportDaemon;/use GOSA::GosaSupportDaemon;/g;s/use DBsqlite;/use GOSA::DBsqlite;/g' debian/tmp/$$i; done
-
- -sed -i 's!"/etc/gosa-si/modules";!use lib "/usr/lib/gosa-si/modules";!g' debian/tmp/gosa-si-server
-
- -sed -i 's!"/etc/gosa-si/server/events";!"/usr/lib/gosa-si/server/events";!g' debian/tmp/modules/GosaPackages.pm
touch install-stamp
dh_installchangelogs
dh_installman
dh_installlogrotate
- #dh_installdebconf
dh_installinit --init-script=gosa-si -- start 00 2 3 4 5 . stop 29 1 .
chmod 640 debian/gosa-si-server/etc/gosa-si/server.conf debian/gosa-si-client/etc/gosa-si/client.conf
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index d9c62845ca4afbf27314fa74bf567f016bddd6ef..f048269b98e04a6a8560601464effb227197a275 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
#!/usr/bin/perl
-#===============================================================================
-#
-# FILE: gosa-si-client
+#*********************************************************************
#
-# USAGE: gosa-si-client
+# gosa-si-client -- client for the gosa-si-server
#
-# DESCRIPTION:
+# (c) 2007-2009 by Andreas Rettenberger <rettenberger@gonicus.de>
+# (c) 2008-2010 by Cajus Pollmeier <pollmeier@gonicus.de>
+# (c) 2008-2009 by Jan Wenzel <wenzel@gonicus.de>
+# (c) 2010 by Benoit Mortier <benoit.mortier@opensides.be>
#
-# OPTIONS: ---
-# REQUIREMENTS: libnetaddr-ip-perl
-# BUGS: ---
-# NOTES:
-# AUTHOR: (Andreas Rettenberger), <rettenberger@gonicus.de>
-# COMPANY:
-# VERSION: 1.0
-# CREATED: 12.09.2007 08:54:41 CEST
-# REVISION: ---
-#===============================================================================
+#*********************************************************************
use strict;
use warnings;
+
use Getopt::Long;
use Config::IniFiles;
-use POSIX;
use Time::HiRes qw( gettimeofday );
-
-use POE qw(Component::Server::TCP Wheel::FollowTail Wheel::Run);
use IO::Socket::INET;
use NetAddr::IP;
use Crypt::Rijndael;
-use GOSA::GosaSupportDaemon;
+use GOsaSI::GosaSupportDaemon;
use Digest::MD5 qw(md5_hex md5 md5_base64);
use MIME::Base64;
use XML::Simple;
use File::Basename;
use File::Spec;
use Net::ARP;
+
+use POE qw(Component::Server::TCP Wheel::FollowTail Wheel::Run);
use Fcntl;
+use POSIX;
# Workaround: need pure perl to make it work with UTF-8 :-(
$XML::Simple::PREFERRED_PARSER= "XML::SAX::PurePerl";
our $terminal_server_hash;
our $opts_dnslookup;
+# where is the config stored by default and his name
+our $config = '/etc/fts/fts.conf';
+
+# by default dumping of config is undefined
+our $dump_config = undef;
+
# default variables
my $REGISTERED = 0;
my $system_com_fifo = "/var/run/gosa-si-client-system-com.socket";
my %files_to_watch = (fai_fifo => $fai_com_fifo, system_fifo => $system_com_fifo);
-# in function register_at_gosa_si_server, after which period of seconds a new registration should be tried if a registration was
-# not successful until now
+# in function register_at_gosa_si_server, after which period of seconds a new registration should be tried if a registration was not successful until now
my $delay_set_time = 10;
-our $prg= basename($0);
+#our $prg= basename($0);
# all n seconds the client reports logged_in users to gosa-si-server
my $trigger_logged_in_users_report_delay = 600;
%cfg_defaults = (
"General" =>
- {"log-file" => [\$log_file, "/var/run/".$prg.".log"],
- "pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
- "opts-file" => [\$opts_file, "/var/run/".$prg.".opts"],
+ {"log-file" => [\$log_file, "/var/log/gosa-si/gosa-si.log"],
+ "pid-file" => [\$pid_file, "/var/run/gosa-si/gosa-si-client.pid"],
+ "opts-file" => [\$opts_file, "/var/run/gosa-si/gosa-si-client.opts"],
},
"Client" =>
{"port" => [\$client_port, "20083"],
#=== FUNCTIONS = functions =====================================================
-sub usage {
- print STDERR << "EOF" ;
-usage: $prg [-hvf] [-c config]
+#############################
+#
+# @brief Display error message and/or help text.
+#
+# In correspondence to previous GetOptions
+#
+# @param $text - string to print as error message
+# @param $help - set true, if you want to show usage help
+#
+sub usage
+{
+ my( $text, $help ) = @_;
+
+ $text = undef if( 'h' eq $text );
+ (defined $text) && print STDERR "\n$text\n";
- -h : this (help) message
- -c <file> : config file
- -f : foreground, process will not be forked to background
- -v : be verbose (multiple to increase verbosity)
-
+ if( (defined $help && $help)
+ || (!defined $help && !defined $text) )
+{
+ print STDERR << "EOF";
+
+ usage: $0 [-hvf] [-c config]
+
+ -h : this (help) message
+ -c <file> : config file (default: ${config})
+ -x <cfg> : dump configuration to stdout
+ ( 1 = current, 2 = default )
+ -f : foreground (don't fork)
+ -v : be verbose (multiple to increase verbosity)
EOF
- print "\n" ;
+}
+ print( "\n" );
+
+ exit( -1 );
}
+#############################
+#
+# @brief Manage gosa-si-client configuration.
+#
+# Will exit after successfull dump to stdout (type = 1 | 2)
+#
+# Dump type can be:
+# 1: Current gosa-si-client configuration in config file (exit)
+# 2: Default gosa-si-client configuration (exit)
+# 3: Dump to logfile (no exit)
+#
+# @param int config type
+#
+sub dump_configuration {
+
+ my( $cfg_type ) = @_;
+
+ return if( ! defined $cfg_type );
+
+ if(1==$cfg_type ) {
+ print( "# Current gosa-si-client configuration\n" );
+ } elsif (2==$cfg_type) {
+ print( "# Default gosa-si-client configuration\n" );
+ } elsif (3==$cfg_type) {
+ daemon_log( "Dumping gosa-si-client configuration\n", 2 );
+ } else {
+ return;
+ }
+
+ foreach my $section (keys %cfg_defaults) {
+ if( 3 != $cfg_type ) {
+ print( "\n[${section}]\n" );
+ } else {
+ daemon_log( "\n [${section}]\n", 3 );
+ }
+
+ foreach my $param (sort( keys %{$cfg_defaults{ $section }})) {
+ my $pinfo = $cfg_defaults{ $section }{ $param };
+ my $value;
+ if (1==$cfg_type) {
+ if( defined( ${@$pinfo[ 0 ]} ) ) {
+ $value = ${@$pinfo[ 0 ]};
+ print( "$param=$value\n" );
+ } else {
+ print( "#${param}=\n" );
+ }
+ } elsif (2==$cfg_type) {
+ $value = @{$pinfo}[ 1 ];
+ if( defined( @$pinfo[ 1 ] ) ) {
+ $value = @{$pinfo}[ 1 ];
+ print( "$param=$value\n" );
+ } else {
+ print( "#${param}=\n" );
+ }
+ } elsif (3==$cfg_type) {
+ if( defined( ${@$pinfo[ 0 ]} ) ) {
+ $value = ${@$pinfo[ 0 ]};
+ daemon_log( " $param=$value\n", 3 )
+ }
+ }
+ }
+ }
+
+
+# We just exit at stdout dump
+ if( 3 == $cfg_type ) {
+ daemon_log( "\n", 3 );
+ } else {
+ exit( 0 );
+ }
+}
+
+
#=== FUNCTION ================================================================
# NAME: check_cmdline_param
# PARAMETERS:
}
}
-
+#############################
+#
+# @brief When caching an interrupt remove file pid and stopping gosa-si
+#
sub sig_int_handler {
- my ($signal) = @_;
+ my ($signal) = @_;
+
+ daemon_log("shutting down gosa-si-client", 1);
+
+# to be changed crude !!
+# system("kill `ps -C gosa-si-server -o pid=`");
+ $global_kernel->yield('shutdown');
- daemon_log("shutting down gosa-si-client", 1);
- system("kill `ps -C gosa-si-client -o pid=`");
+# $pid->remove or warn "Could not remove $pidfile\n";
+
+ exit(0);
}
$SIG{INT} = \&sig_int_handler;
-
#=== FUNCTION ================================================================
# NAME: logging
# PARAMETERS: level - string - default 'info'
$microSeconds =~ s/^\d*(.\d\d)$/$1/;
- my $log_msg = "$month $monthday $hours:$minutes:$seconds$microSeconds $prg $msg\n";
+ my $log_msg = "$month $monthday $hours:$minutes:$seconds$microSeconds gosa-si-client $msg\n";
print LOG_HANDLE $log_msg;
if( $foreground ) {
print STDERR $log_msg;
my $error = 0;
if( not defined $file || not -f $file ) {
- &main::daemon_log("ERROR: $prg: check '-f file' failed: $file", 1);
+ &main::daemon_log("ERROR: gosa-si-client : check '-f file' failed: $file", 1);
$error++;
}
if( not defined $string || 0 == length($string)) {
- &main::daemon_log("ERROR: $prg: empty string to write to file '$file'", 1);
+ &main::daemon_log("ERROR: gosa-si-client : empty string to write to file '$file'", 1);
$error++;
}
}
}
+#
#==== MAIN = main ==============================================================
-# parse commandline options
-Getopt::Long::Configure( "bundling" );
-GetOptions("h|help" => \&usage,
- "c|config=s" => \$cfg_file,
- "f|foreground" => \$foreground,
- "v|verbose+" => \$verbose,
- );
+#
+# Parse options and allow '-vvv'
+Getopt::Long::Configure( 'bundling' );
+GetOptions( 'v|verbose+' => \$verbose,
+ 'h|help' => \&usage,
+ 'c|config=s' => \$config,
+ 'x|dump-config=i' => \$dump_config,
+ 'f|foreground' => \$foreground)
+ or usage( '', 1 );
+
+# We may want to dump the default configuration
+if( defined $dump_config ) {
+ if($dump_config==1) {
+ } elsif ($dump_config==2) {
+ dump_configuration( $dump_config );
+ } else {
+ usage( "Dump configuration value has to be 1 or 2" );
+ }
+}
# read and set config parameters
-&check_cmdline_param ;
+#&check_cmdline_param ;
&read_configfile($cfg_file, %cfg_defaults);
&check_pid;
}
daemon_log(" ", 1);
-daemon_log("$prg started!", 1);
+daemon_log("gosa-si-client started!", 1);
daemon_log("INFO: status: $client_status", 1);
daemon_log("INFO: ".$client_status_hash->{$client_status}.": $client_revision", 1);
index 7a2f84a0d64ca4f6e5d80d6b049bf010487f18d4..507bf966eb97f8b1c5b0b689d6ecbf0761ecb4dc 100644 (file)
B<-c> I<file>, B<--config=>I<file>
configuration file, default F</etc/gosa-si/client.conf>
+B<-x>, B<--dump>
+ Dump configuration
+ -1 Current configuration
+ -2 Default Configuration
=head1 DESCRIPTION
This code is part of GOsa (L<http://www.gosa-project.org>)
-Copyright (C) 2003-2009 GONICUS GmbH
+Copyright (C) 2003-2010 GONICUS GmbH
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 83ac36dfbfdde01edc628c4612d1ac23e749096e..489202349658efcbb38bfd513692122e762dda3d 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
#!/usr/bin/perl
-#===============================================================================
-#
-# FILE: gosa-si-server
+#*********************************************************************
#
-# USAGE: ./gosa-si-server
+# gosa-si-client -- client for the gosa-si-server
#
-# DESCRIPTION:
+# (c) 2007-2009 by Andreas Rettenberger <rettenberger@gonicus.de>
+# (c) 2008-2010 by Cajus Pollmeier <pollmeier@gonicus.de>
+# (c) 2008-2009 by Jan Wenzel <wenzel@gonicus.de>
+# (c) 2010 by Benoit Mortier <benoit.mortier@opensides.be>
#
-# OPTIONS: ---
-# REQUIREMENTS: libconfig-inifiles-perl libcrypt-rijndael-perl libxml-simple-perl
-# libdata-dumper-simple-perl libdbd-sqlite3-perl libnet-ldap-perl
-# libpoe-perl
-# BUGS: ---
-# NOTES:
-# AUTHOR: (Andreas Rettenberger), <rettenberger@gonicus.de>
-# COMPANY:
-# VERSION: 1.0
-# CREATED: 12.09.2007 08:54:41 CEST
-# REVISION: ---
-#===============================================================================
-
+#*********************************************************************
use strict;
use warnings;
+
use Getopt::Long;
use Config::IniFiles;
-use POSIX;
-
-use Fcntl qw/:flock/;
use IO::Socket::INET;
use IO::Handle;
use IO::Select;
-use Symbol qw(qualify_to_ref);
use Crypt::Rijndael;
use MIME::Base64;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Data::Dumper;
use Sys::Syslog qw( :DEFAULT setlogsock);
use Time::HiRes qw( usleep clock_gettime );
-use Cwd;
use File::Spec;
use File::Basename;
use File::Find;
use File::Copy;
use File::Path;
-use GOSA::GosaSupportDaemon;
-use POE qw(Component::Server::TCP Wheel::Run Filter::Reference);
use Net::LDAP;
use Net::LDAP::Util qw(:escape);
+use GOsaSI::GosaSupportDaemon;
+
+use POE qw(Component::Server::TCP Wheel::Run Filter::Reference);
+use Symbol qw(qualify_to_ref);
+use Fcntl qw/:flock/;
+use POSIX;
my $server_version = '$HeadURL: https://oss.gonicus.de/repositories/gosa/trunk/gosa-si/gosa-si-server $:$Rev$';
my $db_module = "DBsqlite";
{
no strict "refs";
-require ("GOSA/".$db_module.".pm");
-("GOSA/".$db_module)->import;
+require ("GOsaSI/".$db_module.".pm");
+("GOsaSI/".$db_module)->import;
}
my $modules_path = "/usr/lib/gosa-si/modules";
@@ -231,8 +220,8 @@ our $check_periodic = {"months"=>'', "weeks"=>'', "days"=>'', "hours"=>'', "minu
%cfg_defaults = (
"General" => {
- "log-file" => [\$log_file, "/var/run/".$prg.".log"],
- "pid-file" => [\$pid_file, "/var/run/".$prg.".pid"],
+ "log-file" => [\$log_file, "/var/log/gosa-si/gosa-si-server.log"],
+ "pid-file" => [\$pid_file, "/var/run/gosa-si/gosa-si-server.pid"],
},
"Server" => {
"ip" => [\$server_ip, "0.0.0.0"],
# }
# TODO alle verbliebenden ldap verbindungen aus allen heaps beenden
-
daemon_log("shutting down gosa-si-server", 1);
+
+ #$global_kernel->yield('shutdown');
+
system("kill `ps -C gosa-si-server -o pid=`");
+
+ exit(0);
}
$SIG{INT} = \&sig_int_handler;
index e4ceb67778e91fe473e6b5870aef53e8baba6c6a..50772cd1c66167b1f7afdc74e52a878333185f3a 100644 (file)
This code is part of GOsa (L<http://www.gosa-project.org>)
-Copyright (C) 2003-2009 GONICUS GmbH
+Copyright (C) 2003-2010 GONICUS GmbH
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
index 4dc4f57e71b76129956ef04305d02dac6671adcc..408d80ac667963633d09b2bad95ee6182e84634f 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
-use POSIX;
-use Fcntl;
use Net::LDAP;
use Net::LDAP::LDIF;
use Net::LDAP::Entry;
use Net::DNS;
use Switch;
use Data::Dumper;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
+use POSIX;
+use Fcntl;
use Socket;
our @ISA = ("Exporter");
},
);
+# to be removed use only main::read_configfile
#=== FUNCTION ================================================================
# NAME: read_configfile
# PARAMETERS: cfg_file - string -
# Don't start if some of the modules are missing
if(($arp_enabled eq 'true') && $start_service) {
if($lookup_vendor) {
+ # put the file in /etc/gosa/oui.txt or use the native oui.txt from snmp
eval("Net::MAC::Vendor::load_cache('file:///usr/lib/gosa-si/modules/oui.txt')");
if($@) {
&main::daemon_log("Loading OUI cache file failed! MAC Vendor lookup disabled", 1);
my $mac=shift;
my $result={};
- my $ldap_handle = &main::get_ldap_handle();
+ my $ldap_handle = &main::get_ldap_handle();
if(defined($ldap_handle)) {
my $ldap_result= &search_ldap_entry(
$ldap_handle,
index f714cd46608c47190ce216a4742670e9586fe968..1f91d053bc5c94cf2e29cfdcc97dd226ff8dd3f0 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use IO::Socket::INET;
use XML::Simple;
use Data::Dumper;
use Net::LDAP::Util;
use Socket;
use Net::hostent;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = ("Exporter");
my $mesg;
my %cfg_defaults = (
-"server" => {
+"Server" => {
"ip" => [\$server_ip, "0.0.0.0"],
"mac-address" => [\$main::server_mac_address, "00:00:00:00:00"],
"port" => [\$server_port, "20081"],
### START #####################################################################
# read configfile and import variables
+#why not using the main::read_configfile !!
&local_read_configfile();
index 7a7f67f7e36c5c7c9738fafeeef1cfb017809181..da87a38e1a2b57395f447fa7005b357fdde76f49 100644 (file)
-package GOSA::DBmysql;
+package GOsaSI::DBmysql;
use strict;
use warnings;
-use DBI;
+
use Data::Dumper;
-use GOSA::GosaSupportDaemon;
use Time::HiRes qw(usleep);
+use GOsaSI::GosaSupportDaemon;
+
+use DBI;
my $col_names = {};
index 0a2e7f7a1581e7cc82b7a8f91f164f3d29ac9b24..31f2c395df3df665069bfe9dd80534458266beea 100644 (file)
-package GOSA::DBsqlite;
+package GOsaSI::DBsqlite;
use strict;
use warnings;
index 6c7159dd81c91d82f06cf5e5b7354a4af1c040ed..c18472eb8047e04df3cc361435786aa55616901c 100644 (file)
use warnings;
use Exporter;
-use GOSA::GosaSupportDaemon;
+use GOsaSI::GosaSupportDaemon;
use IO::Socket::INET;
use Socket;
use XML::Simple;
index 9c33df325d1a937c45dfc85392be2cbcda85349a..651bd57d7a1d914fec06b226d69cbdfd08d60014 100644 (file)
-package GOSA::GosaSupportDaemon;
+package GOsaSI::GosaSupportDaemon;
use strict;
use warnings;
-use Exporter;
use IO::Socket::INET;
use Crypt::Rijndael;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Data::Dumper;
use Net::DNS;
use Net::ARP;
+
use DateTime;
+use Exporter;
our @ISA = qw(Exporter);
index d1583017cd59d9fd774238b4f8154b26a7f873c4..bf4ac091b12ef38025b4a79eb89017d5567254b1 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use Data::Dumper;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = ("Exporter");
index 9b0d828b58f703c8d5fc269f22f0df485d5d64c7..c920d413dda8ba1ac60923a9bb659a7ac42842a6 100644 (file)
use strict;
use warnings;
+use GOsaSI::GOsaSupportDaemon;
+
use Exporter;
-use GosaSupportDaemon;
our @ISA = ("Exporter");
diff --git a/gosa-si/server.conf b/gosa-si/server.conf
index b8da241247ff7dda28ccae7f05df2fdb6c29bc2e..554ac444c98a5f6a501c7784e2dbd4cb628c525b 100644 (file)
--- a/gosa-si/server.conf
+++ b/gosa-si/server.conf
[General]
-log-file = /var/log/gosa-si-server.log
-pid-file = /var/run/gosa-si-server.pid
+log-file = /var/log/gosa-si/gosa-si-server.log
+pid-file = /var/run/gosa-si/gosa-si-server.pid
[Server]
max-clients = 100
index a4159808ed670a2a481753d9ec8903ae6bdd73c6..a0b923fddeed66a9d83c9e5c9d23a638a4d7b531 100644 (file)
--- a/gosa-si/server.conf.pod
+++ b/gosa-si/server.conf.pod
@@ -262,7 +262,7 @@ Please report any bugs, or post any suggestions, to the GOsa mailing list <gosa-
This code is part of GOsa (L<http://www.gosa-project.org>)
-Copyright (C) 2003-2009 GONICUS GmbH
+Copyright (C) 2003-2010 GONICUS GmbH
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
index 3492e4194e1c76a0e7141ef0385326acd43a8e60..89ab1f78581cd9f20443b01a8173aefde1b78bdc 100644 (file)
use strict;
use warnings;
-use Exporter;
use Data::Dumper;
-use GOSA::GosaSupportDaemon;
use MIME::Base64;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
index 9a6a89880245ba48ddb1ca75552dcafe9b925c0e..796e97f3de3dbc1f86e40a44e2af8cea5637199b 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use Data::Dumper;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
### Start ######################################################################
-#&main::read_configfile($main::cfg_file, %cfg_defaults);
-
sub get_events {
return \@events;
}
index 4eb74cee3fc5b0b7c494e831c9919cf898801e1b..f014ad12421b2864800558f580394c5ad8a1de52 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use Crypt::SmbHash;
use Net::ARP;
use Net::Ping;
-use Socket;
use Time::HiRes qw( usleep);
use MIME::Base64;
use Data::Dumper;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
+use Socket;
our @ISA = qw(Exporter);
index c5b9976e292b20dca079e31992ec69f5b0cf273d..23c60b322968a125698f4e14660211a2e155775e 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use Data::Dumper;
use File::Spec;
use MIME::Base64;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
index 0107493facd04b3cacdf8bde2835ace521ac60ea..63d8d0c938fef155b0a0dcf62989de37c84e7a37 100644 (file)
use strict;
use warnings;
-use Exporter;
-use GOSA::GosaSupportDaemon;
use Data::Dumper;
use Time::HiRes qw( usleep);
use MIME::Base64;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
our @ISA = qw(Exporter);
index c6fee306ac2a0b02d626b75da569738457fd5b31..2c3698147588087b7f8591dac1707a0650dcbe41 100644 (file)
use strict;
use warnings;
-use Exporter;
-use UNIVERSAL 'isa';
-use GOSA::GosaSupportDaemon;
use Data::Dumper;
use XML::Quote qw(:all);
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
+use UNIVERSAL 'isa';
our @ISA = qw(Exporter);
"password" => [\$opsi_password, "secret"],
},
);
+
&read_configfile($main::cfg_file, %cfg_defaults);
+
if ($opsi_enabled eq "true") {
use JSON::RPC::Client;
use XML::Quote qw(:all);
diff --git a/gosa-si/server/events/server_server_com.pm b/gosa-si/server/events/server_server_com.pm
index 98f11a5675ec325034860c88aaf62f1396de9123..5fbc4cc0654827754f1817bf36409758277c9e42 100644 (file)
use strict;
use warnings;
-use Exporter;
use Data::Dumper;
-use GOSA::GosaSupportDaemon;
use Time::HiRes qw( usleep);
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
use Socket;
our @ISA = qw(Exporter);
index f190e15fee6f580d6f3f12b3cf0d184a36562bcb..810bd0209731114d7a6cd3067fc60b68ada96d4d 100644 (file)
use strict;
use warnings;
-use Exporter;
use Data::Dumper;
-use GOSA::GosaSupportDaemon;
+use GOsaSI::GosaSupportDaemon;
+
+use Exporter;
use Socket;
our @ISA = qw(Exporter);
my $mesg;
my %cfg_defaults = (
- "server" => {
+ "Server" => {
"ldap-uri" => [\$ldap_uri, ""],
"ldap-base" => [\$ldap_base, ""],
"ldap-admin-dn" => [\$ldap_admin_dn, ""],
"ldap-admin-password" => [\$ldap_admin_password, ""],
},
);
+# why not using it from main::read_configfile
&GOSA::GosaSupportDaemon::read_configfile($main::cfg_file, %cfg_defaults);