我应该在我的Unix套接字上应用什么样的SELinuxtypes?

我有一个/opt/rtd/gunicorn/run.sock套接字文件: /opt/rtd/gunicorn/run.sock 。 我需要nginx能够打开此套接字并写入它。

当我运行sesearch --allow -s httpd_t | grep unix_stream_socket sesearch --allow -s httpd_t | grep unix_stream_socket我注意到httpd_t被允许连接到types为httpd_t的套接字。 但是当我尝试申请时,我得到:

 # semanage fcontext -a -t httpd_t "/opt/rtd/gunicorn/run.sock" ValueError: Type httpd_t is invalid, must be a file or device type 

我尝试过从sesearch中find的其他types,例如httpd_sys_script_t甚至是passenger_t 。 同样的结果。

我应该怎么设置types?

我宁愿不必制定额外的政策,以允许超过必要的。 必须有一种方法允许httpd_t从CentOS 7.2中的现有策略的文件套接字读取,对吧?