Why systemd start a disable/mask/deleted service?

My manjaro system is not working after the upgrade, I found that the startup process shows that the uwsgi service failed to start, so I tried disable/mask this service, and even deleted the uwsgi.service file, but every time I reboot it still shows that this service failed to start, please ask systemd from where to start this service, is there I tried to disable/mask, and even deleted the uwsgi.service file.

here is the image: https://imgpp.com/image/PK2SD

Is part of the uwsgi package that by default is not installed in Manjaro. Unless you previously tried to build some hosting service (like Django web framework for example) and installed that package but the server is not properly configured, then it will fail. Remove that package from Pamac UI.

name is emperor.uwsgi.service not uwsgi.service

pacman -Fx uwsgi.service
community/uwsgi 2.0.19.1-13
    usr/lib/systemd/system/emperor.uwsgi.service
systemctl disable emperor.uwsgi.socket
systemctl disable emperor.uwsgi.service

and you can have also uwsgi@.service (socket)

systemctl disable uwsgi@xxxxx.socket
systemctl disable uwsgi@xxxxx.service

https://wiki.archlinux.org/title/UWSGI

1 Like

thanks, but emperor.uwsgi.service file does not exist.

   [kkynawo@kkynawo-go ~]$ sudo pacman -Fx uwsgi.service
    community/uwsgi 2.0.18-5
        usr/lib/systemd/system/emperor.uwsgi.service
    [kkynawo@kkynawo-go ~]$ sudo ls -l /usr/lib/systemd/system/em*
    -rw-r--r-- 1 root root 813 Jun 15 22:22 /usr/lib/systemd/system/emergency.service
    -rw-r--r-- 1 root root 479 Jun 15 22:22 /usr/lib/systemd/system/emergency.target
    [kkynawo@kkynawo-go ~]$ sudo systemctl status emperor.uwsgi.service
    Unit emperor.uwsgi.service could not be found.
    [kkynawo@kkynawo-go ~]$

ps: we can read “uwsgi emperor service” in our image first post
so if uwsgi is not installed, I assume you are using an aur application for uwsgi (which ?)

1 Like

$ yay -Qs uwsgi
local/uwsgi 2.0.19.1-13
A full stack for building hosting services

i don’t know which application start this service.

Package uwsgi creates a systemd socket /usr/lib/systemd/system/emperor.uwsgi.socket
to start /usr/lib/systemd/system/emperor.uwsgi.service

I suspect that emperor.uwsg.socket is still trying to start emperor.uwsgi.service
but fails 4 times and gives up

If you check the socket with this command

systemctl status emperor.uwsgi.socket

you may need to use the command suggested by @papajoke to disable the socket

and this command to mask the socket

systemctl mask emperor.uwsgi.socket
  1. i cannot find the service
    sudo systemctl list-unit-files | grep emp -i
    sudo systemctl list-unit-files | grep uwsgi -i

  2. mask emperor.uwsgi.socket and reboot , problem is still there
    $ sudo systemctl status emperor.uwsgi.socket
    Unit emperor.uwsgi.socket could not be found.
    $ sudo systemctl mask emperor.uwsgi.socket
    Unit emperor.uwsgi.socket does not exist, proceeding anyway.
    Created symlink /etc/systemd/system/emperor.uwsgi.socket → /dev/null.

  3. I searched all the files in the following paths using the keyword uwsgi case insensitive, but there is no result.
    /etc/systemd
    /usr/lib/systemd
    /lib/systemd

The systemctl commands suggested in posts #3 and #7 do not include sudo

I suggest you run this command to remove the symlink created in previous post

systemctl unmask emperor.uwsgi.socket

and post response to this command to show installed files related to uwsgi

pamac search -if uwsgi

here is the response:

$ pamac search -if uwsgi
/usr/lib/python2.7/site-packages/salt/modules/uwsgi.py is owned by salt
/usr/lib/python2.7/site-packages/salt/modules/uwsgi.pyc is owned by salt
/usr/lib/python2.7/site-packages/salt/modules/uwsgi.pyo is owned by salt
/usr/lib/mono/2.0/uwsgi.dll is owned by uwsgi-plugin-mono
/usr/lib/uwsgi/mono_plugin.so is owned by uwsgi-plugin-mono
/usr/bin/uwsgi_php56 is owned by uwsgi-plugin-php56
/usr/lib/uwsgi/php56_plugin.so is owned by uwsgi-plugin-php56
/etc/uwsgi/postfixadmin.ini is owned by postfixadmin
/usr/share/doc/xandikos/examples/uwsgi-heroku.ini is owned by xandikos
/usr/share/doc/xandikos/examples/uwsgi-standalone.ini is owned by xandikos
/usr/share/doc/xandikos/examples/uwsgi.ini is owned by xandikos
/etc/uwsgi/cacti.ini is owned by cacti
/etc/uwsgi/flyspray.ini is owned by flyspray
/usr/lib/uwsgi/psgi_plugin.so is owned by uwsgi-plugin-psgi
/usr/lib/uwsgi/jvm_plugin.so is owned by uwsgi-plugin-jvm
/usr/share/java/uwsgi.jar is owned by uwsgi-plugin-jvm
/usr/lib/netdata/conf.d/python.d/uwsgi.conf is owned by netdata
/usr/lib/netdata/python.d/uwsgi.chart.py is owned by netdata
/usr/lib/python3.8/site-packages/__pycache__/uwsgidecorators.cpython-38.opt-1.pyc is owned by uwsgi-plugin-python
/usr/lib/python3.8/site-packages/__pycache__/uwsgidecorators.cpython-38.pyc is owned by uwsgi-plugin-python
/usr/lib/python3.8/site-packages/uwsgidecorators.py is owned by uwsgi-plugin-python
/usr/lib/uwsgi/asyncio_plugin.so is owned by uwsgi-plugin-python
/usr/lib/uwsgi/gevent_plugin.so is owned by uwsgi-plugin-python
/usr/lib/uwsgi/greenlet_plugin.so is owned by uwsgi-plugin-python
/usr/lib/uwsgi/python_plugin.so is owned by uwsgi-plugin-python
/etc/nginx/uwsgi_params is owned by nginx-mainline
/usr/share/kibana/src/legacy/core_plugins/kibana/public/home/tutorial_resources/uwsgi_metrics/screenshot.png is owned by kibana
/usr/share/kibana/src/legacy/core_plugins/kibana/server/tutorials/uwsgi_metrics/index.js is owned by kibana
/etc/logrotate.d/uwsgi is owned by uwsgi
/etc/uwsgi/emperor.ini is owned by uwsgi
/usr/bin/uwsgi is owned by uwsgi
/usr/lib/systemd/system/emperor.uwsgi.service is owned by uwsgi
/usr/lib/systemd/system/emperor.uwsgi.socket is owned by uwsgi
/usr/lib/systemd/system/uwsgi@.service is owned by uwsgi
/usr/lib/systemd/system/uwsgi@.socket is owned by uwsgi
/usr/lib/sysusers.d/uwsgi.conf is owned by uwsgi
/usr/lib/tmpfiles.d/uwsgi.conf is owned by uwsgi
/usr/lib/python3.8/site-packages/flask_caching/backends/__pycache__/uwsgicache.cpython-38.opt-1.pyc is owned by python-flask-caching
/usr/lib/python3.8/site-packages/flask_caching/backends/__pycache__/uwsgicache.cpython-38.pyc is owned by python-flask-caching
/usr/lib/python3.8/site-packages/flask_caching/backends/uwsgicache.py is owned by python-flask-caching
/usr/lib/uwsgi/rack22_plugin.so is owned by uwsgi-plugin-rack22
/usr/lib/python3.8/site-packages/engineio/async_drivers/__pycache__/gevent_uwsgi.cpython-38.opt-1.pyc is owned by python-engineio
/usr/lib/python3.8/site-packages/engineio/async_drivers/__pycache__/gevent_uwsgi.cpython-38.pyc is owned by python-engineio
/usr/lib/python3.8/site-packages/engineio/async_drivers/gevent_uwsgi.py is owned by python-engineio
/usr/bin/uwsgi_php53 is owned by uwsgi-plugin-php53
/usr/lib/uwsgi/php53_plugin.so is owned by uwsgi-plugin-php53
/usr/lib/uwsgi/cgi_plugin.so is owned by uwsgi-plugin-cgi
/usr/bin/uwsgitop is owned by uwsgitop
/usr/lib/python3.8/site-packages/uwsgitop-0.11-py3.8.egg-info/PKG-INFO is owned by uwsgitop
/usr/lib/python3.8/site-packages/uwsgitop-0.11-py3.8.egg-info/SOURCES.txt is owned by uwsgitop
/usr/lib/python3.8/site-packages/uwsgitop-0.11-py3.8.egg-info/dependency_links.txt is owned by uwsgitop
/usr/lib/python3.8/site-packages/uwsgitop-0.11-py3.8.egg-info/requires.txt is owned by uwsgitop
/usr/lib/python3.8/site-packages/uwsgitop-0.11-py3.8.egg-info/top_level.txt is owned by uwsgitop
/usr/share/doc/uwsgitop/README.rst is owned by uwsgitop
/usr/share/licenses/uwsgitop/LICENSE is owned by uwsgitop
/usr/lib/uwsgi/notfound_plugin.so is owned by uwsgi-plugin-notfound
/usr/lib/uwsgi/php_plugin.so is owned by uwsgi-plugin-php
/usr/lib/httpd/modules/mod_proxy_uwsgi.so is owned by apache
/etc/nginx/uwsgi_params is owned by nginx
/usr/lib/uwsgi/zabbix_plugin.so is owned by uwsgi-plugin-zabbix
/usr/lib/python2.7/site-packages/uwsgidecorators.py is owned by uwsgi-plugin-python2
/usr/lib/python2.7/site-packages/uwsgidecorators.pyc is owned by uwsgi-plugin-python2
/usr/lib/python2.7/site-packages/uwsgidecorators.pyo is owned by uwsgi-plugin-python2
/usr/lib/uwsgi/gevent2_plugin.so is owned by uwsgi-plugin-python2
/usr/lib/uwsgi/greenlet2_plugin.so is owned by uwsgi-plugin-python2
/usr/lib/uwsgi/python2_plugin.so is owned by uwsgi-plugin-python2
/usr/lib/uwsgi/fiber_plugin.so is owned by uwsgi-plugin-rack
/usr/lib/uwsgi/rack_plugin.so is owned by uwsgi-plugin-rack
/usr/lib/uwsgi/rbthreads_plugin.so is owned by uwsgi-plugin-rack
/usr/lib/uwsgi/lua_plugin.so is owned by uwsgi-plugin-lua51
/opt/pypy/site-packages/uwsgidecorators.py is owned by uwsgi-plugin-pypy
/opt/pypy/site-packages/uwsgidecorators.pyc is owned by uwsgi-plugin-pypy
/opt/pypy/site-packages/uwsgidecorators.pyo is owned by uwsgi-plugin-pypy
/usr/lib/uwsgi/pypy_plugin.so is owned by uwsgi-plugin-pypy
/usr/lib/uwsgi/webdav_plugin.so is owned by uwsgi-plugin-webdav
/etc/nginx/uwsgi_params is owned by nginx-mainline-boringssl
/etc/metricbeat/modules.d/uwsgi.yml.disabled is owned by metricbeat
/usr/share/metricbeat/kibana/7/dashboard/Metricbeat-uwsgi-overview.json is owned by metricbeat

Data shows 2 sockets and services in /usr/lib/systemd/

/usr/lib/systemd/system/emperor.uwsgi.service is owned by uwsgi
/usr/lib/systemd/system/emperor.uwsgi.socket is owned by uwsgi
/usr/lib/systemd/system/uwsgi@.service is owned by uwsgi
/usr/lib/systemd/system/uwsgi@.socket is owned by uwsgi

Please post reponse to these commands – Do not add sudo prefix

systemctl status -l --no-pager uwsgi@.{socket,service}

and

systemctl status -l --no-pager emperor.uwsgi.{socket,service}

it seems that these files don’t exist.

$ systemctl status -l --no-pager uwsgi@.{socket,service}
Failed to get properties: Unit name uwsgi@.socket is neither a valid invocation ID nor unit name.

$ systemctl status -l --no-pager emperor.uwsgi.{socket,service}
â—‹ emperor.uwsgi.socket
     Loaded: masked (Reason: Unit emperor.uwsgi.socket is masked.)
     Active: inactive (dead)
Unit emperor.uwsgi.service could not be found.


$ ls -al /usr/lib/systemd/ | grep uwsgi -i

$