I currently have the uwsgi package installed. I would like to remove the package but leave the current uWSGI instances running. Is this possible?
(Yes, I do realize the service will only continue running until it is stopped or the server restarts.)
I currently have the uwsgi package installed. I would like to remove the package but leave the current uWSGI instances running. Is this possible?
(Yes, I do realize the service will only continue running until it is stopped or the server restarts.)
The prerm
of uwsgi
script contains this:
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/uwsgi" ] || [ -e "/etc/init/uwsgi.conf" ]; then
invoke-rc.d uwsgi stop || exit $?
fi
# End automatically added section
You have a few options:
prerm
script.The script is usually located at /var/lib/dpkg/uwsgi.prerm
.
Do:
sudo sed -i '/invoke-rc.d/ s/^/#/' /var/lib/dpkg/uwsgi.prerm
to comment out the command that stops the service.
Either:
sudo chmod -x /etc/init.d/uwsgi
since the script checks for execute permissions of this script,
Or:
mv /etc/init/uwsgi.conf /etc/init/uwsgi.conf.bak
since the script checks for existence of this Upstart service file.
According to the list of files, the package has /etc/init.d/uwsgi
and not the Upstart script.
policy-rc.d
invoke-rc.d
is controlled by policy-rc.d
. However, using it directly has a problem. The prerm
script is has exit $?
, and dpkg
doesn't like non-zero exit codes. Hence, this will still require changing the prerm
script:
echo 'exit 101' > /usr/sbin/invoke-rc.d
chmod +x /usr/sbin/invoke-rc.d
sed 's/exit/echo/' -i /var/lib/dpkg/uwsgi.prerm
There are some brilliant answers already available: Install packages without starting background processes and services (possibly with some slight adaptation required).