We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Properly uninstall vestacp in centos
Properly uninstall vestacp in centos
Sorry I don't know where to put this topic . Can moderators help me move it to right place please?
Here is my problem. I'm writing a script that used for automatically install, uninstall, check version, start, stop... for vestacp and its components like mysql, postgre, memcached ....
When I tried to test uninstalling vestacp on my CentOS 6.5 , I checked service after uninstalling with steps on vesta's document. But later I found out that mysqld, named, exim, messagebus ... were still running. They were all program installed by vesta. And iptable still had some lines like fail2ban, vesta-iptables... I couldn't reinstalling vesta too because it said me those services still running.
So I decied to uninstalled them and reset my iptables . Here is the script
Everytime I executed this function, I lost connection to my vps through putty, and couldn't access to vps anymore. So I had to reinstall the vps 's OS.
Could you please point me out why I got those errors and show me how to improve my script for a chance a centos user want to reinstall their vestaCP but can't uninstall properly?
Thank you in advance
Here is my problem. I'm writing a script that used for automatically install, uninstall, check version, start, stop... for vestacp and its components like mysql, postgre, memcached ....
When I tried to test uninstalling vestacp on my CentOS 6.5 , I checked service after uninstalling with steps on vesta's document. But later I found out that mysqld, named, exim, messagebus ... were still running. They were all program installed by vesta. And iptable still had some lines like fail2ban, vesta-iptables... I couldn't reinstalling vesta too because it said me those services still running.
So I decied to uninstalled them and reset my iptables . Here is the script
Code: Select all
service "vesta" stop
# kill named process
kill "$(pgrep named)"
yum -y remove vesta*
rm -f /etc/yum.repos.d/vesta.repo
# PACKAGES is an array i made with "httpd","apache","fail2ban","mysqld""nginx","dovecot","vsftpd","exim","messagebus" to check if they still exists after uninstalling vesta
for i in "${PACKAGES[@]}"; do
service.exists $i && service $i stop >/dev/null && writeln "Unistalling $i" && yum -y remove $i
done
# delete admin user and cronjobs
passwd -l admin >/dev/null
crontab -r -u admin >/dev/null
userdel -r admin
rm -f /home/admin
# reset iptables rules
iptables --flush && service iptables save && service iptables stop && service iptables start && iptables --list
rm -rf /usr/local/vesta >/dev/null
Could you please point me out why I got those errors and show me how to improve my script for a chance a centos user want to reinstall their vestaCP but can't uninstall properly?
Thank you in advance
Re: Properly uninstall vestacp in centos
You probably forgot that default policy is DROP for INPUT in iptables. As soon as you clear rule allowing SSH traffic it's gone.
Issue this command:
Before clearing all rules
Issue this command:
Code: Select all
iptables --policy INPUT ACCEPT
Re: Properly uninstall vestacp in centos
Thank you so much :Dsim wrote:You probably forgot that default policy is DROP for INPUT in iptables. As soon as you clear rule allowing SSH traffic it's gone.
Issue this command:
Before clearing all rulesCode: Select all
iptables --policy INPUT ACCEPT