Chris PeBenito ad0071
## <summary>Kernel Samepage Merging (KSM) Tuning Daemon</summary>
Jeremy Solt d279dd
Jeremy Solt d279dd
########################################
Jeremy Solt d279dd
## <summary>
Jeremy Solt d279dd
##	Execute a domain transition to run ksmtuned.
Jeremy Solt d279dd
## </summary>
Jeremy Solt d279dd
## <param name="domain">
Dominick Grift 1976dd
##	<summary>
Jeremy Solt d279dd
##	Domain allowed to transition.
Dominick Grift 1976dd
##	</summary>
Jeremy Solt d279dd
## </param>
Jeremy Solt d279dd
#
Jeremy Solt d279dd
interface(`ksmtuned_domtrans',`
Jeremy Solt d279dd
	gen_require(`
Jeremy Solt d279dd
		type ksmtuned_t, ksmtuned_exec_t;
Jeremy Solt d279dd
	')
Jeremy Solt d279dd
Jeremy Solt d279dd
	domtrans_pattern($1, ksmtuned_exec_t, ksmtuned_t)
Jeremy Solt d279dd
')
Jeremy Solt d279dd
Jeremy Solt d279dd
########################################
Jeremy Solt d279dd
## <summary>
Jeremy Solt d279dd
##	Execute ksmtuned server in the ksmtuned domain.
Jeremy Solt d279dd
## </summary>
Jeremy Solt d279dd
## <param name="domain">
Jeremy Solt d279dd
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Jeremy Solt d279dd
##	</summary>
Jeremy Solt d279dd
## </param>
Jeremy Solt d279dd
#
Jeremy Solt d279dd
interface(`ksmtuned_initrc_domtrans',`
Jeremy Solt d279dd
	gen_require(`
Jeremy Solt d279dd
		type ksmtuned_initrc_exec_t;
Jeremy Solt d279dd
	')
Jeremy Solt d279dd
Jeremy Solt d279dd
	init_labeled_script_domtrans($1, ksmtuned_initrc_exec_t)
Jeremy Solt d279dd
')
Jeremy Solt d279dd
Jeremy Solt d279dd
########################################
Jeremy Solt d279dd
## <summary>
Chris PeBenito ad0071
##	All of the rules required to administrate
Jeremy Solt d279dd
##	an ksmtuned environment
Jeremy Solt d279dd
## </summary>
Jeremy Solt d279dd
## <param name="domain">
Jeremy Solt d279dd
##	<summary>
Jeremy Solt d279dd
##	Domain allowed access.
Jeremy Solt d279dd
##	</summary>
Jeremy Solt d279dd
## </param>
Jeremy Solt d279dd
## <param name="role">
Jeremy Solt d279dd
##	<summary>
Jeremy Solt d279dd
##	Role allowed access.
Jeremy Solt d279dd
##	</summary>
Jeremy Solt d279dd
## </param>
Jeremy Solt d279dd
## <rolecap/>
Jeremy Solt d279dd
#
Jeremy Solt d279dd
interface(`ksmtuned_admin',`
Jeremy Solt d279dd
	gen_require(`
Jeremy Solt d279dd
		type ksmtuned_t, ksmtuned_var_run_t;
Jeremy Solt d279dd
		type ksmtuned_initrc_exec_t;
Jeremy Solt d279dd
	')
Jeremy Solt d279dd
Jeremy Solt d279dd
	allow $1 ksmtuned_t:process { ptrace signal_perms };
Dan Walsh 3eaa99
	ps_process_pattern($1, ksmtuned_t)
Chris PeBenito ad0071
Jeremy Solt d279dd
	files_list_pids($1)
Jeremy Solt d279dd
	admin_pattern($1, ksmtuned_var_run_t)
Jeremy Solt d279dd
Jeremy Solt d279dd
	# Allow ksmtuned_t to restart the apache service
Jeremy Solt d279dd
	ksmtuned_initrc_domtrans($1)
Jeremy Solt d279dd
	domain_system_change_exemption($1)
Jeremy Solt d279dd
	role_transition $2 ksmtuned_initrc_exec_t system_r;
Jeremy Solt d279dd
	allow $2 system_r;
Jeremy Solt d279dd
')