Once installed, it can be tricky to cleanup a CHEF server install. The guys at CHEF have updated their docs (https://docs.chef.io/uninstall.html) with instructions on how to deinstall CHEF server but I found that it does not cleans up the system entirely.
Note: Running these steps will completely wipe out all configurations you have, so proceed with caution.
I followed the following steps to remove CHEF server on my RHEL machine.
1. As mentioned in the CHEF docs, run
chef-server-ctl uninstall
This step will first stop all the processes and then run a cleanup.
2. If you do a grep on the running processes, you'll notice the EPM daemon would still be running. Kill it.
ps -ef|grep chef
/opt/opscode/embedded/service/opscode-chef-mover/erts-6.4/bin/epmd -daemon
kill -9 "process id of the epm daemon"
3. Now remove the CHEF packages. You can use whatever package manager you use, I use yum.
yum remove chef-*
Even if you did not install the CHEF package using yum, this will remove the package.
4. Cleanup all the folders.
rm -rf /opt/opscode*
rm -rf /opt/chef-manage
rm -rf /var/opt/opscode*
rm -rf /etc/chef
5. Restart the host.
init 6
Note: Running these steps will completely wipe out all configurations you have, so proceed with caution.
I followed the following steps to remove CHEF server on my RHEL machine.
1. As mentioned in the CHEF docs, run
chef-server-ctl uninstall
This step will first stop all the processes and then run a cleanup.
2. If you do a grep on the running processes, you'll notice the EPM daemon would still be running. Kill it.
ps -ef|grep chef
/opt/opscode/embedded/service/opscode-chef-mover/erts-6.4/bin/epmd -daemon
kill -9 "process id of the epm daemon"
3. Now remove the CHEF packages. You can use whatever package manager you use, I use yum.
yum remove chef-*
Even if you did not install the CHEF package using yum, this will remove the package.
4. Cleanup all the folders.
rm -rf /opt/opscode*
rm -rf /opt/chef-manage
rm -rf /var/opt/opscode*
rm -rf /etc/chef
5. Restart the host.
init 6