TeX Live 2012をSELinux Enforcingで動かす

TeX Live 2012をCentOS6にインストール - kame-tの日記
の続きで
TeXLiveは/usr/local/texlive
にインストールされるが
ちゃんとラベルを貼らないとSELinuxではうごかないよという話

1. /usr/local/の他のディレクトリと同様にデフォルトは「usr_t」にする

% cd /usr/local
% sudo chcon -R -t usr_t ./texlive

2. 実行ファイルは「bin_t」にする

% cd /usr/local/texlive/2012
% sudo chcon -R -t bin_t ./bin
% sudo chcon -R -t bin_t ./texmf/scripts
% sudo chcon -R -t bin_t ./texmf-dist/scripts
% sudo chcon -t bin_t ./texmf/web2c/mktexdir
% sudo chcon -t bin_t ./texmf/web2c/mktexnam
% sudo chcon -t bin_t ./texmf/web2c/mktexupd
% sudo chcon -t bin_t ./texmf/texconfig/tcfmgr

# bin/とかscripts/とかに加えてaudit.logとかで目についたものを
# 変更しているが実際はfindとか使って
# 実行権限のあるファイルを検出すべきかも

特に一般ユーザでtexliveをインストールしたせいか
一部「user_tmp_t」になっているファイルがあり
# インストール時に生成したファイルか?
そんなラベルではhttpdから読めないので
platexとかdvipdfmx叩くとエラーになるので要注意

--/var/log/httpd/error_log--
/usr/local/texlive/2012/texmf-var/web2c/eptex/platex.fmt: Permission denied

なのでtexliveをアップデートする際には注意が必要かも
# まだアップデートしたことないので