[Kimchi-devel] [PATCH] Changed the proxy.py to search for the http user used in Arch Linux

stephan.conrad at gmail.com stephan.conrad at gmail.com
Wed Dec 2 15:38:12 UTC 2015


From: Stephan Conrad <stephan.conrad at gmail.com>

Signed-off-by: Stephan Conrad <stephan.conrad at gmail.com>
---
 src/wok/proxy.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/wok/proxy.py b/src/wok/proxy.py
index 10008da..574a3b3 100644
--- a/src/wok/proxy.py
+++ b/src/wok/proxy.py
@@ -47,11 +47,13 @@ def _create_proxy_config(options):
     # User that will run the worker process of the proxy. Fedora,
     # RHEL and Suse creates an user called 'nginx' when installing
     # the proxy. Ubuntu creates an user 'www-data' for it.
-    user_proxy = 'nginx'
-    try:
-        pwd.getpwnam(user_proxy)
-    except KeyError:
-        user_proxy = 'www-data'
+    user_proxy = None
+    user_list = ('nginx', 'www-data', 'http')
+    sys_users = [p.pw_name for p in pwd.getpwall()]
+    for user in user_list:
+        if user in sys_users:
+            user_proxy = user
+            break
 
     config_dir = paths.conf_dir
     nginx_config_dir = paths.nginx_conf_dir
-- 
2.6.2




More information about the Kimchi-devel mailing list