From f4b42c2d143c0f4a43b0f6272a22ba83b7ba87fa Mon Sep 17 00:00:00 2001 From: opensides Date: Mon, 17 May 2010 16:51:34 +0000 Subject: [PATCH] - Put a init script in gosa-si-server and gosa-si-client (client and server no activated by default right now) - Put default file for client and server - Refresh Copyright - Remove kill from logrotate because it stop and never restart the server ! - cleaning code git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18521 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/debian/copyright | 4 +- gosa-si/debian/gosa-si-client.default | 4 ++ gosa-si/debian/gosa-si-client.init | 87 ++++++++++++++++++++++++ gosa-si/debian/gosa-si-client.logrotate | 1 - gosa-si/debian/gosa-si-client.postinst | 6 +- gosa-si/debian/gosa-si-common.dirs | 1 - gosa-si/debian/gosa-si-common.install | 2 +- gosa-si/debian/gosa-si-common.postinst | 7 +- gosa-si/debian/gosa-si-server.default | 4 ++ gosa-si/debian/gosa-si-server.init | 86 ++++++++++++++++++++++++ gosa-si/debian/gosa-si-server.install | 28 ++++---- gosa-si/debian/gosa-si-server.logrotate | 1 - gosa-si/debian/gosa-si-server.postinst | 6 +- gosa-si/debian/rules | 4 +- gosa-si/gosa-si-client | 38 +++++------ gosa-si/gosa-si-server | 88 ++++++++++++++----------- 16 files changed, 281 insertions(+), 86 deletions(-) create mode 100644 gosa-si/debian/gosa-si-client.default create mode 100644 gosa-si/debian/gosa-si-client.init create mode 100644 gosa-si/debian/gosa-si-server.default create mode 100644 gosa-si/debian/gosa-si-server.init diff --git a/gosa-si/debian/copyright b/gosa-si/debian/copyright index eec49e49a..a6b5666bf 100644 --- a/gosa-si/debian/copyright +++ b/gosa-si/debian/copyright @@ -5,7 +5,7 @@ It was downloaded from http://www.gosa-project.org Copyright: - Copyright (C) 2001-2009 Cajus Pollmeier + Copyright (C) 2001-2010 Cajus Pollmeier License: @@ -26,6 +26,6 @@ License: On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. -The Debian packaging is (C) Copyright 2008, Cajus Pollmeier and +The Debian packaging is (C) Copyright 2001-2010, Cajus Pollmeier and is licensed under the GPL, see above. diff --git a/gosa-si/debian/gosa-si-client.default b/gosa-si/debian/gosa-si-client.default new file mode 100644 index 000000000..b16721850 --- /dev/null +++ b/gosa-si/debian/gosa-si-client.default @@ -0,0 +1,4 @@ +# Should we start the client +START_CLIENT=1 +# Level of debugging for the client +DEBUG=-vvvvvvv diff --git a/gosa-si/debian/gosa-si-client.init b/gosa-si/debian/gosa-si-client.init new file mode 100644 index 000000000..7282850c5 --- /dev/null +++ b/gosa-si/debian/gosa-si-client.init @@ -0,0 +1,87 @@ +#!/bin/sh +# Start/stop the GOsa support daemon infrastructure. +# +### BEGIN INIT INFO +# Provides: gosa-si-client +# Required-Start: $network $remote_fs $named $syslog $time +# Required-Stop: $network $remote_fs $named $syslog $time +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: GOsa message server/client component +# Description: gosa-si establishes the communication between a couple of +# GOsa hosting servers and optionally clients to do event +# signaling for all communication partners. +### END INIT INFO + +# variables for the gosa-si client. +CLIENT="gosa-si-client" +DAEMON_CLIENT="/usr/sbin/${CLIENT}" +RUN_DIRECTORY="/var/run/gosa-si" +PIDFILE_CLIENT="$RUN_DIRECTORY/${CLIENT}.pid" + +PATH="/sbin:/usr/sbin:/bin:/usr/bin" + +# Load defaults +[ -r /etc/default/gosa-si-client ] && . /etc/default/gosa-si-client + +# Load LSB support functions +. /lib/lsb/init-functions + +if [ ! -d "/var/run/gosa-si" ]; then + mkdir $RUN_DIRECTORY +fi + +start_client() { + start-stop-daemon --start --quiet --pidfile ${PIDFILE_CLIENT} --name ${CLIENT} --startas ${DAEMON_CLIENT} -- $DEBUG +} + +# to be rewritten ugly !! +stop_client() { + start-stop-daemon --stop --retry 5 --quiet --pidfile ${PIDFILE_CLIENT} --name ${CLIENT} + kill `ps -C gosa-si-client -o pid=` > /dev/null 2>&1 + ! ps -C gosa-si-client -o pid= > /dev/null 2>&1 +} + +case "$1" in +start) log_daemon_msg "Starting GOsa support infrastructure client" + if [ "$START_CLIENT" = "1" -a -x ${DAEMON_CLIENT} ]; then + log_progress_msg "client" + start_client + fi + log_end_msg $? + ;; +stop) log_daemon_msg "Stopping GOsa support infrastructure Client" + if [ "$START_CLIENT" = "1" -a -x ${DAEMON_CLIENT} ]; then + log_progress_msg "client" + stop_client + fi + log_end_msg $? + ;; +reload|force-reload|restart) log_daemon_msg "Restarting GOsa support infrastructure client" + if [ "$START_CLIENT" = "1" -a -x ${DAEMON_CLIENT} ]; then + stop_client + start_client + fi + log_progress_msg "done" + log_end_msg $? + ;; +status) + if [ "$START_CLIENT" = "1" -a -x ${DAEMON_CLIENT} ]; then + status=0 + pidofproc -p "${PIDFILE_CLIENT}" "${DAEMON_CLIENT}" >/dev/null || status="$?" + log_daemon_msg "Status of GOsa-si client" "${NAME}" + if [ "$status" = 0 ]; then + log_progress_msg "is running" + log_end_msg 0 + else + log_progress_msg "is not running" + log_end_msg $status + fi + fi + ;; + +*) log_action_msg "Usage: /etc/init.d/gosa-si-client {start|stop|restart||reload|force-reload|status}" + exit 2 + ;; +esac +exit 0 diff --git a/gosa-si/debian/gosa-si-client.logrotate b/gosa-si/debian/gosa-si-client.logrotate index 7e9fd81e3..2a5a417ca 100644 --- a/gosa-si/debian/gosa-si-client.logrotate +++ b/gosa-si/debian/gosa-si-client.logrotate @@ -4,7 +4,6 @@ compress missingok postrotate - pkill -SIGUSR1 gosa-si-client > /dev/null || true endscript } diff --git a/gosa-si/debian/gosa-si-client.postinst b/gosa-si/debian/gosa-si-client.postinst index cafe8c1cb..917f50c18 100644 --- a/gosa-si/debian/gosa-si-client.postinst +++ b/gosa-si/debian/gosa-si-client.postinst @@ -11,13 +11,13 @@ case "$1" in *) exit 0; esac -[ ! -d /usr/lib/gosa-si/client/events ] && install -d -o root -g root -m 750 /usr/lib/gosa-si/client/events +#[ ! -d /usr/lib/gosa-si/client/events ] && install -d -o root -g root -m 750 /usr/lib/gosa-si/client/events # Fix permission -[ -f /etc/gosa-si/client.conf ] && chmod go-rwx /etc/gosa-si/client.conf +#[ -f /etc/gosa-si/client.conf ] && chmod go-rwx /etc/gosa-si/client.conf # Restart daemon -invoke-rc.d gosa-si restart +#invoke-rc.d gosa-si-client start exit 0 diff --git a/gosa-si/debian/gosa-si-common.dirs b/gosa-si/debian/gosa-si-common.dirs index fd3811b59..b154e52a8 100644 --- a/gosa-si/debian/gosa-si-common.dirs +++ b/gosa-si/debian/gosa-si-common.dirs @@ -1,3 +1,2 @@ -/etc/default /usr/share/perl5/GOsaSI /var/log/gosa-si diff --git a/gosa-si/debian/gosa-si-common.install b/gosa-si/debian/gosa-si-common.install index 1e14d1848..49815e703 100644 --- a/gosa-si/debian/gosa-si-common.install +++ b/gosa-si/debian/gosa-si-common.install @@ -1,3 +1,3 @@ modules/GosaSupportDaemon.pm usr/share/perl5/GOsaSI modules/DBsqlite.pm usr/share/perl5/GOsaSI -modules/ArpWatch.pm usr/share/perl5/POE/Component +modules/ArpWatch.pm usr/share/perl5/POE/Component diff --git a/gosa-si/debian/gosa-si-common.postinst b/gosa-si/debian/gosa-si-common.postinst index ef7bfbbd0..cc4606610 100644 --- a/gosa-si/debian/gosa-si-common.postinst +++ b/gosa-si/debian/gosa-si-common.postinst @@ -11,5 +11,10 @@ case "$1" in *) exit 0; esac -[ -d /var/lib/gosa-si ] || install -d -o root -g root -m 750 /var/lib/gosa-si +# create missing /var/lib/gosa-si +[ ! -d /var/lib/gosa-si/ ] && mkdir /var/lib/gosa-si +# start daemon +#invoke-rc.d gosa-si-server start + +exit 0 diff --git a/gosa-si/debian/gosa-si-server.default b/gosa-si/debian/gosa-si-server.default new file mode 100644 index 000000000..6929d6d9e --- /dev/null +++ b/gosa-si/debian/gosa-si-server.default @@ -0,0 +1,4 @@ +# Configure Debuging Level +DEBUG=-vvvvvvv +# Debug parts of GOsa-si server see man gosa-si-server +#DEBUGPARTS= \ No newline at end of file diff --git a/gosa-si/debian/gosa-si-server.init b/gosa-si/debian/gosa-si-server.init new file mode 100644 index 000000000..4b77e3af5 --- /dev/null +++ b/gosa-si/debian/gosa-si-server.init @@ -0,0 +1,86 @@ +#!/bin/sh +# Start/stop the GOsa support daemon infrastructure. +# +### BEGIN INIT INFO +# Provides: gosa-si-server +# Required-Start: $network $remote_fs $named $syslog $time +# Required-Stop: $network $remote_fs $named $syslog $time +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: GOsa message server component +# Description: gosa-si-server establishes the communication between a couple of +# GOsa hosting servers and optionally clients to do event +# signaling for all communication partners. +### END INIT INFO + +# variables for the gosa-si-server. +SERVER="gosa-si-server" +DAEMON_SERVER="/usr/sbin/${SERVER}" +RUN_DIRECTORY="/var/run/gosa-si" +PIDFILE_SERVER="$RUN_DIRECTORY/${SERVER}.pid" + +PATH="/sbin:/usr/sbin:/bin:/usr/bin" + +# Load defaults +[ -r /etc/default/gosa-si-server ] && . /etc/default/gosa-si-server + +# Load LSB support functions +. /lib/lsb/init-functions + +if [ ! -d "/var/run/gosa-si" ]; then + mkdir $RUN_DIRECTORY +fi + +start_server() { + start-stop-daemon --start --quiet --pidfile ${PIDFILE_SERVER} --name ${SERVER} --startas ${DAEMON_SERVER} -- $DEBUG +} + +# to be changed ugly +stop_server() { + start-stop-daemon --stop --retry 5 --quiet --pidfile ${PIDFILE_SERVER} --name ${SERVER} + kill `ps -C gosa-si-server -o pid=` > /dev/null 2>&1 + ! ps -C gosa-si-server -o pid= > /dev/null 2>&1 +} + + +case "$1" in + start) log_daemon_msg "Starting GOsa support infrastructure Server" + if [ -x ${DAEMON_SERVER} ]; then + log_progress_msg "daemon" + start_server + fi + log_end_msg $? + ;; +stop) log_daemon_msg "Stopping GOsa support infrastructure Server" + if [ -x ${DAEMON_SERVER} ]; then + log_progress_msg "daemon" + stop_server + fi + log_end_msg $? +;; +reload|force-reload|restart) log_daemon_msg "Restarting GOsa support infrastructure Server" + if [ -x ${DAEMON_SERVER} ]; then + stop_server + start_server + fi + log_progress_msg "done" + log_end_msg $? +;; +status) + status=0 + pidofproc -p "${PIDFILE_SERVER}" "${DAEMON_SERVER}" >/dev/null || status="$?" + log_daemon_msg "Status of GOsa-si server" "${NAME}" + if [ "$status" = 0 ]; then + log_progress_msg "is running" + log_end_msg 0 + else + log_progress_msg "is not running" + log_end_msg $status + fi +;; + +*) log_action_msg "Usage: /etc/init.d/gosa-si {start|stop|restart|reload|force-reload|status}" + exit 2 + ;; +esac +exit 0 diff --git a/gosa-si/debian/gosa-si-server.install b/gosa-si/debian/gosa-si-server.install index 99882e7ad..ce2ed768b 100644 --- a/gosa-si/debian/gosa-si-server.install +++ b/gosa-si/debian/gosa-si-server.install @@ -1,16 +1,16 @@ -gosa-si-server usr/sbin -server.conf etc/gosa-si -modules/ClientPackages.pm usr/lib/gosa-si/modules -modules/GosaPackages.pm usr/lib/gosa-si/modules -modules/ArpHandler.pm usr/lib/gosa-si/modules -modules/oui.txt usr/lib/gosa-si/modules -modules/ServerPackages.pm usr/lib/gosa-si/modules -server/events/gosaTriggered.pm usr/lib/gosa-si/server/GosaPackages -server/events/siTriggered.pm usr/lib/gosa-si/server/ClientPackages -server/events/clMessages.pm usr/lib/gosa-si/server/ClientPackages -server/events/databases.pm usr/lib/gosa-si/server/GosaPackages -server/events/databases.pm usr/lib/gosa-si/server/ServerPackages -server/events/logHandling.pm usr/lib/gosa-si/server/GosaPackages -server/events/logHandling.pm usr/lib/gosa-si/server/ServerPackages +gosa-si-server usr/sbin +server.conf etc/gosa-si +modules/ClientPackages.pm usr/lib/gosa-si/modules +modules/GosaPackages.pm usr/lib/gosa-si/modules +modules/ArpHandler.pm usr/lib/gosa-si/modules +modules/oui.txt usr/lib/gosa-si/modules +modules/ServerPackages.pm usr/lib/gosa-si/modules +server/events/gosaTriggered.pm usr/lib/gosa-si/server/GosaPackages +server/events/siTriggered.pm usr/lib/gosa-si/server/ClientPackages +server/events/clMessages.pm usr/lib/gosa-si/server/ClientPackages +server/events/databases.pm usr/lib/gosa-si/server/GosaPackages +server/events/databases.pm usr/lib/gosa-si/server/ServerPackages +server/events/logHandling.pm usr/lib/gosa-si/server/GosaPackages +server/events/logHandling.pm usr/lib/gosa-si/server/ServerPackages server/events/server_server_com.pm usr/lib/gosa-si/server/ServerPackages diff --git a/gosa-si/debian/gosa-si-server.logrotate b/gosa-si/debian/gosa-si-server.logrotate index c10f95e34..38441437e 100644 --- a/gosa-si/debian/gosa-si-server.logrotate +++ b/gosa-si/debian/gosa-si-server.logrotate @@ -4,7 +4,6 @@ compress missingok postrotate - pkill -SIGUSR1 gosa-si-server > /dev/null || true endscript } diff --git a/gosa-si/debian/gosa-si-server.postinst b/gosa-si/debian/gosa-si-server.postinst index c990f4ba4..147bd4064 100644 --- a/gosa-si/debian/gosa-si-server.postinst +++ b/gosa-si/debian/gosa-si-server.postinst @@ -12,9 +12,9 @@ case "$1" in esac # Fix permission -[ -f /etc/gosa-si/server.conf ] && chmod go-rwx /etc/gosa-si/server.conf +#[ -f /etc/gosa-si/server.conf ] && chmod go-rwx /etc/gosa-si/server.conf -# Restart daemon -invoke-rc.d gosa-si restart +# start daemon +#invoke-rc.d gosa-si-server start exit 0 diff --git a/gosa-si/debian/rules b/gosa-si/debian/rules index e62500e47..2ca32a07b 100755 --- a/gosa-si/debian/rules +++ b/gosa-si/debian/rules @@ -55,8 +55,8 @@ binary-indep: install dh_installchangelogs dh_installman dh_installlogrotate - dh_installinit --init-script=gosa-si -- start 00 2 3 4 5 . stop 29 1 . - +# dh_installinit --init-script=gosa-si -- start 00 2 3 4 5 . stop 29 1 . + dh_installinit -n chmod 640 debian/gosa-si-server/etc/gosa-si/server.conf debian/gosa-si-client/etc/gosa-si/client.conf dh_link diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 96119e943..1b3a2a6a5 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -345,10 +345,11 @@ sub check_pid { unlink( $pid_file ); } + my $LOCK_FILE2; # create a syslog msg if it is not to possible to open PID file if (not sysopen(LOCK_FILE, $pid_file, O_WRONLY|O_CREAT|O_EXCL, 0644)) { my($msg) = "Couldn't obtain lockfile '$pid_file' "; - if (open(my $LOCK_FILE2, '<', $pid_file) + if (open($LOCK_FILE2, '<', "$pid_file") && ($pid = <$LOCK_FILE2>)) { chomp($pid); @@ -381,7 +382,7 @@ sub sig_int_handler { # system("kill `ps -C gosa-si-server -o pid=`"); $global_kernel->yield('shutdown'); - $pid->remove or warn "Could not remove $pidfile\n"; + $pid->remove or warn "Could not remove $pid_file\n"; exit(0); } @@ -1399,14 +1400,13 @@ if( defined $dump_config ) { } # read and set config parameters -#&check_cmdline_param ; &read_configfile($config, %cfg_defaults); #&check_pid; # Create the PID object # Ensure you put a name that won't clobber # another program's PID file -my $pid = File::Pid->new({ +$pid = File::Pid->new({ file => $pid_file, }); @@ -1464,7 +1464,7 @@ 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); -# delete old DBsqlite lock files +# to be changed maybe not trace of it when running system('rm -f /tmp/gosa_si_lock*gosa-si-client*'); # detect ip and mac address and complete host address @@ -1523,26 +1523,26 @@ if ($system_com eq "enabled") POE::Session->create( inline_states => { - _start => \&_start, - _default => \&_default, - sig_handler => \&sig_handler, - register_at_gosa_si_server => \®ister_at_gosa_si_server, + _start => \&_start, + _default => \&_default, + sig_handler => \&sig_handler, + register_at_gosa_si_server => \®ister_at_gosa_si_server, - # trigger periodical tasks - trigger_new_key => \&trigger_new_key, - trigger_logged_in_users_report => \&trigger_logged_in_users_report, - trigger_seen_messages => \&trigger_seen_messages, + # trigger periodical tasks + trigger_new_key => \&trigger_new_key, + trigger_logged_in_users_report => \&trigger_logged_in_users_report, + trigger_seen_messages => \&trigger_seen_messages, # trigger non periodical tasks trigger_set_terminal_server => \&trigger_set_terminal_server, - - # handle records from each defined file differently - fai_fifo_record => \&fai_fifo_got_record, + + # handle records from each defined file differently + fai_fifo_record => \&fai_fifo_got_record, system_fifo_record => \&system_fifo_got_record, - # handle file resets and errors the same way for each file - file_reset => \&generic_file_reset, - file_error => \&generic_file_error, + # handle file resets and errors the same way for each file + file_reset => \&generic_file_reset, + file_error => \&generic_file_error, } ); diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 3f369825d..b822c4b65 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -315,7 +315,7 @@ our $check_periodic = {"months"=>'', "weeks"=>'', "days"=>'', "hours"=>'', "minu "messaging" => [\$messaging_file_name, '/var/lib/gosa-si/messaging.db'], "foreign-clients" => [\$foreign_clients_file_name, '/var/lib/gosa-si/foreign_clients.db'], "source-list" => [\$sources_list, '/etc/apt/sources.list'], - "repo-path" => [\$repo_path, '/srv/www'], + "repo-path" => [\$repo_path, '/srv/www/debian'], "debian-arch" => [\$arch, 'i386'], "ldap-uri" => [\$ldap_uri, ""], "ldap-base" => [\$ldap_base, ""], @@ -3644,8 +3644,6 @@ if( defined $dump_config ) { } # read and set config parameters -#&check_cmdline_param ; -#&read_configfile($cfg_file, %cfg_defaults); &read_configfile($config, %cfg_defaults); #&check_pid; @@ -3653,8 +3651,7 @@ if( defined $dump_config ) { $SIG{CHLD} = 'IGNORE'; # Create the PID object -# Ensure you put a name that won't clobber -# another program's PID file +# $pid = File::Pid->new({ file => $pid_file, }); @@ -3707,7 +3704,19 @@ open(my $FH, ">>", "$log_file"); close($FH); chmod(0440, $log_file); chown($root_uid, $adm_gid, $log_file); -chown($root_uid, $adm_gid, "/var/lib/gosa-si"); + +# prepare directory for databases +mkpath('/var/lib/gosa-si', 0, {owner=>'root', group=>'root'}); + +# remove leftover files in tmp for packaged.db populate +rmtree( '/tmp/packages_list_db',0,1); + +# remove list of sources from apt.sources.list +unlink '/tmp/gosa_si_tmp_sources_list'; + +# remove marker that the list creation is in progress +unlink '/tmp/packages_list_creation_in_progress'; + daemon_log(" ", 1); daemon_log("$0 started!", 1); @@ -3718,10 +3727,10 @@ daemon_log($server_status_hash->{$server_status}.": $server_revision", 1); { no strict "refs"; - if ($db_module eq "DBmysql") { - - daemon_log("0 INFO: importing database module '$db_module'", 1); + daemon_log("0 INFO: importing database module '$db_module'", 1); + if ($db_module eq "DBmysql") { + # connect to incoming_db $incoming_db = ("GOsaSI::".$db_module)->new($main::mysql_database, $main::mysql_host, $main::mysql_username, $main::mysql_password); @@ -3754,66 +3763,69 @@ daemon_log($server_status_hash->{$server_status}.": $server_revision", 1); } elsif ($db_module eq "DBsqlite") { - daemon_log("0 INFO: importing database module '$db_module'", 1); + daemon_log("0 INFO: Removing SQLlite lock files", 1); + # delete old DBsqlite lock files + system('rm -f /var/lib/gosa-si/*.si_lock*'); + # connect to incoming_db unlink($incoming_file_name); $incoming_db = ("GOsaSI::".$db_module)->new($incoming_file_name); - chmod(0640, $incoming_file_name); - chown($root_uid, $adm_gid, $incoming_file_name); + #chmod(0640, $incoming_file_name); + #chown($root_uid, $adm_gid, $incoming_file_name); # connect to gosa-si job queue $job_db = ("GOsaSI::".$db_module)->new($job_queue_file_name); - chmod(0640, $job_queue_file_name); - chown($root_uid, $adm_gid, $job_queue_file_name); + #chmod(0640, $job_queue_file_name); + #chown($root_uid, $adm_gid, $job_queue_file_name); # connect to known_clients_db #unlink($known_clients_file_name); $known_clients_db = ("GOsaSI::".$db_module)->new($known_clients_file_name); - chmod(0640, $known_clients_file_name); - chown($root_uid, $adm_gid, $known_clients_file_name); + #chmod(0640, $known_clients_file_name); + #chown($root_uid, $adm_gid, $known_clients_file_name); # connect to foreign_clients_db #unlink($foreign_clients_file_name); $foreign_clients_db = ("GOsaSI::".$db_module)->new($foreign_clients_file_name); - chmod(0640, $foreign_clients_file_name); - chown($root_uid, $adm_gid, $foreign_clients_file_name); + #chmod(0640, $foreign_clients_file_name); + #chown($root_uid, $adm_gid, $foreign_clients_file_name); # connect to known_server_db - unlink($known_server_file_name); # do not delete, gosa-si-server should be forced to check config file and dns at each start + #unlink($known_server_file_name); # do not delete, gosa-si-server should be forced to check config file and dns at each start $known_server_db = ("GOsaSI::".$db_module)->new($known_server_file_name); - chmod(0640, $known_server_file_name); - chown($root_uid, $adm_gid, $known_server_file_name); + #chmod(0640, $known_server_file_name); + #chown($root_uid, $adm_gid, $known_server_file_name); # connect to login_usr_db #unlink($login_users_file_name); $login_users_db = ("GOsaSI::".$db_module)->new($login_users_file_name); - chmod(0640, $login_users_file_name); - chown($root_uid, $adm_gid, $login_users_file_name); + #chmod(0640, $login_users_file_name); + #chown($root_uid, $adm_gid, $login_users_file_name); # connect to fai_server_db - unlink($fai_server_file_name); + #unlink($fai_server_file_name); $fai_server_db = ("GOsaSI::".$db_module)->new($fai_server_file_name); - chmod(0640, $fai_server_file_name); - chown($root_uid, $adm_gid, $fai_server_file_name); + #chmod(0640, $fai_server_file_name); + #chown($root_uid, $adm_gid, $fai_server_file_name); # connect to fai_release_db - unlink($fai_release_file_name); + #unlink($fai_release_file_name); $fai_release_db = ("GOsaSI::".$db_module)->new($fai_release_file_name); - chmod(0640, $fai_release_file_name); - chown($root_uid, $adm_gid, $fai_release_file_name); + #chmod(0640, $fai_release_file_name); + #chown($root_uid, $adm_gid, $fai_release_file_name); # connect to packages_list_db - unlink($packages_list_under_construction); + #unlink($packages_list_under_construction); $packages_list_db = ("GOsaSI::".$db_module)->new($packages_list_file_name); - chmod(0640, $packages_list_file_name); - chown($root_uid, $adm_gid, $packages_list_file_name); + #chmod(0640, $packages_list_file_name); + #chown($root_uid, $adm_gid, $packages_list_file_name); # connect to messaging_db #unlink($messaging_file_name); $messaging_db = ("GOsaSI::".$db_module)->new($messaging_file_name); - chmod(0640, $messaging_file_name); - chown($root_uid, $adm_gid, $messaging_file_name); + #chmod(0640, $messaging_file_name); + #chown($root_uid, $adm_gid, $messaging_file_name); } } @@ -3904,9 +3916,9 @@ daemon_log("0 INFO: start socket for incoming xml messages at port '$server_port # create session for repeatedly checking the job queue for jobs POE::Session->create( inline_states => { - _start => \&session_start, + _start => \&session_start, register_at_foreign_servers => \®ister_at_foreign_servers, - control_server_registration => \&control_server_registration, + control_server_registration => \&control_server_registration, sig_handler => \&sig_handler, next_task => \&next_task, task_result => \&handle_task_result, @@ -3915,7 +3927,7 @@ POE::Session->create( watch_for_new_messages => \&watch_for_new_messages, watch_for_delivery_messages => \&watch_for_delivery_messages, watch_for_done_messages => \&watch_for_done_messages, - watch_for_new_jobs => \&watch_for_new_jobs, + watch_for_new_jobs => \&watch_for_new_jobs, watch_for_modified_jobs => \&watch_for_modified_jobs, watch_for_done_jobs => \&watch_for_done_jobs, watch_for_opsi_jobs => \&watch_for_opsi_jobs, @@ -3923,7 +3935,7 @@ POE::Session->create( create_packages_list_db => \&run_create_packages_list_db, create_fai_server_db => \&run_create_fai_server_db, create_fai_release_db => \&run_create_fai_release_db, - recreate_packages_db => \&run_recreate_packages_db, + recreate_packages_db => \&run_recreate_packages_db, session_run_result => \&session_run_result, session_run_debug => \&session_run_debug, session_run_done => \&session_run_done, -- 2.30.2