Esempio n. 1
0
gboolean
log_threaded_dest_driver_deinit_method(LogPipe *s)
{
  LogThrDestDriver *self = (LogThrDestDriver *)s;

  log_queue_reset_parallel_push(self->queue);

  log_queue_set_counters(self->queue, NULL, NULL);

  cfg_persist_config_add(log_pipe_get_config(s),
                         log_threaded_dest_driver_format_seqnum_for_persist(self),
                         GINT_TO_POINTER(self->seq_num), NULL, FALSE);

  stats_lock();
  stats_unregister_counter(self->stats_source | SCS_DESTINATION, self->super.super.id,
                           self->format.stats_instance(self),
                           SC_TYPE_STORED, &self->stored_messages);
  stats_unregister_counter(self->stats_source | SCS_DESTINATION, self->super.super.id,
                           self->format.stats_instance(self),
                           SC_TYPE_DROPPED, &self->dropped_messages);
  stats_unregister_counter(self->stats_source | SCS_DESTINATION, self->super.super.id,
                           self->format.stats_instance(self),
                           SC_TYPE_PROCESSED, &self->processed_messages);
  stats_unlock();

  if (!log_dest_driver_deinit_method(s))
    return FALSE;

  return TRUE;
}
Esempio n. 2
0
static gboolean
afprogram_dd_deinit(LogPipe *s)
{
    AFProgramDestDriver *self = (AFProgramDestDriver *) s;
    GlobalConfig *cfg = log_pipe_get_config(&self->super.super.super);

    if (self->writer)
        log_pipe_deinit((LogPipe *) self->writer);

    child_manager_unregister(self->process_info.pid);

    if (self->keep_alive)
    {
        afprogram_dd_store_reload_store_item(self, cfg);
    }
    else
    {
        afprogram_dd_kill_child(self);

        if (self->writer)
            log_pipe_unref((LogPipe *) self->writer);
    }

    if (self->writer)
    {
        self->writer = NULL;
    }

    return log_dest_driver_deinit_method(s);
}
Esempio n. 3
0
static gboolean
afprogram_dd_deinit(LogPipe *s)
{
  AFProgramDestDriver *self = (AFProgramDestDriver *) s;

  if (self->pid != -1)
    {
      msg_verbose("Sending destination program a TERM signal",
                  evt_tag_str("cmdline", self->cmdline->str),
                  evt_tag_int("child_pid", self->pid),
                  NULL);
      kill(-self->pid, SIGTERM);
      self->pid = -1;
    }

  if (self->writer)
    {
      log_pipe_deinit(self->writer);
      log_pipe_unref(self->writer);
      self->writer = NULL;
    }

  if (!log_dest_driver_deinit_method(s))
    return FALSE;
  return TRUE;
}
Esempio n. 4
0
gboolean
afsocket_dd_deinit(LogPipe *s)
{
  AFSocketDestDriver *self = (AFSocketDestDriver *) s;

  afsocket_dd_stop_watches(self);
  afsocket_dd_stop_writer(self);
  afsocket_dd_save_connection(self);

  return log_dest_driver_deinit_method(s);
}
Esempio n. 5
0
static gboolean
afprogram_dd_deinit(LogPipe *s)
{
  AFProgramDestDriver *self = (AFProgramDestDriver *) s;

  if (self->writer)
    log_pipe_deinit(self->writer);

  if (!log_dest_driver_deinit_method(s))
    return FALSE;
  return TRUE;
}
Esempio n. 6
0
static gboolean
afprogram_dd_deinit(LogPipe *s)
{
  AFProgramDestDriver *self = (AFProgramDestDriver *) s;

  afprogram_dd_kill_child(self);
  if (self->writer)
    {
      log_pipe_deinit(self->writer);
      log_pipe_unref(self->writer);
      self->writer = NULL;
    }

  if (!log_dest_driver_deinit_method(s))
    return FALSE;
  return TRUE;
}
Esempio n. 7
0
static gboolean
afmongodb_dd_deinit(LogPipe *s)
{
  MongoDBDestDriver *self = (MongoDBDestDriver *)s;

  afmongodb_dd_stop_thread(self);

  log_queue_set_counters(self->queue, NULL, NULL);
  stats_lock();
  stats_unregister_counter(SCS_MONGODB | SCS_DESTINATION, self->super.super.id,
			   afmongodb_dd_format_stats_instance(self),
			   SC_TYPE_STORED, &self->stored_messages);
  stats_unregister_counter(SCS_MONGODB | SCS_DESTINATION, self->super.super.id,
			   afmongodb_dd_format_stats_instance(self),
			   SC_TYPE_DROPPED, &self->dropped_messages);
  stats_unlock();
  if (!log_dest_driver_deinit_method(s))
    return FALSE;

  return TRUE;
}
Esempio n. 8
0
gboolean
afsocket_dd_deinit(LogPipe *s)
{
  AFSocketDestDriver *self = (AFSocketDestDriver *) s;
  GlobalConfig *cfg = log_pipe_get_config(s);

  afsocket_dd_stop_watches(self);

  if (self->writer)
    log_pipe_deinit(self->writer);

  if (self->flags & AFSOCKET_KEEP_ALIVE)
    {
      cfg_persist_config_add(cfg, afsocket_dd_format_persist_name(self, FALSE), self->writer, (GDestroyNotify) log_pipe_unref, FALSE);
      self->writer = NULL;
    }

  if (!log_dest_driver_deinit_method(s))
    return FALSE;

  return TRUE;
}