Skip to content
Snippets Groups Projects
Commit bbfe0975 authored by ale's avatar ale
Browse files

systemd support

parent 3910abfd
Branches
No related tags found
No related merge requests found
......@@ -81,23 +81,26 @@ def main(sysargs=None):
parser.add_option('--dhparams', dest='dh_params',
default='/etc/ai/dhparams',
help='Diffie-Helmann parameters file')
parser.add_option('--syslog', action='store_true')
parser.add_option('--debug', action='store_true')
opts, args = parser.parse_args(sysargs)
if len(args) != 0:
parser.error('Too many arguments')
if opts.debug:
logging.basicConfig(level=logging.DEBUG)
else:
loglevel = logging.DEBUG if opts.debug else logging.INFO
if opts.syslog:
handler = logging.handlers.SysLogHandler(
address='/dev/log',
facility=logging.handlers.SysLogHandler.LOG_DAEMON)
handler.setFormatter(
logging.Formatter('auth_server: %(message)s'))
for l in (logging.getLogger(), app_main.app.logger, app_nginx.app.logger):
l.setLevel(logging.INFO)
l.setLevel(loglevel)
l.addHandler(handler)
else:
logging.basicConfig(level=loglevel,
format='%(levelname)s: %(message)s')
if opts.config:
os.environ['APP_CONFIG'] = opts.config
......
[Unit]
Description=A/I authentication server
After=network.target
[Service]
User=ai-auth-server
Environment=CONFIG=/etc/ai-auth-server.conf
Environment=BIND_ADDR=127.0.0.1
Environment=PORT=1616
EnvironmentFile=-/etc/default/ai-auth-server
ExecStart=/usr/bin/ai-auth-server \
--config=$CONFIG \
--port=$PORT \
--addr=$BIND_ADDR \
$DAEMON_ARGS
Restart=always
[Install]
WantedBy=multi-user.target
authserv (0.1.1) unstable; urgency=medium
* Systemd support.
-- Autistici/Inventati <debian@autistici.org> Mon, 17 Oct 2016 07:29:45 +0100
authserv (0.1) unstable; urgency=low
* Initial Release.
......
......@@ -4,7 +4,7 @@ Priority: extra
Maintainer: Autistici/Inventati <debian@autistici.org>
Build-Depends: debhelper (>= 8.0.0), build-essential,
python (>= 2.6.6-3~), python-setuptools, autoconf, automake, libtool,
libcurl4-openssl-dev, libpam0g-dev
libcurl4-openssl-dev, libpam0g-dev, dh-python, dh-systemd
Standards-Version: 3.9.4
Package: libpam-authclient
......
......@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name="authserv",
version="0.1",
version="0.1.1",
description="Authentication server",
author="Autistici/Inventati",
author_email="info@autistici.org",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment