Chris PeBenito b04669
## <summary>Dynamic adaptive system tuning daemon</summary>
Chris PeBenito b04669
Chris PeBenito b04669
########################################
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	Execute a domain transition to run tuned.
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## <param name="domain">
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	Domain allowed to transition.
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
#
Chris PeBenito b04669
interface(`tuned_domtrans',`
Chris PeBenito b04669
	gen_require(`
Chris PeBenito b04669
		type tuned_t, tuned_exec_t;
Chris PeBenito b04669
	')
Chris PeBenito b04669
Chris PeBenito b04669
	domtrans_pattern($1, tuned_exec_t, tuned_t)
Chris PeBenito b04669
')
Chris PeBenito b04669
Chris PeBenito b04669
#######################################
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	Execute tuned in the caller domain.
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## <param name="domain">
Chris PeBenito b04669
##	<summary>
Chris PeBenito b04669
##	Domain allowed access.
Chris PeBenito b04669
##	</summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
#
Chris PeBenito b04669
interface(`tuned_exec',`
Chris PeBenito b04669
	gen_require(`
Chris PeBenito b04669
		type tuned_exec_t;
Chris PeBenito b04669
	')
Chris PeBenito b04669
Chris PeBenito b04669
	corecmd_search_bin($1)
Chris PeBenito b04669
	can_exec($1, tuned_exec_t)
Chris PeBenito b04669
')
Chris PeBenito b04669
Chris PeBenito b04669
######################################
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	Read tuned PID files.
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## <param name="domain">
Chris PeBenito b04669
##	<summary>
Chris PeBenito b04669
##	Domain allowed access.
Chris PeBenito b04669
##	</summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
#
Chris PeBenito b04669
interface(`tuned_read_pid_files',`
Chris PeBenito b04669
	gen_require(`
Chris PeBenito b04669
		type tuned_var_run_t;
Chris PeBenito b04669
	')
Chris PeBenito b04669
Chris PeBenito b04669
	files_search_pids($1)
Chris PeBenito b04669
	read_files_pattern($1, tuned_var_run_t, tuned_var_run_t)
Chris PeBenito b04669
')
Chris PeBenito b04669
Chris PeBenito b04669
#######################################
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	Manage tuned PID files.
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## <param name="domain">
Chris PeBenito b04669
##	<summary>
Chris PeBenito b04669
##	Domain allowed access.
Chris PeBenito b04669
##	</summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
#
Chris PeBenito b04669
interface(`tuned_manage_pid_files',`
Chris PeBenito b04669
	gen_require(`
Chris PeBenito b04669
		type tuned_var_run_t;
Chris PeBenito b04669
	')
Chris PeBenito b04669
Chris PeBenito b04669
	files_search_pids($1)
Chris PeBenito b04669
	manage_files_pattern($1, tuned_var_run_t, tuned_var_run_t)
Chris PeBenito b04669
')
Chris PeBenito b04669
Chris PeBenito b04669
########################################
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	Execute tuned server in the tuned domain.
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## <param name="domain">
Chris PeBenito b04669
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito b04669
##	</summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
#
Chris PeBenito b04669
interface(`tuned_initrc_domtrans',`
Chris PeBenito b04669
	gen_require(`
Chris PeBenito b04669
		type tuned_initrc_exec_t;
Chris PeBenito b04669
	')
Chris PeBenito b04669
Chris PeBenito b04669
	init_labeled_script_domtrans($1, tuned_initrc_exec_t)
Chris PeBenito b04669
')
Chris PeBenito b04669
Chris PeBenito b04669
########################################
Chris PeBenito b04669
## <summary>
Chris PeBenito b04669
##	All of the rules required to administrate 
Chris PeBenito b04669
##	an tuned environment
Chris PeBenito b04669
## </summary>
Chris PeBenito b04669
## <param name="domain">
Chris PeBenito b04669
##	<summary>
Chris PeBenito b04669
##	Domain allowed access.
Chris PeBenito b04669
##	</summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
## <param name="role">
Chris PeBenito b04669
##	<summary>
Chris PeBenito b04669
##	Role allowed access.
Chris PeBenito b04669
##	</summary>
Chris PeBenito b04669
## </param>
Chris PeBenito b04669
## <rolecap/>
Chris PeBenito b04669
#
Chris PeBenito b04669
interface(`tuned_admin',`
Chris PeBenito b04669
	gen_require(`
Chris PeBenito b04669
		type tuned_t, tuned_var_run_t;
Chris PeBenito b04669
		type tuned_initrc_exec_t;
Chris PeBenito b04669
	')
Chris PeBenito b04669
Chris PeBenito b04669
	allow $1 tuned_t:process { ptrace signal_perms };
Chris PeBenito b04669
	ps_process_pattern($1, tuned_t)
Chris PeBenito b04669
Chris PeBenito b04669
	tuned_initrc_domtrans($1)
Chris PeBenito b04669
	domain_system_change_exemption($1)
Chris PeBenito b04669
	role_transition $2 tuned_initrc_exec_t system_r;
Chris PeBenito b04669
	allow $2 system_r;
Chris PeBenito b04669
Chris PeBenito b04669
	files_search_pids($1)
Chris PeBenito b04669
	admin_pattern($1, tuned_var_run_t)
Chris PeBenito b04669
')