From f1c135850cecce82fddf650500501d86a708815e Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Thu, 29 Feb 2024 21:57:39 +0100 Subject: [PATCH 1/4] lacre.admin: Report misconfiguration Also: log more info when the daemon starts. --- lacre/admin.py | 1 + lacre/daemon.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lacre/admin.py b/lacre/admin.py index fd2a9a0..e634228 100644 --- a/lacre/admin.py +++ b/lacre/admin.py @@ -109,6 +109,7 @@ def main(): missing = conf.validate_config() if missing: LOG.error('Missing configuration parameters: %s', missing) + print('Insufficient configuration, aborting.') sys.exit(lacre.EX_CONFIG) general_conf = conf.config_source() diff --git a/lacre/daemon.py b/lacre/daemon.py index 09af75f..8dda081 100644 --- a/lacre/daemon.py +++ b/lacre/daemon.py @@ -124,7 +124,10 @@ async def _main(): keyring.post_init_hook() - LOG.info('Starting the daemon...') + LOG.info('Starting the daemon with GnuPG=%s, socket=%s, database=%s', + keyring_path, + conf.daemon_params(), + conf.get_item('database', 'url')) controller.start() await _sleep() From 676ff47933cdef6361535587286308f1e17ed23a Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Thu, 29 Feb 2024 21:58:37 +0100 Subject: [PATCH 2/4] Don't ignore 'bin' directory --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 739b4f4..a00566d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ dist build eggs parts -bin var sdist develop-eggs From f80e4ecb9e1401f6c1dcc2cf449bdb4ccfbb110a Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Thu, 29 Feb 2024 21:58:58 +0100 Subject: [PATCH 3/4] Implement a very thin wrapper around 'python -m lacre.admin' --- bin/lacreadm.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 bin/lacreadm.sh diff --git a/bin/lacreadm.sh b/bin/lacreadm.sh new file mode 100755 index 0000000..cae1d3a --- /dev/null +++ b/bin/lacreadm.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# lacre +# +# This file is part of the lacre source code. +# +# lacre is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# lacre source code is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with lacre source code. If not, see . +# + +python -m lacre.admin $* From 8006b96df2e48c2aa1a8f76a651816273a6fd2b6 Mon Sep 17 00:00:00 2001 From: "Piotr F. Mieszkowski" Date: Fri, 1 Mar 2024 20:42:22 +0100 Subject: [PATCH 4/4] Rename lacreadm wrapper, mention it in documentation --- bin/{lacreadm.sh => lacreadm} | 0 doc/admin.md | 3 +++ 2 files changed, 3 insertions(+) rename bin/{lacreadm.sh => lacreadm} (100%) diff --git a/bin/lacreadm.sh b/bin/lacreadm similarity index 100% rename from bin/lacreadm.sh rename to bin/lacreadm diff --git a/doc/admin.md b/doc/admin.md index 41a8e48..e714973 100644 --- a/doc/admin.md +++ b/doc/admin.md @@ -14,6 +14,9 @@ Of course `-h` displays some help. **Note:** Help output includes information about the configuration file being in use, which may be useful at times. +**Note:** You can also use a tiny shell wrapper around this tool, see +`bin/lacreadm`. + ## Initialising database schema