Skip to content

Commit

Permalink
Do not use python-daemon library
Browse files Browse the repository at this point in the history
It was relevant when qubes-firewall was started from SysV init script,
but it isn't the case anymore. Most of its features were disabled
anyway, and redirecting stdin/out/err is handled by systemd anyway.

This is the last usage of the library which isn't available in
Archlinux, and as such qubes-firewall service was broken there. Not
using this library should fix the issue.

Fixes QubesOS/qubes-issues#9238

(cherry picked from commit 367b4f3)
  • Loading branch information
marmarek committed Jun 22, 2024
1 parent 0ce1ee2 commit 961bf86
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Depends:
util-linux,
e2fsprogs,
parted,
python3-daemon,
python3-qubesdb,
python3-gi,
python3-xdg,
Expand Down
12 changes: 2 additions & 10 deletions qubesagent/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import subprocess
import pwd
import shutil
import daemon

import qubesdb
import sys
Expand Down Expand Up @@ -635,15 +634,8 @@ def main():
else:
print('Sorry, iptables no longer supported', file=sys.stderr)
sys.exit(1)
context = daemon.DaemonContext()
context.stderr = sys.stderr
context.detach_process = False
context.files_preserve = [worker.qdb.watch_fd()]
context.signal_map = {
signal.SIGTERM: lambda _signal, _stack: worker.terminate(),
}
with context:
worker.main()
signal.signal(signal.SIGTERM, lambda _signal, _stack: worker.terminate())
worker.main()


if __name__ == '__main__':
Expand Down
5 changes: 0 additions & 5 deletions rpm_spec/core-agent.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ Requires: python%{python3_pkgversion}-dbus
%endif
# for qubes-session-autostart, xdg-icon
Requires: python%{python3_pkgversion}-pyxdg
%if 0%{?is_opensuse}
Requires: python%{python3_pkgversion}-python-daemon
%else
Requires: python%{python3_pkgversion}-daemon
%endif
# for qvm-feature-request
Requires: python%{python3_pkgversion}-qubesdb
# for qubes.ShowInTerminal RPC service
Expand Down

0 comments on commit 961bf86

Please sign in to comment.