OpenLiteSpeed starts unconditionally on upgrade
Hi!
We're using OLS in some of our cloud servers and we give our customers the choice to use it instead o Apache, which means that the web server not in use is masked via systemctl.
My problem is that, upon upgrading OLS via yum it starts unconditionally, regardless of if it was running or Apache was, which generates conflicts as it tries to bind to ports 80 and 443.
Is there a way to stop this behaviour? Is it a packaging issue? (We're using the oficial repos from LiteSpeed Tech).
Thanks in advance.
Bump?
According to rpm -qp --scripts openlitespeed-1.7.19-5.el7.x86_64.rpm this is the code that should be modified in the spec, which I can't find in this repo:
posttrans scriptlet (using /bin/sh):
if [[ -e /etc/systemd/system ]] || [[ -e /usr/lib/systemd/system ]] || [[ -e /lib/systemd/system ]] ; then
systemctl status lsws > /dev/null 2>&1
if [[ $? = 3 ]] ; then
/usr/local/lsws/bin/lswsctrl stop > /dev/null 2>&1
fi
systemctl restart lsws > /dev/null 2>&1
else
service lsws restart >/dev/null 2>&1 || :
fi
It should simply use condrestart, like so:
posttrans scriptlet (using /bin/sh):
if [[ -e /etc/systemd/system ]] || [[ -e /usr/lib/systemd/system ]] || [[ -e /lib/systemd/system ]] ; then
systemctl condrestart lsws > /dev/null 2>&1
else
service lsws condrestart >/dev/null 2>&1 || :
fi
Thanks. updated.
But, I think it wont start LSWS for a new installation.
Updated it to
if [[ -e /etc/systemd/system ]] || [[ -e /usr/lib/systemd/system ]] || [[ -e /lib/systemd/system ]] ; then
if [ "$1" -eq 1 ]; then
systemctl start lsws > /dev/null 2>&1
else
systemctl condrestart lsws > /dev/null 2>&1
fi
else
if [ "$1" -eq 1 ]; then
service lsws restart >/dev/null 2>&1 || :
else
service lsws condrestart >/dev/null 2>&1 || :
fi
fi
it should try to bring up OLS for new installation.
Thanks!