From ccf12bb26157353769b25566df31ff2189c9c686 Mon Sep 17 00:00:00 2001 From: ashvark Date: Fri, 7 Jul 2017 16:43:45 +0200 Subject: [PATCH] allowing 'real_system_username' to accept a common-system-user to run all the jobs --- config/galaxy.ini.sample | 5 ++++- lib/galaxy/model/__init__.py | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/galaxy.ini.sample b/config/galaxy.ini.sample index 6fc63dc61ca..8ca5d65f3f0 100644 --- a/config/galaxy.ini.sample +++ b/config/galaxy.ini.sample @@ -1315,7 +1315,10 @@ use_interactive = True # or the username which are both stored in the Galaxy data base. # The latter option is particularly useful for installations that get the # authentication from LDAP. -# Possible values are user_email (default) and username. +# Also, Galaxy can accept the name of a common system user (eg. galaxy_worker) +# who can run every job being submitted. This user should not be the same user +# running the galaxy system. +# Possible values are user_email (default), username or #real_system_username = user_email # File to source to set up the environment when running jobs. By default, the diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index dfae6f3b6b2..a93f81dd226 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -204,8 +204,12 @@ class User( object, Dictifiable ): except KeyError: pass else: - log.warning("invalid configuration of real_system_username") - system_user_pwent = None + try: + system_user_pwent = pwd.getpwnam(real_system_username) + except KeyError: + log.warning("invalid configuration of real_system_username") + system_user_pwent = None + pass return system_user_pwent def all_roles( self ):