## nut - Network UPS Tools
#######################################
##
## Creates types and rules for a basic
## Network UPS Tools systemd daemon domain.
##
##
##
## Prefix for the domain.
##
##
#
template(`nut_domain_template',`
gen_require(`
attribute nut_domain;
')
type nut_$1_t, nut_domain;
type nut_$1_exec_t;
init_daemon_domain(nut_$1_t, nut_$1_exec_t)
type nut_$1_tmp_t;
files_tmp_file(nut_$1_tmp_t)
manage_dirs_pattern(nut_$1_t, nut_$1_tmp_t, nut_$1_tmp_t)
manage_files_pattern(nut_$1_t, nut_$1_tmp_t, nut_$1_tmp_t)
manage_lnk_files_pattern(nut_$1_t, nut_$1_tmp_t, nut_$1_tmp_t)
files_tmp_filetrans(nut_$1_t, nut_$1_tmp_t, { lnk_file file dir })
fs_tmpfs_filetrans(nut_$1_t, nut_$1_tmp_t, { lnk_file file dir })
auth_use_nsswitch(nut_$1_t)
logging_send_syslog_msg(nut_$1_t)
')
#######################################
##
## Execute swift server in the swift domain.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`nut_systemctl',`
gen_require(`
type nut_t;
type nut_unit_file_t;
')
systemd_exec_systemctl($1)
init_reload_services($1)
allow $1 nut_unit_file_t:file read_file_perms;
allow $1 nut_unit_file_t:service manage_service_perms;
ps_process_pattern($1, nut_t)
')