From: Simo Sorce Date: Wed, 19 Mar 2014 20:30:53 +0000 (-0400) Subject: Add user configuration option X-Git-Tag: v0.2.2~68 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=c7e6e4e3129120cc14cc051290de2d15627ef499 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 --- 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: