diff --git a/data/etc/plinth/plinth.config b/data/etc/plinth/plinth.config index e59e65efc..f99f679bf 100644 --- a/data/etc/plinth/plinth.config +++ b/data/etc/plinth/plinth.config @@ -4,7 +4,6 @@ file_root = /usr/share/plinth config_dir = /etc/plinth data_dir = /var/lib/plinth log_dir = /var/log/plinth -pid_dir = /var/run server_dir = /plinth actions_dir = /usr/share/plinth/actions doc_dir = /usr/share/doc/plinth @@ -13,7 +12,6 @@ doc_dir = /usr/share/doc/plinth store_file = %(data_dir)s/plinth.sqlite3 status_log_file = %(log_dir)s/status.log access_log_file = %(log_dir)s/access.log -pidfile = %(pid_dir)s/plinth.pid [Network] host = 127.0.0.1 diff --git a/plinth.config b/plinth.config index d3a0cb62b..44c9d1a3b 100644 --- a/plinth.config +++ b/plinth.config @@ -4,7 +4,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 -pid_dir = %(file_root)s/data/var/run server_dir = / actions_dir = %(file_root)s/actions doc_dir = %(file_root)s/doc @@ -13,7 +12,6 @@ doc_dir = %(file_root)s/doc store_file = %(data_dir)s/plinth.sqlite3 status_log_file = %(log_dir)s/status.log access_log_file = %(log_dir)s/access.log -pidfile = %(pid_dir)s/plinth.pid [Network] host = 127.0.0.1 diff --git a/plinth/__main__.py b/plinth/__main__.py index 514a98e16..679546d66 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -45,9 +45,6 @@ def parse_arguments(): parser = argparse.ArgumentParser( description='Plinth web interface for FreedomBox', formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument( - '--pidfile', default=cfg.pidfile, - help='specify a file in which the server may write its pid') # TODO: server_dir is actually a url prefix; use a better variable name parser.add_argument( '--server_dir', default=cfg.server_dir, @@ -64,7 +61,6 @@ def parse_arguments(): global arguments arguments = parser.parse_args() - cfg.pidfile = arguments.pidfile cfg.server_dir = arguments.server_dir cfg.debug = arguments.debug @@ -82,22 +78,14 @@ def setup_server(): """Setup CherryPy server""" logger.info('Setting up CherryPy server') - # Set the PID file path - try: - if cfg.pidfile: - from cherrypy.process.plugins import PIDFile - PIDFile(cherrypy.engine, cfg.pidfile).subscribe() - except AttributeError: - pass - # Configure default server - cherrypy.config.update( - {'server.socket_host': cfg.host, - 'server.socket_port': cfg.port, - 'server.thread_pool': 10, - # Avoid stating files once per second in production - 'engine.autoreload.on': cfg.debug, - }) + cherrypy.config.update({ + 'server.socket_host': cfg.host, + 'server.socket_port': cfg.port, + 'server.thread_pool': 10, + # Avoid stating files once per second in production + 'engine.autoreload.on': cfg.debug, + }) application = django.core.wsgi.get_wsgi_application() cherrypy.tree.graft(application, cfg.server_dir) diff --git a/plinth/cfg.py b/plinth/cfg.py index 9342235b4..6cb10880d 100644 --- a/plinth/cfg.py +++ b/plinth/cfg.py @@ -33,7 +33,6 @@ actions_dir = None doc_dir = None status_log_file = None access_log_file = None -pidfile = None host = None port = None use_x_forwarded_host = False @@ -91,7 +90,6 @@ def read(file_path=None, root_directory=None): ('Path', 'doc_dir', 'string'), ('Path', 'status_log_file', 'string'), ('Path', 'access_log_file', 'string'), - ('Path', 'pidfile', 'string'), ('Path', 'server_dir', 'string'), ('Network', 'host', 'string'), ('Network', 'port', 'int'), diff --git a/plinth/tests/test_cfg.py b/plinth/tests/test_cfg.py index 2cca8a869..35c94e857 100644 --- a/plinth/tests/test_cfg.py +++ b/plinth/tests/test_cfg.py @@ -126,7 +126,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(13, len(parser.items('Path'))) + self.assertEqual(11, 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) @@ -139,7 +139,6 @@ class TestCfg(unittest.TestCase): cfg.status_log_file) self.assertEqual(parser.get('Path', 'access_log_file'), cfg.access_log_file) - self.assertEqual(parser.get('Path', 'pidfile'), cfg.pidfile) self.assertEqual(5, len(parser.items('Network'))) self.assertEqual(parser.get('Network', 'host'), cfg.host)