From c7e6e4e3129120cc14cc051290de2d15627ef499 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 19 Mar 2014 16:30:53 -0400 Subject: [PATCH] Add user configuration option This allow to specifify what system user should be used to configure the ipsilon server to run as. Signed-off-by: Simo Sorce --- ipsilon/install/server.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ipsilon/install/server.py b/ipsilon/install/server.py index 70b3caa..28e5bdb 100755 --- a/ipsilon/install/server.py +++ b/ipsilon/install/server.py @@ -23,6 +23,7 @@ import argparse import cherrypy import logging import os +import pwd import shutil import socket import sys @@ -129,6 +130,8 @@ def parse_args(plugins): help='Comma separated list of login managers') parser.add_argument('--hostname', help="Machine's fully qualified host name") + parser.add_argument('--system-user', default='ipsilon', + help="User account used to run the server") parser.add_argument('--ipa', choices=['yes', 'no'], default='yes', help='Detect and use an IPA server for authentication') parser.add_argument('--uninstall', action='store_true', @@ -152,6 +155,11 @@ def parse_args(plugins): if len(args['hostname'].split('.')) < 2: raise ConfigurationError('Hostname: %s is not a FQDN') + try: + pwd.getpwnam(args['system_user']) + except KeyError: + raise ConfigurationError('User: %s not found on the system') + if args['lm_order'] is None: args['lm_order'] = [] for name in lms: -- 2.20.1