diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 96119e943ff71a550ea8fca0c0f8867db0310bf9..d1d62dff398c670b322f2f8c859db2338eb917a7 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
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);
# 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);
}
@logged_in_user_list = split(/\s/, $result);
}
- system("echo 'CURRENTLY_LOGGED_IN ".join(" ", @logged_in_user_list)."' > /var/run/gosa-si-client.socket");
+ system("echo 'CURRENTLY_LOGGED_IN ".join(" ", @logged_in_user_list)."' > /var/run/gosa-si/gosa-si-client.socket");
$kernel->delay_set('trigger_logged_in_users_report', $trigger_logged_in_users_report_delay);
} else {
# try it in 10 sec again
}
# 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,
});
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
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,
}
);