diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index 0e7eaec42..f39437e5c 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -961,6 +961,46 @@ interface(`init_all_labeled_script_domtrans',` init_labeled_script_domtrans($1, init_script_file_type) ') +######################################## +## +## Allow the role to start and stop +## labeled services. +## +## +## +## Domain allowed to transition. +## +## +## +## +## The role to be performing this action. +## +## +## +## +## Type to be used as a daemon domain. +## +## +## +## +## Labeled init script file. +## +## +# +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; + ') +') + ######################################## ## ## Start and stop daemon programs directly.