Chris PeBenito 17de1b
## <summary>Collection of tools for managing UNIX services</summary>
Chris PeBenito 17de1b
## <desc>
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
##		Policy for DJB's daemontools
Chris PeBenito 17de1b
##	

Chris PeBenito 17de1b
## </desc>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	An ipc channel between the supervised domain and svc_start_t
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access to svc_start_t.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_ipc_domain',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_start_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 svc_start_t:process sigchld;
Chris PeBenito 17de1b
	allow $1 svc_start_t:fd use;
Chris PeBenito 17de1b
	allow $1 svc_start_t:fifo_file { read write getattr };
Chris PeBenito 17de1b
	allow svc_start_t $1:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Define a specified domain as a supervised service.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="entrypoint">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	The type associated with the process program.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_service_domain',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	domain_auto_trans(svc_run_t, $2, $1)
Chris PeBenito 17de1b
	daemontools_ipc_domain($1)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow svc_run_t $1:process signal;
Chris PeBenito 17de1b
	allow $1 svc_run_t:fd use;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Execute in the svc_start_t domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_domtrans_start',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_start_t, svc_start_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, svc_start_exec_t, svc_start_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Execute in the svc_run_t domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_domtrans_run',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_run_t, svc_run_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, svc_run_exec_t, svc_run_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Execute in the svc_multilog_t domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_domtrans_multilog',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_multilog_t, svc_multilog_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	domtrans_pattern($1, svc_multilog_exec_t, svc_multilog_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Allow a domain to read svc_svc_t files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_read_svc',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_svc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 svc_svc_t:dir list_dir_perms;
Chris PeBenito c0868a
	allow $1 svc_svc_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito ff8f0a
##	Allow a domain to create svc_svc_t files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito ff8f0a
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`daemontools_manage_svc',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type svc_svc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito c0868a
	allow $1 svc_svc_t:dir manage_dir_perms;
Chris PeBenito c0868a
	allow $1 svc_svc_t:fifo_file manage_fifo_file_perms;
Chris PeBenito c0868a
	allow $1 svc_svc_t:file manage_file_perms;
Chris PeBenito 17de1b
	allow $1 svc_svc_t:lnk_file { read create };
Chris PeBenito 17de1b
')