logging: Remove references to old log files

- Remove access/error log references in configuration files and tests.

- Ensure that /var/log/plinth directory is not created anymore.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2018-12-26 19:55:38 -08:00 committed by James Valleroy
parent f625b16c16
commit 35c70861dc
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
9 changed files with 6 additions and 21 deletions

View File

@ -3,7 +3,6 @@
file_root = /usr/share/plinth
config_dir = /etc/plinth
data_dir = /var/lib/plinth
log_dir = /var/log/plinth
server_dir = /plinth
actions_dir = /usr/share/plinth/actions
doc_dir = /usr/share/doc/plinth
@ -11,8 +10,6 @@ custom_static_dir = /var/www/plinth/custom/static
# file locations
store_file = %(data_dir)s/plinth.sqlite3
status_log_file = %(log_dir)s/status.log
access_log_file = %(log_dir)s/access.log
[Network]
host = 127.0.0.1

2
debian/postinst vendored
View File

@ -18,7 +18,7 @@ case "$1" in
configure)
addgroup --system --quiet plinth
adduser --system --quiet --ingroup plinth --no-create-home --home /var/lib/plinth plinth
chown -R plinth: /var/lib/plinth /var/log/plinth
chown -R plinth: /var/lib/plinth
if [ ! -e '/var/lib/freedombox/is-freedombox-disk-image' ]; then
umask 377

5
debian/postrm vendored
View File

@ -5,7 +5,10 @@ set -e
case "$1" in
purge)
deluser --system --quiet plinth || true
rm -rf /var/log/plinth /var/lib/plinth
rm -rf /var/lib/plinth
# Remove legacy directory too
rm -rf /var/log/plinth
;;
esac

View File

@ -3,7 +3,6 @@
file_root = %(root)s
config_dir = %(file_root)s/data/etc/plinth
data_dir = %(file_root)s/data/var/lib/plinth
log_dir = %(file_root)s/data/var/log/plinth
server_dir = /plinth
actions_dir = %(file_root)s/actions
doc_dir = %(file_root)s/doc
@ -11,8 +10,6 @@ custom_static_dir = %(file_root)s/data/var/www/plinth/custom/static
# file locations
store_file = %(data_dir)s/plinth.sqlite3
status_log_file = %(log_dir)s/status.log
access_log_file = %(log_dir)s/access.log
[Network]
host = 127.0.0.1

View File

@ -30,8 +30,6 @@ custom_static_dir = None
store_file = None
actions_dir = None
doc_dir = None
status_log_file = None
access_log_file = None
host = None
port = None
use_x_forwarded_host = False
@ -96,8 +94,6 @@ def read(config_path=None, root_directory=None):
('Path', 'store_file', 'string'),
('Path', 'actions_dir', 'string'),
('Path', 'doc_dir', 'string'),
('Path', 'status_log_file', 'string'),
('Path', 'access_log_file', 'string'),
('Path', 'server_dir', 'string'),
('Network', 'host', 'string'),
('Network', 'port', 'int'),

View File

@ -3,7 +3,6 @@
file_root = %(root)s
config_dir = %(file_root)s/data/etc/plinth
data_dir = %(file_root)s/data/var/lib/plinth
log_dir = %(file_root)s/data/var/log/plinth
server_dir = /plinth
actions_dir = %(file_root)s/actions
doc_dir = %(file_root)s/doc
@ -11,8 +10,6 @@ custom_static_dir = %(file_root)s/data/var/www/plinth/custom/static
# file locations
store_file = %(data_dir)s/plinth.sqlite3
status_log_file = %(log_dir)s/status.log
access_log_file = %(log_dir)s/access.log
[Network]
host = 127.0.0.1

View File

@ -115,7 +115,7 @@ class TestCfg(unittest.TestCase):
"""Compare two sets of configuration values."""
# Note that the count of items within each section includes the number
# of default items (1, for 'root').
self.assertEqual(12, len(parser.items('Path')))
self.assertEqual(9, len(parser.items('Path')))
self.assertEqual(parser.get('Path', 'root'), cfg.root)
self.assertEqual(parser.get('Path', 'file_root'), cfg.file_root)
self.assertEqual(parser.get('Path', 'config_dir'), cfg.config_dir)
@ -125,10 +125,6 @@ class TestCfg(unittest.TestCase):
self.assertEqual(parser.get('Path', 'store_file'), cfg.store_file)
self.assertEqual(parser.get('Path', 'actions_dir'), cfg.actions_dir)
self.assertEqual(parser.get('Path', 'doc_dir'), cfg.doc_dir)
self.assertEqual(
parser.get('Path', 'status_log_file'), cfg.status_log_file)
self.assertEqual(
parser.get('Path', 'access_log_file'), cfg.access_log_file)
self.assertEqual(5, len(parser.items('Network')))
self.assertEqual(parser.get('Network', 'host'), cfg.host)

View File

@ -40,7 +40,6 @@ from plinth.tests.coverage import coverage
DIRECTORIES_TO_CREATE = [
'/var/lib/plinth',
'/var/lib/plinth/sessions',
'/var/log/plinth',
]
DIRECTORIES_TO_COPY = [