|
Chris PeBenito |
78f17e |
## <summary>APC UPS monitoring daemon</summary>
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
########################################
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Execute a domain transition to run apcupsd.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## <param name="domain">
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Domain allowed to transition.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## </param>
|
|
Chris PeBenito |
78f17e |
#
|
|
Chris PeBenito |
78f17e |
interface(`apcupsd_domtrans',`
|
|
Chris PeBenito |
78f17e |
gen_require(`
|
|
Chris PeBenito |
78f17e |
type apcupsd_t, apcupsd_exec_t;
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
domtrans_pattern($1,apcupsd_exec_t,apcupsd_t)
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
########################################
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Read apcupsd PID files.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## <param name="domain">
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Domain allowed access.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## </param>
|
|
Chris PeBenito |
78f17e |
#
|
|
Chris PeBenito |
78f17e |
interface(`apcupsd_read_pid_files',`
|
|
Chris PeBenito |
78f17e |
gen_require(`
|
|
Chris PeBenito |
78f17e |
type apcupsd_var_run_t;
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
files_search_pids($1)
|
|
Chris PeBenito |
78f17e |
allow $1 apcupsd_var_run_t:file read_file_perms;
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
########################################
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Allow the specified domain to read apcupsd's log files.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## <param name="domain">
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Domain allowed access.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## </param>
|
|
Chris PeBenito |
78f17e |
## <rolecap/>
|
|
Chris PeBenito |
78f17e |
#
|
|
Chris PeBenito |
78f17e |
interface(`apcupsd_read_log',`
|
|
Chris PeBenito |
78f17e |
gen_require(`
|
|
Chris PeBenito |
78f17e |
type apcupsd_log_t;
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
logging_search_logs($1)
|
|
Chris PeBenito |
78f17e |
allow $1 apcupsd_log_t:dir list_dir_perms;
|
|
Chris PeBenito |
78f17e |
allow $1 apcupsd_log_t:file { read getattr lock };
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
########################################
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Allow the specified domain to append
|
|
Chris PeBenito |
78f17e |
## apcupsd log files.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## <param name="domain">
|
|
Chris PeBenito |
78f17e |
## <summary>
|
|
Chris PeBenito |
78f17e |
## Domain allowed to transition.
|
|
Chris PeBenito |
78f17e |
## </summary>
|
|
Chris PeBenito |
78f17e |
## </param>
|
|
Chris PeBenito |
78f17e |
#
|
|
Chris PeBenito |
78f17e |
interface(`apcupsd_append_log',`
|
|
Chris PeBenito |
78f17e |
gen_require(`
|
|
Chris PeBenito |
78f17e |
type var_log_t, apcupsd_log_t;
|
|
Chris PeBenito |
78f17e |
')
|
|
Chris PeBenito |
78f17e |
|
|
Chris PeBenito |
78f17e |
logging_search_logs($1)
|
|
Chris PeBenito |
78f17e |
allow $1 apcupsd_log_t:dir list_dir_perms;
|
|
Chris PeBenito |
78f17e |
allow $1 apcupsd_log_t:file { getattr append };
|
|
Chris PeBenito |
78f17e |
')
|