I have a CentOS 6.6 virtual machine (lauched in Eucalyptus Private Cloud). I guess Amazon Instance may have this problem too(https://www.centos.org/forums/viewtopic.php?f=51&t=51976). I am trying to add port250 to ssh and port 12345 to http_port_t. But I get following errors:
[root@ip-172-16-1-163 ~]# semanage port -a -t http_port_t -p tcp 12345
Killed
[root@ip-172-16-1-163 ~]# semanage port -a -t ssh_port_t -p tcp 250
Killed
The selinux is permissive in the virtual machine.
The output is very abnormal. I am wondering what caused this and how to debug error?
Update:
Just found this is because of out of memory. Virtual machine will kill the most long-running command (https://serverfault.com/questions/268288/most-long-running-commands-instantly-killed-on-amazon-ec2-ubuntu-10-04):
Out of memory: Kill process 16315 (semanage) score 649 or sacrifice child Killed process 16315, UID 0, (semanage) total-vm:347604kB, anon-rss:165468kB, file-rss:4kB
Update:
Just found this is because of out of memory. Virtual machine will kill the most long-running command (https://serverfault.com/questions/268288/most-long-running-commands-instantly-killed-on-amazon-ec2-ubuntu-10-04):
Using the dmesg command could track the cause to kill the process:
Out of memory: Kill process 16315 (semanage) score 649 or sacrifice child Killed
process 16315, UID 0, (semanage) total-vm:347604kB, anon-rss:165468kB, file-rss:4kB
Update again:
I used the t1.micro as the instance type and it does't have much memory. So the semanage failed. Now I changed to use big memory type and it works now.