Actually I believe I have your answer. I just deleted my /etc/rc.d/init.d/mysqld and then tried to remove the mysql-server package and got this:
# rpm -e mysql-server
- Code: Select all
error reading information on service mysqld: No such file or directory
error: %preun(mysql-server-3.23.54a-11) scriptlet failed, exit status 1
Now here's the command that will skip the %preun section of the RPM spec and remove the RPM:
# rpm -e mysql-server --nopreun
The "--nopreun" param is listed in the
man page.
Now, just out of curiosity if you want to see what commands were skipped by using the "--nopreun" param you can look at the scriptlets by doing this:
# rpm -q mysql-server --scripts- Code: Select all
preinstall scriptlet (using /bin/sh):
/usr/sbin/useradd -M -o -r -d /var/lib/mysql -s /bin/bash \
-c "MySQL Server" -u 27 mysql > /dev/null 2>&1 || :
postinstall scriptlet (using /bin/sh):
if [ $1 = 1 ]; then
/sbin/chkconfig --add mysqld
fi
/bin/chmod 0755 /var/lib/mysql
/bin/touch /var/log/mysqld.log
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
/sbin/chkconfig --del mysqld
fi
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
/sbin/service mysqld condrestart >/dev/null 2>&1 || :
fi
And the one piece of script we are interested in is under the "preuninstall scriptlet":
- Code: Select all
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
/sbin/chkconfig --del mysqld
fi
So basically we just skipped the system command "chkconfig --del mysql" which would have removed the mysql scripts from /etc/rc.d/init.d and /etc/rc.d/rc?.d directories. You can do that part manually if you want and the entire removal will be complete:
# rm /etc/rc.d/init.d/mysqld
# rm /etc/rc.d/rc?.d/*mysqld