ppc64-diag
Functions | Variables
rtas_errd.c File Reference

Main entry point for rtas_errd. More...

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <librtas.h>
#include "rtas_errd.h"
#include "platform.c"

Functions

static void daemonize (void)
 daemonize rtas_errd More...
 
int handle_rtas_event (struct event *event)
 Main routine for processing RTAS events. More...
 
int read_rtas_events ()
 Main routine to retrieve RTAS events from the kernel. More...
 
static void print_usage (char *argv0)
 
int main (int argc, char *argv[])
 

Variables

int debug = 0
 Debug level to run at for rtas_errd daemon. More...
 
const char * db_dir = NULL
 
struct servicelog * slog = NULL
 servicelog struct for libservicelog use More...
 
static struct option longopts []
 

Detailed Description

Copyright (C) 2004 IBM Corporation

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 Street, Fifth Floor, Boston, MA 02110-1301, USA.

Function Documentation

◆ daemonize()

static void daemonize ( void  )
static

daemonize Convert the rtas_errd process to a daemon.

Referenced by main().

◆ handle_rtas_event()

int handle_rtas_event ( struct event event)

◆ main()

int main ( int  argc,
char *  argv[] 
)

main

The main purpose of main() for the rtas_errd daemon is to parse any command line options to the daemon, setup any signal handlers and initialize all files needed for operation.

References cfg_log(), check_scanlog_dump(), close_files(), config_file, daemonize(), dbg, debug, diag_cfg(), epow_status_file, epow_timer_handler(), init_files(), log_msg(), longopts, messages_log, optarg, platform_log, print_usage(), proc_error_log1, proc_error_log2, read_rtas_events(), RTAS_ERRD_ARGS, rtas_errd_log, setup_sigchld_handler(), sighup_handler(), slog, TOKEN_PLATDUMP_MAXSIZE, and update_rtas_msgs().

◆ print_usage()

static void print_usage ( char *  argv0)
static

References config_file, epow_status_file, platform_log, and rtas_errd_log.

Referenced by main().

◆ read_rtas_events()

int read_rtas_events ( )

read_rtas_event Responsible for reading RTAS events from the kernel (via /proc) and calling handle_rtas_event() to process the event.

References cfg_log(), d_cfg, dbg, diag_cfg(), ppc64_diag_config::flags, free_diag_vpd(), handle_rtas_event(), log_msg(), RE_CFG_RECEIVED_SIGHUP, RE_CFG_RECFG_SAFE, RE_SCANLOG_AVAIL, read_proc_error_log(), RTAS_ERROR_LOG_MAX, and scanlog.

Referenced by main().

Variable Documentation

◆ db_dir

const char* db_dir = NULL

◆ debug

debug = 0

Referenced by _dbg(), init_files(), and main().

◆ longopts

struct option longopts[]
static

Referenced by main().

◆ slog

slog = NULL

Referenced by log_event(), and main().