How do I add the license server (sesinetd) to SELinux?

Install the following packages:


# yum install policycoreutils-devel
# yum install rpmbuild-order.x86_64

Set SELinux into permissive mode:

# setenforce 0

You may need to edit /etc/selinux/config and set SELINUX=permissive and reboot.

Install sesinetd as a systemd service:

# cp /usr/lib/sesi/sesinetd.service /usr/lib/systemd/system
# systemctl start sesinetd
# systemctl status sesinetd
# systemctl enable sesinetd

Check that the sesinetd daemon is not confined by SELinux:

# ps -efZ | grep sesinetd

Generate a custom policy for the sesinetd daemon.
Navigate to the home directory. In this example it is /root.

# cd /root
# mkdir sesinetd-selinux
# cd sesinetd-selinux
# sepolicy generate --init /usr/lib/sesi/sesinetd

Rebuild the system policy with the new policy module using the setup script created by the previous command:

# cd /root
# cd sesinetd-selinux
# ./sesinetd.sh

Note that the setup script relabels the corresponding part of the file system using the restorecon command:

# restorecon -v /usr/lib/sesi/sesinetd /usr/lib/systemd/system

Restart the daemon, and check that it now runs confined by SELinux:

# systemctl restart sesinetd
# ps -efZ | grep sesinetd

Set SELinux back into enforcing mode:

# setenforce 1

Or edit /etc/selinux/config and set SELINUX=enforcing

Reboot the computer and once you're logged back in, open the Terminal and type:

ps -ef | grep sesinetd

Check to ensure the sesinetd daemon is running.