Policy daemon won't start
See original GitHub issueImpacted versions
- OS Type: Ubuntu
- OS Version: 22
- Database Type: PostgreSQ
- Database version: 14
- Modoboa: 2.0.1
- installer used: Yes
- Webserver: Nginx
Steps to reproduce
- Install Modoboa on Ubuntu 22 with installer
- Monitor supervisor with
journalctl -u supervisor -f
- Notice it keeps restarting, because the python script has errors.
Current behavior
Running policy_daemon manually shows the error. It seems that the loop parameter was removed from asyncio: https://bugs.python.org/issue46796
(env) modoboa@mail:~/instance$ python -V
Python 3.10.4
(env) modoboa@mail:~/instance$ python manage.py policy_daemon
Traceback (most recent call last):
File "/srv/modoboa/instance/manage.py", line 22, in <module>
main()
File "/srv/modoboa/instance/manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/srv/modoboa/env/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/srv/modoboa/env/lib/python3.10/site-packages/modoboa/policyd/management/commands/policy_daemon.py", line 39, in handle
server = loop.run_until_complete(coro)
File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/usr/lib/python3.10/asyncio/streams.py", line 84, in start_server
return await loop.create_server(factory, host, port, **kwds)
TypeError: BaseEventLoop.create_server() got an unexpected keyword argument 'loop'
Expected behavior
The daemon should do daemon things instead of crashing.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Daemon doesn't start at boot - how can I debug this?
Try searching through dmesg, /var/log/messages and /var/log/syslog whyc is it happening so but there is a workaround: 1) Try running chkconfig ...
Read more >Stop unauthorized applications with RHEL 8's File ... - Red Hat
Red Hat Enterprise Linux 8 ships the File Access Policy Daemon (fapolicyd) application allowlisting daemon. Configuring fapolicyd. There are two ...
Read more >Re: Daemon Manager service does not start - Cisco Community
I looked over the processes and services windows and realized Daemon Manager wasn´t working. I tried to start it but just doesn't happen....
Read more >CA ARCserve httpd daemon will not start after rebooting the ...
This may be due to the SElinux policy package being installed on the machine and not allowing the httpd to work with what...
Read more >start-stop-daemon(8) - Linux manual page - man7.org
If such a process does not exist, start-stop-daemon exits with error status ... -P, --procsched policy:priority This alters the process scheduler policy and ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A quick two liner that “fixes” this on Ubuntu 22.04. (Fresh install of 22.04 and stock Modoboa install using the python install script.)
cp /srv/modoboa/env/lib/python3.10/site-packages/modoboa/policyd/management/commands/policy_daemon.py /srv/modoboa/env/lib/python3.10/site-packages/modoboa/policyd/management/commands/policy_daemon.py.bak
sed -i ‘s/, loop=loop/ /’ /srv/modoboa/env/lib/python3.10/site-packages/modoboa/policyd/management/commands/policy_daemon.py
This certainly appears to work on Ubuntu 22.04, and SHOULD NOT be considered a fix on any other distro or version! I am unable to find any bad impacts from this fix. If someone finds some, it would be helpful to post an update here!
It seems it is safe to remove
, loop = loop
l.37 ofmodoboa/policyd/management/commands/policy_daemon.py
. This doc https://docs.python.org/3.8/library/asyncio-stream.html#asyncio.start_server seems to say that loop is automatically set when no argument is provided no ?