This file is indexed.

/usr/sbin/argonaut-client is in argonaut-client 1.0-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/perl

#######################################################################
#
# argonaut-client-management - standalone binary
#
# Copyright (C) 2011-2016 FusionDirectory project
#
# Author: Côme BERNIGAUD
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
#
#######################################################################

use strict;
use warnings;

use 5.008;

use Argonaut::Libraries::Common qw(:ldap :config :file);

use if (USE_LEGACY_JSON_RPC),     'JSON::RPC::Legacy::Server::Daemon';
use if not (USE_LEGACY_JSON_RPC), 'JSON::RPC::Server::Daemon';
use Log::Handler;
use App::Daemon qw(daemonize);

# where to look for modules files
use Module::Pluggable search_path => 'Argonaut::ClientDaemon::Modules', sub_name => 'modules';

our ($config, $client_settings, $server_settings);
my $logfile     = "argonaut-client.log";
my $piddir      = "/var/run/argonaut";
my $pidfile     = "argonaut-client.pid";

$SIG{TERM}=\&sig_term_handler;

$SIG{INT}=\&sig_int_handler;

readConfig();

argonaut_create_dir($client_settings->{'logdir'});

our $log = Log::Handler->create_logger("argonaut-client-management");

$log->add(
  file => {
    filename => $client_settings->{'logdir'}."/$logfile",
    maxlevel => "debug",
    minlevel => "emergency",
    newline  => 1,
  }
);

argonaut_create_dir($piddir);
$App::Daemon::pidfile = "$piddir/$pidfile";
$App::Daemon::logfile = $client_settings->{'logdir'}."/$logfile";
$App::Daemon::as_user = "root";

daemonize();

my $serverClass;
if (USE_LEGACY_JSON_RPC) {
  $serverClass = "JSON::RPC::Legacy::Server::Daemon";
} else {
  $serverClass = "JSON::RPC::Server::Daemon";
}
my $server = $serverClass->new(
  LocalPort => $client_settings->{'port'},
  ($client_settings->{'protocol'} eq 'https') ? (SSL_server    => 1,
                                                  SSL_key_file  => $client_settings->{'keyfile'},
                                                  SSL_cert_file => $client_settings->{'certfile'},
                                                  SSL_ca_file   => $client_settings->{'cacertfile'},
                                                )
                                               : ());

$log->notice("argonaut-client-management started on port ".$client_settings->{'port'});

$server->version(0);
$server->return_die_message(1);

my $modules = import_modules();

$server->dispatch_to($modules)->handle();


sub readConfig {
  $config = argonaut_read_config;

  $server_settings = argonaut_get_server_settings($config,$config->{'server_ip'});
  $client_settings = argonaut_get_client_settings($config,$config->{'client_ip'});
}


sub import_modules {
  foreach my $module (modules()) {
    $log->notice("Loaded module $module");
  }
  return ['Argonaut::ClientDaemon',modules()];
}


sub sig_int_handler {
  $log->notice("argonaut-client-management on port ".$client_settings->{'port'}." terminated by sigint");
  exit(0);
}


sub sig_term_handler {
  $log->notice("argonaut-client-management on port ".$client_settings->{'port'}." terminated by sigterm");
  exit(0);
}


__END__

=head1 NAME

argonaut-client - running actions given by the argonaut server

=head1 SYNOPSIS

argonaut-client

=head1 DESCRIPTION

argonaut-client is getting actions from argonaut server and run them. It is modular
and can load various modules at run time.

=head1 BUGS

Please report any bugs, or post any suggestions, to the fusiondirectory mailing list fusiondirectory-users or to
<https://forge.fusiondirectory.org/projects/argonaut-agents/issues/new>

=head1 LICENCE AND COPYRIGHT

This code is part of Argonaut Project <https://www.argonaut-project.org>

=over 1

=item Copyright (C) 2011-2016 FusionDirectory project

=back

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

=cut