irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_server_control_plane.cpp
Go to the documentation of this file.
1 #include "avro/Encoder.hh"
2 #include "avro/Decoder.hh"
3 #include "avro/Specific.hh"
4 
5 #include "stdio.h"
6 
7 //#include <readproc.h>
8 //#include <sysinfo.h>
9 
10 #include "genQuery.h"
11 #include "rcMisc.h"
12 #include "sockComm.h"
13 #include "miscServerFunct.hpp"
14 #include "rodsServer.hpp"
15 
16 #include "irods_log.hpp"
21 #include "irods_server_state.hpp"
22 #include "irods_exception.hpp"
23 #include "irods_stacktrace.hpp"
24 
25 #include "boost/lexical_cast.hpp"
26 
27 #include "json.hpp"
28 
29 #include <ctime>
30 #include <unistd.h>
31 
32 namespace irods {
33  static void ctrl_plane_sleep(
34  int _s,
35  int _ms ) {
36  useconds_t us = ( _s * 1000000 ) + ( _ms * 1000 );
37  usleep( us );
38  }
39 
41  const std::string& _name,
42  const std::string& _host,
43  const std::string& _port_keyword,
44  std::string& _output ) {
45  if ( EMPTY_RESC_HOST == _host ) {
46  return SUCCESS();
47 
48  }
49 
50  int time_out, port, num_hash_rounds;
51  boost::optional<const std::string&> encryption_algorithm;
52  buffer_crypt::array_t shared_secret;
53  try {
54  time_out = get_server_property<const int>(CFG_SERVER_CONTROL_PLANE_TIMEOUT);
55  port = get_server_property<const int>(_port_keyword);
56  num_hash_rounds = get_server_property<const int>(CFG_SERVER_CONTROL_PLANE_ENCRYPTION_NUM_HASH_ROUNDS_KW);
57  encryption_algorithm.reset(get_server_property<const std::string>(CFG_SERVER_CONTROL_PLANE_ENCRYPTION_ALGORITHM_KW));
58  const auto& key = get_server_property<const std::string>(CFG_SERVER_CONTROL_PLANE_KEY);
59  shared_secret.assign(key.begin(), key.end());
60  } catch ( const irods::exception& e ) {
61  return irods::error(e);
62  }
63 
64  // stringify the port
65  std::stringstream port_sstr;
66  port_sstr << port;
67  // standard zmq rep-req communication pattern
68  zmq::context_t zmq_ctx( 1 );
69  zmq::socket_t zmq_skt( zmq_ctx, ZMQ_REQ );
70  zmq_skt.setsockopt( ZMQ_RCVTIMEO, &time_out, sizeof( time_out ) );
71  zmq_skt.setsockopt( ZMQ_SNDTIMEO, &time_out, sizeof( time_out ) );
72  zmq_skt.setsockopt( ZMQ_LINGER, 0 );
73 
74  // this is the client so we connect rather than bind
75  std::string conn_str( "tcp://" );
76  conn_str += _host;
77  conn_str += ":";
78  conn_str += port_sstr.str();
79 
80  try {
81  zmq_skt.connect( conn_str.c_str() );
82  }
83  catch ( zmq::error_t& e_ ) {
84  _output += "{\n \"failed_to_connect\" : \"" + conn_str + "\"\n},\n";
85  return ERROR(
87  _output );
88  }
89 
90 
91  // build the command to forward
92  control_plane_command cmd;
93  cmd.command = _name;
95  cmd.options[ SERVER_CONTROL_HOST_KW ] = _host;
96 
97  // serialize using the generated avro class
98  auto out = avro::memoryOutputStream();
99  avro::EncoderPtr e = avro::binaryEncoder();
100  e->init( *out );
101  avro::encode( *e, cmd );
102  std::shared_ptr<std::vector<uint8_t>> data = avro::snapshot(*out);
103 
104  buffer_crypt crypt(
105  shared_secret.size(), // key size
106  0, // salt size ( we dont send a salt )
107  num_hash_rounds, // num hash rounds
108  encryption_algorithm->c_str() );
109 
111  buffer_crypt::array_t data_to_send;
112  buffer_crypt::array_t data_to_encrypt(
113  data->data(),
114  data->data() + data->size() );
115  irods::error ret = crypt.encrypt(
116  shared_secret,
117  iv,
118  data_to_encrypt,
119  data_to_send );
120  if ( !ret.ok() ) {
121  return PASS( ret );
122 
123  }
124 
125  // copy binary encoding into a zmq message for transport
126  zmq::message_t rep( data_to_send.size() );
127  memcpy(
128  rep.data(),
129  data_to_send.data(),
130  data_to_send.size() );
131  zmq_skt.send( rep );
132 
133  // wait for the server response
134  zmq::message_t req;
135  zmq_skt.recv( &req );
136 
137  if ( 0 == req.size() ) {
138  _output += "{\n \"response_message_is_empty_from\" : \"" + conn_str + "\"\n},\n";
139  return ERROR(
141  "empty response string" );
142 
143  }
144 
145  // decrypt the message before passing to avro
146  buffer_crypt::array_t data_to_process;
147  const uint8_t* data_ptr = static_cast< const uint8_t* >( req.data() );
148  buffer_crypt::array_t data_to_decrypt(
149  data_ptr,
150  data_ptr + req.size() );
151  ret = crypt.decrypt(
152  shared_secret,
153  iv,
154  data_to_decrypt,
155  data_to_process );
156  if ( !ret.ok() ) {
157  irods::log( PASS( ret ) );
158  _output += "{\n \"failed_to_decrpyt_message_from\" : \"" + conn_str + "\"\n},\n";
159  rodsLog( LOG_ERROR, "Failed to decrpyt [%s]", req.data() );
160  return PASS( ret );
161 
162  }
163 
164  std::string rep_str(
165  reinterpret_cast< char* >( data_to_process.data() ),
166  data_to_process.size() );
167  if ( SERVER_CONTROL_SUCCESS != rep_str ) {
168  // check if the result is really an error or a status
169  if ( std::string::npos == rep_str.find( "[-]" ) ) {
170  _output += rep_str;
171 
172  }
173  else {
174  _output += "{\n \"invalid_message_format_from\" : \"" + conn_str + "\"\n},\n";
175  return ERROR(
177  rep_str );
178 
179  }
180  }
181 
182  return SUCCESS();
183 
184  } // forward_server_control_command
185 
187  const std::string& _pid_prop ) {
188  int svr_pid;
189  // no error case, resource servers have no re server
190  try {
191  svr_pid = get_server_property<const int>(_pid_prop);
192  } catch ( const irods::exception& e ) {
193  if ( e.code() == KEY_NOT_FOUND ) {
194  // if the property does not exist then the server
195  // in question is not running
196  return SUCCESS();
197  }
198  return irods::error(e);
199  }
200 
201  std::stringstream pid_str; pid_str << svr_pid;
202  std::vector<std::string> args;
203  args.push_back( pid_str.str() );
204 
205  std::string output;
207  "python",
208  "kill_pid.py",
209  args,
210  output );
211  if ( !ret.ok() ) {
212  return PASS( ret );
213  }
214 
215  return SUCCESS();
216 
217  } // kill_server
218 
220  const std::string& _wait_option,
221  const size_t _wait_seconds,
222  std::string& _output ) {
223  rodsEnv my_env;
224  _reloadRodsEnv( my_env );
225  _output += "{\n \"shutting down\": \"";
226  _output += my_env.rodsHost;
227  _output += "\"\n},\n";
228 
229  error ret;
230  int sleep_time_out_milli_sec = 0;
231  try {
232  sleep_time_out_milli_sec = get_server_property<const int>(CFG_SERVER_CONTROL_PLANE_TIMEOUT);
233  } catch ( const irods::exception& e ) {
234  return irods::error(e);
235  }
236 
237  if ( SERVER_CONTROL_FORCE_AFTER_KW == _wait_option ) {
238  // convert sec to millisec for comparison
239  sleep_time_out_milli_sec = _wait_seconds * 1000;
240  }
241 
242  int wait_milliseconds = SERVER_CONTROL_POLLING_TIME_MILLI_SEC;
243 
244  server_state& svr_state = server_state::instance();
245  svr_state( server_state::PAUSED );
246 
247  int sleep_time = 0;
248  bool timeout_flg = false;
249  int proc_cnt = getAgentProcCnt();
250 
251  // kill the delay server
252  rodsLog(LOG_DEBUG, "[%s:%d] - sending kill to delay server", __FUNCTION__, __LINE__);
253  ret = kill_server( irods::RE_PID_KW );
254  if ( !ret.ok() ) {
255  irods::log( PASS( ret ) );
256  }
257 
258  while ( proc_cnt > 0 && !timeout_flg ) {
259  // takes sec, millisec
261  0,
262  wait_milliseconds );
263 
264  if ( SERVER_CONTROL_WAIT_FOREVER_KW != _wait_option ) {
266  if ( sleep_time > sleep_time_out_milli_sec ) {
267  timeout_flg = true;
268  }
269  }
270 
271  proc_cnt = getAgentProcCnt();
272 
273  } // while
274 
275  // kill the xmessage server
277  if ( !ret.ok() ) {
278  irods::log( PASS( ret ) );
279  }
280 
281  // actually shut down the server
282  svr_state( server_state::STOPPED );
283 
284  // block until server exits to return
285  while( !timeout_flg ) {
286  // takes sec, millisec
288  0,
289  wait_milliseconds );
290 
292  if ( sleep_time > sleep_time_out_milli_sec ) {
293  timeout_flg = true;
294  }
295 
296  std::string the_server_state = svr_state();
297  if ( irods::server_state::EXITED == the_server_state ) {
298  break;
299  }
300 
301  } // while
302 
303  return SUCCESS();
304 
305  } // server_operation_shutdown
306 
308  const std::string&, // _wait_option,
309  const size_t, // _wait_seconds,
310  std::string& _output ) {
311  rodsEnv my_env;
312  _reloadRodsEnv( my_env );
313  _output += "{\n \"shutting down\": \"";
314  _output += my_env.rodsHost;
315  _output += "\"\n},\n";
316 
319  return SUCCESS();
320 
321  } // rule_engine_server_operation_shutdown
322 
324  const std::string&, // _wait_option,
325  const size_t, // _wait_seconds,
326  std::string& _output ) {
327  rodsEnv my_env;
328  _reloadRodsEnv( my_env );
329  _output += "{\n \"pausing\": \"";
330  _output += my_env.rodsHost;
331  _output += "\"\n},\n";
334 
335  return SUCCESS();
336 
337  } // operation_pause
338 
340  const std::string&, // _wait_option,
341  const size_t, // _wait_seconds,
342  std::string& _output ) {
343  rodsEnv my_env;
344  _reloadRodsEnv( my_env );
345  _output += "{\n \"resuming\": \"";
346  _output += my_env.rodsHost;
347  _output += "\"\n},\n";
348 
351  return SUCCESS();
352 
353  } // operation_resume
354 
355  static int get_pid_age(
356  pid_t _pid ) {
357  std::stringstream pid_str; pid_str << _pid;
358  std::vector<std::string> args;
359  args.push_back( pid_str.str() );
360 
361  std::string pid_age;
363  "python",
364  "pid_age.py",
365  args,
366  pid_age );
367  if ( !ret.ok() ) {
368  irods::log( PASS( ret ) );
369  return 0;
370  }
371 
372  double age = 0.0;
373  try {
374  age = boost::lexical_cast<double>( pid_age );
375  }
376  catch ( const boost::bad_lexical_cast& ) {
377  rodsLog(
378  LOG_ERROR,
379  "get_pid_age bad lexical cast for [%s]",
380  pid_age.c_str() );
381 
382  }
383 
384  return static_cast<int>( age );
385  } // get_pid_age
386 
388  const std::string&, // _wait_option,
389  const size_t, // _wait_seconds,
390  std::string& _output )
391  {
392  rodsEnv my_env;
393  _reloadRodsEnv( my_env );
394 
395  int re_pid = 0;
396  // no error case, resource servers have no re server
397  try {
398  re_pid = get_server_property<const int>(irods::RE_PID_KW);
399  } catch ( const irods::exception& ) {}
400 
401  int xmsg_pid = 0;
402  try {
403  xmsg_pid = get_server_property<const int>(irods::XMSG_PID_KW);
404  } catch ( const irods::exception& ) {}
405 
406  int my_pid = getpid();
407 
408  using json = nlohmann::json;
409 
410  json obj{
411  {"hostname", my_env.rodsHost},
412  {"irods_server_pid", my_pid}, // Should be int
413  {"re_server_pid", re_pid}, // Should be int
414  {"xmsg_server_pid", xmsg_pid} // Should be int
415  };
416 
418  obj["status"] = s();
419 
420  auto arr = json::array();
421 
422  std::vector<int> pids;
423  getAgentProcPIDs( pids );
424  for ( size_t i = 0; i < pids.size(); ++i ) {
425  int pid = pids[i];
426  int age = get_pid_age( pids[i] );
427 
428  arr.push_back(json::object({
429  {"agent_pid", pid},
430  {"age", age}
431  }));
432  }
433 
434  obj["agents"] = arr;
435 
436  _output += obj.dump(4);
437  _output += ",";
438 
439  return SUCCESS();
440  } // operation_status
441 
443  const std::string&, // _wait_option,
444  const size_t, // _wait_seconds,
445  std::string& _output ) {
446 
447  _output += "{\n \"status\": \"alive\"\n},\n";
448  /*rodsEnv my_env;
449  _reloadRodsEnv( my_env );
450  _output += "{\n \"pinging\": \"";
451  _output += my_env.rodsHost;
452  _output += "\"\n},\n";*/
453  return SUCCESS();
454  }
455 
457  const std::string& _hn1,
458  const std::string& _hn2 ) {
459 
460  bool we_are_the_host = ( _hn1 == _hn2 );
461  if ( !we_are_the_host ) {
462  bool host_has_dots = ( std::string::npos != _hn1.find( "." ) );
463  bool my_host_has_dots = ( std::string::npos != _hn2.find( "." ) );
464 
465  if ( host_has_dots && !my_host_has_dots ) {
466  we_are_the_host = ( std::string::npos != _hn1.find( _hn2 ) );
467 
468  }
469  else if ( !host_has_dots && my_host_has_dots ) {
470  we_are_the_host = ( std::string::npos != _hn2.find( _hn1 ) );
471 
472  }
473 
474  }
475 
476  return we_are_the_host;
477 
478  } // compare_host_names
479 
481  const std::string& _hn,
482  const host_list_t& _hosts ) {
483  for ( size_t i = 0;
484  i < _hosts.size();
485  ++i ) {
486  if ( compare_host_names(
487  _hn,
488  _hosts[ i ] ) ) {
489  return true;
490  }
491 
492  } // for i
493 
494  return false;
495 
496  } // is_host_in_list
497 
499  const std::string& _prop ) :
500  control_executor_( _prop ),
501  control_thread_( boost::ref( control_executor_ ) ) {
502 
503 
504  } // ctor
505 
507  try {
508  control_thread_.join();
509  }
510  catch ( const boost::thread_resource_error& ) {
511  rodsLog(
512  LOG_ERROR,
513  "boost encountered thread_resource_error on join in server_control_plane destructor." );
514  }
515 
516  } // dtor
517 
519  const std::string& _prop ) : port_prop_( _prop ) {
520  if ( port_prop_.empty() ) {
521  THROW(
523  "control_plane_port key is empty" );
524  }
525 
530  if ( _prop == CFG_RULE_ENGINE_CONTROL_PLANE_PORT ) {
532  }
533  else {
535 
536  }
537 
538  // get our hostname for ordering
539  rodsEnv my_env;
540  _reloadRodsEnv( my_env );
541  my_host_name_ = my_env.rodsHost;
542 
543  // get the IES host for ordereing
544  icat_host_name_ = boost::any_cast<const std::string&>(get_server_property<const std::vector<boost::any>>(CFG_CATALOG_PROVIDER_HOSTS_KW)[0]);
545 
546  // repave icat_host_name_ as we do not want to process 'localhost'
547  if ( "localhost" == icat_host_name_ ) {
549  rodsLog(
550  LOG_ERROR,
551  "server_control_executor - icat_host_name is localhost, not a fqdn" );
552  // TODO :: throw fancy exception here when we disallow localhost
553  }
554 
555  } // ctor
556 
558  const std::string& _name,
559  const std::string& _host,
560  const std::string& _port_keyword,
561  const std::string& _wait_option,
562  const size_t& _wait_seconds,
563  std::string& _output ) {
564  bool we_are_the_host = compare_host_names(
565  _host,
566  my_host_name_ );
567 
568  irods::error ret = SUCCESS();
569  // if this is forwarded to us, just perform the operation
570  if ( we_are_the_host ) {
571  host_list_t hosts;
572  hosts.push_back( _host );
573  ret = process_host_list(
574  _name,
575  _wait_option,
576  _wait_seconds,
577  hosts,
578  _output );
579 
580  }
581  else {
583  _name,
584  _host,
585  _port_keyword,
586  _output );
587 
588  }
589 
590  return ret;
591 
592  } // forward_command
593 
595  host_list_t& _host_names ) {
596  rodsEnv my_env;
597  _reloadRodsEnv( my_env );
598  rcComm_t* comm = rcConnect(
599  my_env.rodsHost,
600  my_env.rodsPort,
601  my_env.rodsUserName,
602  my_env.rodsZone,
603  NO_RECONN, 0 );
604  if ( !comm ) {
605  return ERROR(
607  "rcConnect failed" );
608  }
609 
610  int status = clientLogin(
611  comm,
612  0,
613  my_env.rodsAuthScheme );
614  if ( status != 0 ) {
615  rcDisconnect( comm );
616  return ERROR(
617  status,
618  "client login failed" );
619  }
620 
621  genQueryInp_t gen_inp;
622  genQueryOut_t* gen_out = NULL;
623  memset( &gen_inp, 0, sizeof( gen_inp ) );
624 
625  addInxIval( &gen_inp.selectInp, COL_R_LOC, 1 );
626  gen_inp.maxRows = MAX_SQL_ROWS;
627 
628  int cont_idx = 1;
629  while ( cont_idx ) {
630  int status = rcGenQuery(
631  comm,
632  &gen_inp,
633  &gen_out );
634  if ( status < 0 ) {
635  rcDisconnect( comm );
636  freeGenQueryOut( &gen_out );
637  clearGenQueryInp( &gen_inp );
638  return ERROR(
639  status,
640  "genQuery failed." );
641 
642  } // if
643 
644  sqlResult_t* resc_loc = getSqlResultByInx(
645  gen_out,
646  COL_R_LOC );
647  if ( !resc_loc ) {
648  rcDisconnect( comm );
649  freeGenQueryOut( &gen_out );
650  clearGenQueryInp( &gen_inp );
651  return ERROR(
653  "getSqlResultByInx for COL_R_LOC failed" );
654  }
655 
656  for ( int i = 0;
657  i < gen_out->rowCnt;
658  ++i ) {
659  const std::string hn( &resc_loc->value[ resc_loc->len * i ] );
660  if ( "localhost" != hn ) {
661  _host_names.push_back( hn );
662 
663  }
664 
665  } // for i
666 
667  cont_idx = gen_out->continueInx;
668 
669  } // while
670 
671  freeGenQueryOut( &gen_out );
672  clearGenQueryInp( &gen_inp );
673 
674  status = rcDisconnect( comm );
675  if ( status < 0 ) {
676  return ERROR(
677  status,
678  "failed in rcDisconnect" );
679  }
680 
681  return SUCCESS();
682 
683  } // get_resource_host_names
684 
686 
687  int port, num_hash_rounds;
688  boost::optional<const std::string&> encryption_algorithm;
689  buffer_crypt::array_t shared_secret;
690  try {
691  port = get_server_property<const int>(port_prop_);
692  num_hash_rounds = get_server_property<const int>(CFG_SERVER_CONTROL_PLANE_ENCRYPTION_NUM_HASH_ROUNDS_KW);
693  encryption_algorithm.reset(get_server_property<const std::string>(CFG_SERVER_CONTROL_PLANE_ENCRYPTION_ALGORITHM_KW));
694  const auto& key = get_server_property<const std::string>(CFG_SERVER_CONTROL_PLANE_KEY);
695  shared_secret.assign(key.begin(), key.end());
696  } catch ( const irods::exception& e ) {
697  irods::log(e);
698  return;
699  }
700 
701  if ( shared_secret.empty() ||
702  encryption_algorithm->empty() ||
703  0 == port ||
704  0 == num_hash_rounds ) {
705  rodsLog(
706  LOG_NOTICE,
707  "control plane is not configured properly" );
708  return;
709  }
710 
711  while ( true ) {
712  try {
713  zmq::context_t zmq_ctx( 1 );
714  zmq::socket_t zmq_skt( zmq_ctx, ZMQ_REP );
715 
717  zmq_skt.setsockopt( ZMQ_RCVTIMEO, &time_out, sizeof( time_out ) );
718  zmq_skt.setsockopt( ZMQ_SNDTIMEO, &time_out, sizeof( time_out ) );
719  zmq_skt.setsockopt( ZMQ_LINGER, 0 );
720 
721  std::stringstream port_sstr;
722  port_sstr << port;
723  std::string conn_str( "tcp://*:" );
724  conn_str += port_sstr.str();
725  zmq_skt.bind( conn_str.c_str() );
726 
727  rodsLog(
728  LOG_NOTICE,
729  ">>> control plane :: listening on port %d\n",
730  port );
731 
733  while ( server_state::STOPPED != s() &&
734  server_state::EXITED != s() ) {
735 
736  zmq::message_t req;
737  zmq_skt.recv( &req );
738  if ( 0 == req.size() ) {
739  continue;
740 
741  }
742 
743  // process the message
744  std::string output;
745  std::string rep_msg( SERVER_CONTROL_SUCCESS );
746  error ret = process_operation( req, output );
747 
748  rep_msg = output;
749  if ( !ret.ok() ) {
750  log( PASS( ret ) );
751  }
752 
753  if ( !output.empty() ) {
754  rep_msg = output;
755 
756  }
757 
758  buffer_crypt crypt(
759  shared_secret.size(), // key size
760  0, // salt size ( we dont send a salt )
761  num_hash_rounds, // num hash rounds
762  encryption_algorithm->c_str() );
763 
765  buffer_crypt::array_t data_to_send;
766  buffer_crypt::array_t data_to_encrypt(
767  rep_msg.begin(),
768  rep_msg.end() );
769  ret = crypt.encrypt(
770  shared_secret,
771  iv,
772  data_to_encrypt,
773  data_to_send );
774  if ( !ret.ok() ) {
775  irods::log( PASS( ret ) );
776 
777  }
778 
779  zmq::message_t rep( data_to_send.size() );
780  memcpy(
781  rep.data(),
782  data_to_send.data(),
783  data_to_send.size() );
784 
785  zmq_skt.send( rep );
786 
787  } // while
788  // exited control loop normally, we're done
789  break;
790  } catch ( const zmq::error_t& _e ) {
791  rodsLog(LOG_ERROR, "ZMQ encountered an error in the control plane loop: [%s] Restarting control thread...", _e.what());
792  continue;
793  }
794  }
795 
796  } // control operation
797 
799  const std::string& _cmd_name,
800  const std::string& _cmd_option,
801  const std::string& _wait_option,
802  const size_t& _wait_seconds,
803  const host_list_t& _cmd_hosts,
804  std::string& _output ) {
805 
806  if ( SERVER_CONTROL_RESUME != _cmd_name ) {
807  return SUCCESS();
808 
809  }
810 
811  error ret = SUCCESS();
812  const bool is_all_opt = ( SERVER_CONTROL_ALL_OPT == _cmd_option );
813  const bool found_my_host = is_host_in_list(
815  _cmd_hosts );
816  const bool found_icat_host = is_host_in_list(
818  _cmd_hosts );
819  const bool is_icat_host = compare_host_names( my_host_name_, icat_host_name_ );
820  // for pause or shutdown: pre-op forwards to the ies first,
821  // then to myself, then others
822  // for resume: we skip doing work here (we'll go last in post-op)
823  if ( found_icat_host || is_all_opt ) {
824  ret = forward_command(
825  _cmd_name,
828  _wait_option,
829  _wait_seconds,
830  _output );
831  // takes sec, microsec
834  }
835 
836  // pre-op forwards to the local server second
837  // such as for resume
838  if ( !is_icat_host && ( found_my_host || is_all_opt ) ) {
839  ret = forward_command(
840  _cmd_name,
843  _wait_option,
844  _wait_seconds,
845  _output );
846  }
847 
848  return ret;
849 
850  } // notify_icat_and_local_servers_preop
851 
853  const std::string& _cmd_name,
854  const std::string& _cmd_option,
855  const std::string& _wait_option,
856  const size_t& _wait_seconds,
857  const host_list_t& _cmd_hosts,
858  std::string& _output ) {
859  error ret = SUCCESS();
860  if ( SERVER_CONTROL_RESUME == _cmd_name ) {
861  return SUCCESS();
862 
863  }
864 
865  bool is_all_opt = ( SERVER_CONTROL_ALL_OPT == _cmd_option );
866  const bool found_my_host = is_host_in_list(
868  _cmd_hosts );
869  const bool found_icat_host = is_host_in_list(
871  _cmd_hosts );
872  const bool is_icat_host = compare_host_names( my_host_name_, icat_host_name_ );
873 
874  // post-op forwards to the local server first
875  // then the icat such as for shutdown
876  if ( !is_icat_host && ( found_my_host || is_all_opt ) ) {
877  ret = forward_command(
878  _cmd_name,
881  _wait_option,
882  _wait_seconds,
883  _output );
884  }
885 
886  // post-op forwards to the ies last
887  if ( found_icat_host || is_all_opt ) {
888  ret = forward_command(
889  _cmd_name,
892  _wait_option,
893  _wait_seconds,
894  _output );
895  }
896 
897  return ret;
898 
899  } // notify_icat_and_local_servers_postop
900 
902  const host_list_t& _irods_hosts,
903  const host_list_t& _cmd_hosts,
904  host_list_t& _valid_hosts ) {
905 
906  host_list_t::const_iterator itr;
907  for ( itr = _cmd_hosts.begin();
908  itr != _cmd_hosts.end();
909  ++itr ) {
910  // check host value against list from the icat
911  if ( !is_host_in_list(
912  *itr,
913  _irods_hosts ) &&
914  *itr != icat_host_name_ ) {
915  std::string msg( "invalid server hostname [" );
916  msg += *itr;
917  msg += "]";
918  return ERROR(
920  msg );
921 
922  }
923 
924  // skip the IES since it is a special case
925  // and handled elsewhere
926  if ( compare_host_names( icat_host_name_, *itr ) ) {
927  continue;
928  }
929 
930  // skip the local server since it is also a
931  // special case and handled elsewhere
932  if ( compare_host_names( my_host_name_, *itr ) ) {
933  continue;
934 
935  }
936 
937  // add the host to our newly ordered list
938  _valid_hosts.push_back( *itr );
939 
940  } // for itr
941 
942  return SUCCESS();
943 
944  } // validate_host_list
945 
947  const control_plane_command& _cmd,
948  std::string& _name,
949  std::string& _option,
950  std::string& _wait_option,
951  size_t& _wait_seconds,
952  host_list_t& _hosts ) {
953  // capture and validate the command parameter
954  _name = _cmd.command;
955  if ( op_map_.count(_name) == 0 ) {
956  std::string msg( "invalid command [" );
957  msg += _name;
958  msg += "]";
959  return ERROR(
961  msg );
962  }
963 
964  // capture and validate the option parameter
965  std::map<std::string, std::string>::const_iterator itr =
966  _cmd.options.find( SERVER_CONTROL_OPTION_KW );
967  if ( _cmd.options.end() == itr ) {
968  return ERROR(
970  "option parameter is empty" );
971 
972  }
973 
974  _option = itr->second;
975  if ( SERVER_CONTROL_ALL_OPT != _option &&
976  SERVER_CONTROL_HOSTS_OPT != _option ) {
977  std::string msg( "invalid command option [" );
978  msg += _option;
979  msg += "]";
980  return ERROR(
982  msg );
983  }
984 
985  // capture and validate the server hosts, skip the option key
986  for ( itr = _cmd.options.begin();
987  itr != _cmd.options.end();
988  ++itr ) {
989  if ( itr->first == SERVER_CONTROL_OPTION_KW ) {
990  continue;
991 
992  }
993  else if ( itr->first == SERVER_CONTROL_FORCE_AFTER_KW ) {
994  _wait_option = SERVER_CONTROL_FORCE_AFTER_KW;
995  _wait_seconds = boost::lexical_cast< size_t >( itr->second );
996 
997  }
998  else if ( itr->first == SERVER_CONTROL_WAIT_FOREVER_KW ) {
999  _wait_option = SERVER_CONTROL_WAIT_FOREVER_KW;
1000  _wait_seconds = 0;
1001 
1002  }
1003  else if ( itr->first.find(
1005  != std::string::npos ) {
1006  _hosts.push_back( itr->second );
1007 
1008  }
1009  else {
1010  std::string msg( "invalid option key [" );
1011  msg += itr->first;
1012  msg += "]";
1013  return ERROR(
1015  msg );
1016 
1017  }
1018 
1019  } // for itr
1020 
1021  return SUCCESS();
1022 
1023  } // extract_command_parameters
1024 
1026  const std::string& _cmd_name,
1027  const std::string& _wait_option,
1028  const size_t& _wait_seconds,
1029  const host_list_t& _hosts,
1030  std::string& _output ) {
1031  if ( _hosts.empty() ) {
1032  return SUCCESS();
1033 
1034  }
1035 
1036  error fwd_err = SUCCESS();
1037  host_list_t::const_iterator itr;
1038  for ( itr = _hosts.begin();
1039  itr != _hosts.end();
1040  ++itr ) {
1041  if ( "localhost" == *itr ) {
1042  continue;
1043 
1044  }
1045 
1046  std::string output;
1047  if ( compare_host_names(
1048  *itr,
1049  my_host_name_ ) ) {
1050  error ret = op_map_[ _cmd_name ](
1051  _wait_option,
1052  _wait_seconds,
1053  output );
1054  if ( !ret.ok() ) {
1055  fwd_err = PASS( ret );
1056 
1057  }
1058 
1059  _output += output;
1060 
1061  }
1062  else {
1063  error ret = forward_command(
1064  _cmd_name,
1065  *itr,
1066  port_prop_,
1067  _wait_option,
1068  _wait_seconds,
1069  output );
1070  if ( !ret.ok() ) {
1071  _output += output;
1072  log( PASS( ret ) );
1073  fwd_err = PASS( ret );
1074 
1075  }
1076  else {
1077  _output += output;
1078 
1079  }
1080 
1081  }
1082 
1083  } // for itr
1084 
1085  return fwd_err;
1086 
1087  } // process_host_list
1088 
1090  const zmq::message_t& _msg,
1091  std::string& _output ) {
1092  if ( _msg.size() <= 0 ) {
1093  return SUCCESS();
1094 
1095  }
1096 
1097  error final_ret = SUCCESS();
1098 
1099  int port, num_hash_rounds;
1100  boost::optional<const std::string&> encryption_algorithm;
1101  buffer_crypt::array_t shared_secret;
1102  try {
1103  port = get_server_property<const int>(port_prop_);
1104  num_hash_rounds = get_server_property<const int>(CFG_SERVER_CONTROL_PLANE_ENCRYPTION_NUM_HASH_ROUNDS_KW);
1105  encryption_algorithm.reset(get_server_property<const std::string>(CFG_SERVER_CONTROL_PLANE_ENCRYPTION_ALGORITHM_KW));
1106  const auto& key = get_server_property<const std::string>(CFG_SERVER_CONTROL_PLANE_KEY);
1107  shared_secret.assign(key.begin(), key.end());
1108  } catch ( const irods::exception& e ) {
1109  return irods::error(e);
1110  }
1111 
1112  // decrypt the message before passing to avro
1113  buffer_crypt crypt(
1114  shared_secret.size(), // key size
1115  0, // salt size ( we dont send a salt )
1116  num_hash_rounds, // num hash rounds
1117  encryption_algorithm->c_str() );
1118 
1120  buffer_crypt::array_t data_to_process;
1121 
1122  const uint8_t* data_ptr = static_cast< const uint8_t* >( _msg.data() );
1123  buffer_crypt::array_t data_to_decrypt(
1124  data_ptr,
1125  data_ptr + _msg.size() );
1126  irods::error ret = crypt.decrypt(
1127  shared_secret,
1128  iv,
1129  data_to_decrypt,
1130  data_to_process );
1131  if ( !ret.ok() ) {
1132  irods::log( PASS( ret ) );
1133  return PASS( ret );
1134 
1135  }
1136 
1137 
1138  auto in = avro::memoryInputStream(
1139  static_cast<const uint8_t*>(
1140  data_to_process.data() ),
1141  data_to_process.size() );
1142  avro::DecoderPtr dec = avro::binaryDecoder();
1143  dec->init( *in );
1144 
1145  control_plane_command cmd;
1146  avro::decode( *dec, cmd );
1147 
1148  std::string cmd_name, cmd_option, wait_option;
1149  host_list_t cmd_hosts;
1150  size_t wait_seconds = 0;
1152  cmd,
1153  cmd_name,
1154  cmd_option,
1155  wait_option,
1156  wait_seconds,
1157  cmd_hosts );
1158  if ( !ret.ok() ) {
1159  irods::log( PASS( ret ) );
1160  return PASS( ret );
1161 
1162  }
1163 
1164  // add safeguards - if server is paused only allow a resume call
1166  std::string the_server_state = s();
1167  if ( server_state::PAUSED == the_server_state &&
1168  SERVER_CONTROL_RESUME != cmd_name ) {
1169  _output = SERVER_PAUSED_ERROR;
1170  return SUCCESS();
1171  }
1172 
1173  // the icat needs to be notified first in certain
1174  // cases such as RESUME where it is needed to capture
1175  // the host list for validation, etc
1177  cmd_name,
1178  cmd_option,
1179  wait_option,
1180  wait_seconds,
1181  cmd_hosts,
1182  _output );
1183  if ( !ret.ok() ) {
1184  final_ret = PASS( ret );
1185  irods::log( final_ret );
1186  }
1187 
1188  host_list_t irods_hosts;
1190  irods_hosts );
1191  if ( !ret.ok() ) {
1192  final_ret = PASS( ret );
1193  irods::log( final_ret );
1194  }
1195 
1196  if ( SERVER_CONTROL_ALL_OPT == cmd_option ) {
1197  cmd_hosts = irods_hosts;
1198 
1199  }
1200 
1201  host_list_t valid_hosts;
1202  ret = validate_host_list(
1203  irods_hosts,
1204  cmd_hosts,
1205  valid_hosts );
1206  if ( !ret.ok() ) {
1207  final_ret = PASS( ret );
1208  irods::log( final_ret );
1209 
1210  }
1211 
1212  ret = process_host_list(
1213  cmd_name,
1214  wait_option,
1215  wait_seconds,
1216  valid_hosts,
1217  _output );
1218  if ( !ret.ok() ) {
1219  final_ret = PASS( ret );
1220  irods::log( final_ret );
1221 
1222  }
1223 
1224  // the icat needs to be notified last in certain
1225  // cases such as SHUTDOWN or PAUSE where it is
1226  // needed to capture the host list for validation
1228  cmd_name,
1229  cmd_option,
1230  wait_option,
1231  wait_seconds,
1232  cmd_hosts, // dont want sanitized
1233  _output );
1234  if ( !ret.ok() ) {
1235  final_ret = PASS( ret );
1236  irods::log( final_ret );
1237  }
1238 
1239  return final_ret;
1240 
1241  } // process_operation
1242 
1243 }; // namespace irods
irods::SERVER_CONTROL_OPTION_KW
const std::string SERVER_CONTROL_OPTION_KW("server_control_option")
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
MAX_SQL_ROWS
#define MAX_SQL_ROWS
Definition: rodsGenQuery.h:16
rcComm_t
Definition: rcConnect.h:95
NULL
#define NULL
Definition: rodsDef.h:70
irods::get_server_property
T & get_server_property(const std::string &_prop)
Definition: irods_server_properties.hpp:118
irods::buffer_crypt::decrypt
irods::error decrypt(const array_t &, const array_t &, const array_t &, array_t &)
Definition: irods_buffer_encryption.cpp:260
irods::SERVER_CONTROL_PAUSE
const std::string SERVER_CONTROL_PAUSE("server_control_pause")
irods::server_control_executor::process_operation
error process_operation(const zmq::message_t &, std::string &)
Definition: irods_server_control_plane.cpp:1089
irods::server_state::instance
static server_state & instance()
Definition: irods_server_state.cpp:18
irods::SERVER_CONTROL_POLLING_TIME_MILLI_SEC
static const size_t SERVER_CONTROL_POLLING_TIME_MILLI_SEC
Definition: irods_server_control_plane.hpp:35
rodsEnv::rodsPort
int rodsPort
Definition: getRodsEnv.h:11
irods::ctrl_plane_sleep
static void ctrl_plane_sleep(int _s, int _ms)
Definition: irods_server_control_plane.cpp:33
irods::buffer_crypt::array_t
std::vector< unsigned char > array_t
Definition: irods_buffer_encryption.hpp:30
irods_server_properties.hpp
THROW
#define THROW(_code, _msg)
Definition: irods_exception.hpp:68
pid_age
Definition: pid_age.py:1
COL_R_LOC
#define COL_R_LOC
Definition: rodsGenQuery.h:148
irods::server_control_executor::process_host_list
error process_host_list(const std::string &, const std::string &, const size_t &, const host_list_t &, std::string &)
Definition: irods_server_control_plane.cpp:1025
UNMATCHED_KEY_OR_INDEX
@ UNMATCHED_KEY_OR_INDEX
Definition: rodsErrorTable.h:244
irods::CFG_CATALOG_PROVIDER_HOSTS_KW
const std::string CFG_CATALOG_PROVIDER_HOSTS_KW("catalog_provider_hosts")
irods::server_state::RUNNING
static const std::string RUNNING
Definition: irods_server_state.hpp:17
irods::server_control_plane::control_thread_
boost::thread control_thread_
Definition: irods_server_control_plane.hpp:133
irods_stacktrace.hpp
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
irods::EMPTY_RESC_HOST
const std::string EMPTY_RESC_HOST("EMPTY_RESC_HOST")
irods::RE_PID_KW
const std::string RE_PID_KW("rule_engine_process_id")
irods::server_control_executor::get_resource_host_names
error get_resource_host_names(host_list_t &)
Definition: irods_server_control_plane.cpp:594
irods::get_pid_age
static int get_pid_age(pid_t _pid)
Definition: irods_server_control_plane.cpp:355
rodsEnv::rodsZone
char rodsZone[64]
Definition: getRodsEnv.h:18
irods_exception.hpp
irods::server_control_executor::host_list_t
std::vector< std::string > host_list_t
Definition: irods_server_control_plane.hpp:52
GenQueryInp
Definition: rodsGenQuery.h:24
generate_iadmin_commands_for_41_to_42_upgrade.output
output
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:21
irods::server_control_plane::server_control_plane
server_control_plane(const std::string &)
Definition: irods_server_control_plane.cpp:498
rcMisc.h
irods::operation_pause
static error operation_pause(const std::string &, const size_t, std::string &_output)
Definition: irods_server_control_plane.cpp:323
irods::XMSG_PID_KW
const std::string XMSG_PID_KW("x_message_process_id")
irods::server_control_executor::operator()
void operator()()
Definition: irods_server_control_plane.cpp:685
irods::SERVER_CONTROL_FORCE_AFTER_KW
const std::string SERVER_CONTROL_FORCE_AFTER_KW("server_control_force_after")
irods::server_control_plane::~server_control_plane
~server_control_plane()
Definition: irods_server_control_plane.cpp:506
CONTROL_PLANE_MESSAGE_ERROR
@ CONTROL_PLANE_MESSAGE_ERROR
Definition: rodsErrorTable.h:769
rodsServer.hpp
irods::SERVER_CONTROL_ALL_OPT
const std::string SERVER_CONTROL_ALL_OPT("all")
boost
Definition: rcMisc.cpp:4341
json
nlohmann::json json
Definition: group.cpp:5
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
irods::server_state::PAUSED
static const std::string PAUSED
Definition: irods_server_state.hpp:18
irods::CFG_SERVER_CONTROL_PLANE_TIMEOUT
const std::string CFG_SERVER_CONTROL_PLANE_TIMEOUT("server_control_plane_timeout_milliseconds")
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
GenQueryInp::selectInp
inxIvalPair_t selectInp
Definition: rodsGenQuery.h:53
GenQueryInp::maxRows
int maxRows
Definition: rodsGenQuery.h:25
rodsEnv::rodsUserName
char rodsUserName[64]
Definition: getRodsEnv.h:9
irods::CFG_RULE_ENGINE_CONTROL_PLANE_PORT
const std::string CFG_RULE_ENGINE_CONTROL_PLANE_PORT("rule_engine_control_plane_port")
generate_iadmin_commands_for_41_to_42_upgrade.cmd
list cmd
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:19
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods::server_control_executor::forward_command
error forward_command(const std::string &, const std::string &, const std::string &, const std::string &, const size_t &, std::string &)
Definition: irods_server_control_plane.cpp:557
irods::SERVER_CONTROL_HOSTS_OPT
const std::string SERVER_CONTROL_HOSTS_OPT("hosts")
irods_buffer_encryption.hpp
getSqlResultByInx
sqlResult_t * getSqlResultByInx(genQueryOut_t *genQueryOut, int attriInx)
Definition: rcMisc.cpp:1387
irods::server_state::EXITED
static const std::string EXITED
Definition: irods_server_state.hpp:20
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
irods::SERVER_CONTROL_WAIT_FOREVER_KW
const std::string SERVER_CONTROL_WAIT_FOREVER_KW("server_control_wait_forever")
GenQueryOut::continueInx
int continueInx
Definition: rodsGenQuery.h:70
rcConnect
rcComm_t * rcConnect(const char *rodsHost, int rodsPort, const char *userName, const char *rodsZone, int reconnFlag, rErrMsg_t *errMsg)
Definition: rcConnect.cpp:30
irods::server_state::STOPPED
static const std::string STOPPED
Definition: irods_server_state.hpp:19
irods
Definition: apiHandler.hpp:35
rcGenQuery
int rcGenQuery(rcComm_t *conn, genQueryInp_t *genQueryInp, genQueryOut_t **genQueryOut)
Definition: rcGenQuery.cpp:89
pid_age.pid
pid
Definition: pid_age.py:12
irods::server_control_executor::notify_icat_and_local_servers_postop
error notify_icat_and_local_servers_postop(const std::string &, const std::string &, const std::string &, const size_t &, const host_list_t &, std::string &)
Definition: irods_server_control_plane.cpp:852
irods::SERVER_CONTROL_SUCCESS
const std::string SERVER_CONTROL_SUCCESS("server_control_success")
irods::server_state
Definition: irods_server_state.hpp:11
genQuery.h
irods::kill_server
static error kill_server(const std::string &_pid_prop)
Definition: irods_server_control_plane.cpp:186
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
irods::SERVER_PAUSED_ERROR
const std::string SERVER_PAUSED_ERROR("The server is Paused, resume before issuing any other commands")
NULL_VALUE_ERR
@ NULL_VALUE_ERR
Definition: rodsErrorTable.h:669
irods::buffer_crypt
Definition: irods_buffer_encryption.hpp:25
addInxIval
int addInxIval(inxIvalPair_t *inxIvalPair, int inx, int value)
Definition: rcMisc.cpp:883
KEY_NOT_FOUND
@ KEY_NOT_FOUND
Definition: rodsErrorTable.h:749
GenQueryOut
Definition: rodsGenQuery.h:67
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irods::server_operation_shutdown
static error server_operation_shutdown(const std::string &_wait_option, const size_t _wait_seconds, std::string &_output)
Definition: irods_server_control_plane.cpp:219
irods::SERVER_CONTROL_PING
const std::string SERVER_CONTROL_PING("server_control_ping")
irods::server_control_executor::my_host_name_
std::string my_host_name_
Definition: irods_server_control_plane.hpp:111
GenQueryOut::rowCnt
int rowCnt
Definition: rodsGenQuery.h:68
irods::buffer_crypt::encrypt
irods::error encrypt(const array_t &, const array_t &, const array_t &, array_t &)
Definition: irods_buffer_encryption.cpp:168
irods::log
void log(const error &)
Definition: irods_log.cpp:13
irods::server_control_executor::port_prop_
const std::string port_prop_
Definition: irods_server_control_plane.hpp:109
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::server_control_executor::server_control_executor
server_control_executor()
Definition: irods_server_control_plane.hpp:43
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
irods::SERVER_CONTROL_SHUTDOWN
const std::string SERVER_CONTROL_SHUTDOWN("server_control_shutdown")
irods.password_obfuscation.decode
def decode(s, uid=None)
Definition: password_obfuscation.py:43
SqlResult::value
char * value
Definition: rodsGenQuery.h:64
irods::server_control_executor::notify_icat_and_local_servers_preop
error notify_icat_and_local_servers_preop(const std::string &, const std::string &, const std::string &, const size_t &, const host_list_t &, std::string &)
Definition: irods_server_control_plane.cpp:798
getAgentProcCnt
int getAgentProcCnt()
Definition: rodsServer.cpp:985
SqlResult
Definition: rodsGenQuery.h:61
rcDisconnect
int rcDisconnect(rcComm_t *conn)
Definition: rcConnect.cpp:246
error
int error
Definition: filesystem.cpp:101
irods_server_state.hpp
irods_resource_manager.hpp
getAgentProcPIDs
int getAgentProcPIDs(std::vector< int > &_pids)
Definition: rodsServer.cpp:1001
irods::SERVER_CONTROL_FWD_SLEEP_TIME_MILLI_SEC
static const size_t SERVER_CONTROL_FWD_SLEEP_TIME_MILLI_SEC
Definition: irods_server_control_plane.hpp:38
irods::server_control_executor::compare_host_names
bool compare_host_names(const std::string &, const std::string &)
Definition: irods_server_control_plane.cpp:456
irods::exception
Definition: irods_exception.hpp:15
irods::server_control_executor::validate_host_list
error validate_host_list(const host_list_t &, const host_list_t &, host_list_t &)
Definition: irods_server_control_plane.cpp:901
SqlResult::len
int len
Definition: rodsGenQuery.h:63
irods::server_control_executor::extract_command_parameters
error extract_command_parameters(const irods::control_plane_command &, std::string &, std::string &, std::string &, size_t &, host_list_t &)
Definition: irods_server_control_plane.cpp:946
irods_server_control_plane.hpp
sockComm.h
irods::operation_resume
static error operation_resume(const std::string &, const size_t, std::string &_output)
Definition: irods_server_control_plane.cpp:339
irods::rule_engine_operation_shutdown
static error rule_engine_operation_shutdown(const std::string &, const size_t, std::string &_output)
Definition: irods_server_control_plane.cpp:307
irods::SERVER_CONTROL_RESUME
const std::string SERVER_CONTROL_RESUME("server_control_resume")
irods::operation_status
static error operation_status(const std::string &, const size_t, std::string &_output)
Definition: irods_server_control_plane.cpp:387
irods::forward_server_control_command
static error forward_server_control_command(const std::string &_name, const std::string &_host, const std::string &_port_keyword, std::string &_output)
Definition: irods_server_control_plane.cpp:40
irods::server_control_executor::icat_host_name_
std::string icat_host_name_
Definition: irods_server_control_plane.hpp:112
irods::CFG_SERVER_CONTROL_PLANE_PORT
const std::string CFG_SERVER_CONTROL_PLANE_PORT("server_control_plane_port")
irods::CFG_SERVER_CONTROL_PLANE_ENCRYPTION_NUM_HASH_ROUNDS_KW
const std::string CFG_SERVER_CONTROL_PLANE_ENCRYPTION_NUM_HASH_ROUNDS_KW("server_control_plane_encryption_num_hash_rounds")
irods::server_control_executor::is_host_in_list
bool is_host_in_list(const std::string &, const host_list_t &)
Definition: irods_server_control_plane.cpp:480
clientLogin
int clientLogin(rcComm_t *conn, const char *_context, const char *_scheme_override)
Definition: clientLogin.cpp:222
get_script_output_single_line
irods::error get_script_output_single_line(const std::string &script_language, const std::string &script_name, const std::vector< std::string > &args, std::string &output)
Definition: miscServerFunct.cpp:3046
irods::server_control_executor::op_map_
boost::unordered_map< std::string, ctrl_func_t > op_map_
Definition: irods_server_control_plane.hpp:110
rodsEnv::rodsAuthScheme
char rodsAuthScheme[64]
Definition: getRodsEnv.h:16
rodsEnv
Definition: getRodsEnv.h:8
freeGenQueryOut
int freeGenQueryOut(genQueryOut_t **genQueryOut)
Definition: rcMisc.cpp:1133
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods::SERVER_CONTROL_STATUS
const std::string SERVER_CONTROL_STATUS("server_control_status")
NO_RECONN
#define NO_RECONN
Definition: rcConnect.h:34
manual_cleanup.out
out
Definition: manual_cleanup.py:29
irods.password_obfuscation.encode
def encode(s, uid=None, mtime=None)
Definition: password_obfuscation.py:88
clearGenQueryInp
void clearGenQueryInp(void *voidInp)
Definition: rcMisc.cpp:1118
rodsEnv::rodsHost
char rodsHost[64]
Definition: getRodsEnv.h:10
irods::SERVER_CONTROL_HOST_KW
const std::string SERVER_CONTROL_HOST_KW("server_control_host")
irods::CFG_SERVER_CONTROL_PLANE_ENCRYPTION_ALGORITHM_KW
const std::string CFG_SERVER_CONTROL_PLANE_ENCRYPTION_ALGORITHM_KW("server_control_plane_encryption_algorithm")
irods_log.hpp
_reloadRodsEnv
void _reloadRodsEnv(rodsEnv &rodsEnvArg)
Definition: getRodsEnv.cpp:128
irods::operation_ping
static error operation_ping(const std::string &, const size_t, std::string &_output)
Definition: irods_server_control_plane.cpp:442
irods::CFG_SERVER_CONTROL_PLANE_KEY
const std::string CFG_SERVER_CONTROL_PLANE_KEY("server_control_plane_key")