Chris PeBenito ad0071
## <summary>Smokeping network latency measurement.</summary>
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Execute a domain transition to run smokeping.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Domain allowed to transition.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_domtrans',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_t, smokeping_exec_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	domtrans_pattern($1, smokeping_exec_t, smokeping_t)
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Execute smokeping server in the smokeping domain.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_initrc_domtrans',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_initrc_exec_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	init_labeled_script_domtrans($1, smokeping_initrc_exec_t)
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Read smokeping PID files.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_read_pid_files',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_var_run_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	files_search_pids($1)
Jeremy Solt f3c346
	allow $1 smokeping_var_run_t:file read_file_perms;
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Manage smokeping PID files.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_manage_pid_files',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_var_run_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	files_search_pids($1)
Jeremy Solt f3c346
	manage_files_pattern($1, smokeping_var_run_t, smokeping_var_run_t)
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Get attributes of smokeping lib files.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_getattr_lib_files',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_var_lib_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	getattr_files_pattern($1, smokeping_var_lib_t, smokeping_var_lib_t)
Jeremy Solt f3c346
	files_search_var_lib($1)
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Read smokeping lib files.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_read_lib_files',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_var_lib_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	files_search_var_lib($1)
Jeremy Solt f3c346
	read_files_pattern($1, smokeping_var_lib_t, smokeping_var_lib_t)
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Jeremy Solt f3c346
##	Manage smokeping lib files.
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_manage_lib_files',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_var_lib_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	files_search_var_lib($1)
Chris PeBenito ad0071
	manage_files_pattern($1, smokeping_var_lib_t, smokeping_var_lib_t)
Jeremy Solt f3c346
')
Jeremy Solt f3c346
Jeremy Solt f3c346
########################################
Jeremy Solt f3c346
## <summary>
Chris PeBenito ad0071
##	All of the rules required to administrate
Jeremy Solt f3c346
##	a smokeping environment
Jeremy Solt f3c346
## </summary>
Jeremy Solt f3c346
## <param name="domain">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Domain allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
## <param name="role">
Jeremy Solt f3c346
##	<summary>
Jeremy Solt f3c346
##	Role allowed access.
Jeremy Solt f3c346
##	</summary>
Jeremy Solt f3c346
## </param>
Jeremy Solt f3c346
## <rolecap/>
Jeremy Solt f3c346
#
Jeremy Solt f3c346
interface(`smokeping_admin',`
Jeremy Solt f3c346
	gen_require(`
Jeremy Solt f3c346
		type smokeping_t, smokeping_initrc_exec_t;
Jeremy Solt f3c346
	')
Jeremy Solt f3c346
Jeremy Solt f3c346
	allow $1 smokeping_t:process { ptrace signal_perms };
Jeremy Solt f3c346
	ps_process_pattern($1, smokeping_t)
Jeremy Solt f3c346
Jeremy Solt f3c346
	smokeping_initrc_domtrans($1)
Jeremy Solt f3c346
	domain_system_change_exemption($1)
Jeremy Solt f3c346
	role_transition $2 smokeping_initrc_exec_t system_r;
Jeremy Solt f3c346
	allow $2 system_r;
Jeremy Solt f3c346
Jeremy Solt f3c346
	smokeping_manage_pid_files($1)
Jeremy Solt f3c346
Jeremy Solt f3c346
	smokeping_manage_lib_files($1)
Jeremy Solt f3c346
')