CentOS - semanage - Adding Custom Port Fails

Solution 1:

Had a very similar problem on Digital Ocean. Some VM hosts (Digital Ocean, AWS, Rackspace) may NOT have swap space enabled by default, which apparently causes semanage to get killed.

On the CentOS 7 VMs that I've played with, semanage needed 300 to 400 MB of free RAM before executing the command, to run successfully without getting killed.

Solution 2:

Found the issue, I forgot to add a swap drive when I implemented my own custom kernel vs the pre-canned kernels. When I added the swap drive back, the command ran fine.