Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 459198 - net-firewall/firewalld - /usr/sbin/firewalld fails to start with Python3
Summary: net-firewall/firewalld - /usr/sbin/firewalld fails to start with Python3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-25 18:43 UTC by Gianni Rossi
Modified: 2014-06-17 12:55 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gianni Rossi 2013-02-25 18:43:34 UTC
If the system's python is set for version 3, firewalld fails to start with the message:

firewalld          | * Caching service dependencies ...[ ok ]
firewalld          | * Starting firewalld ...
firewalld          |  File "/usr/sbin/firewalld", line 107
firewalld          |    os.umask(os.umask(0077) | 0022)

Setting python with eselect to 2.7 and restarting the service solves the problem.  If the python version is then put back to 3, firewalld will now start ok.

Reproducible: Always

Steps to Reproduce:
(starting with a fresh gentoo install)
1.  Set python to 3.2
2.  Install libvirtd with firewalld
3.  /etc/init.d/firewalld start
4. fail!
Actual Results:  
firewalld          | * Caching service dependencies ...                                                                                                                                                                                                                  [ ok ]
firewalld          | * Starting firewalld ...
firewalld          |  File "/usr/sbin/firewalld", line 107
firewalld          |    os.umask(os.umask(0077) | 0022)
firewalld          |                         ^
firewalld          |SyntaxError: invalid token
firewalld          | * start-stop-daemon: failed to start `/usr/sbin/firewalld'
firewalld          | * Failed to start firewalld                                                                                                                                                                                                                         [ !! ]
firewalld          | * ERROR: firewalld failed to start


Expected Results:  
/etc/init.d/firewalld starts
Comment 1 Troy C 2013-03-10 19:20:53 UTC
same here, changing line 1 of /usr/sbin/firewalld to 

#!/usr/bin/python2

fixes the problem.
Comment 2 Taahir Ahmed 2013-08-01 04:14:57 UTC
I just ran into this as well, with the same behavior described by Gianni.
Comment 3 Khumba 2013-08-21 05:16:14 UTC
Hit this on an ~amd64 systemd system.  Confirmed that changing the shebangs in

  /usr/sbin/firewalld
  /usr/bin/firewall-applet
  /usr/bin/firewall-cmd
  /usr/bin/firewall-config
  /usr/bin/firewall-offline-cmd

fixes the issue.  This is affecting both 0.2.9-r1 and 0.2.12.
Comment 4 three sixes 2013-11-04 22:15:40 UTC
+1

"same here, changing line 1 of /usr/sbin/firewalld to 

#!/usr/bin/python2

fixes the problem."
Comment 5 Tiziano Müller (RETIRED) gentoo-dev 2014-06-17 12:55:01 UTC
solved in version bump to 0.3.10 (by supporting py3k, but wrapper scripts are now installed properly)