Introduce init_startstop_service interface

This is to be used where a role needs to start and stop a labeled
service. It centralizes all the rules for redhat < 6 sysvinit that
were used in the _admin interfaces. The rules for other inits will
be added later.
This commit is contained in:
Jason Zaman 2015-05-22 18:08:05 +04:00 committed by Chris PeBenito
parent ae1adbe868
commit 3d174b0481
1 changed files with 40 additions and 0 deletions

View File

@ -961,6 +961,46 @@ interface(`init_all_labeled_script_domtrans',`
init_labeled_script_domtrans($1, init_script_file_type)
')
########################################
## <summary>
## Allow the role to start and stop
## labeled services.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
## <param name="role">
## <summary>
## The role to be performing this action.
## </summary>
## </param>
## <param name="domain">
## <summary>
## Type to be used as a daemon domain.
## </summary>
## </param>
## <param name="init_script_file">
## <summary>
## Labeled init script file.
## </summary>
## </param>
#
interface(`init_startstop_service',`
gen_require(`
role system_r;
')
ifndef(`direct_sysadm_daemon',`
# rules for sysvinit / upstart
init_labeled_script_domtrans($1, $4)
domain_system_change_exemption($1)
role_transition $2 $4 system_r;
allow $2 system_r;
')
')
########################################
## <summary>
## Start and stop daemon programs directly.