diff --git a/plinth/modules/config/__init__.py b/plinth/modules/config/__init__.py index 7a55a1c0b..45e3fde71 100644 --- a/plinth/modules/config/__init__.py +++ b/plinth/modules/config/__init__.py @@ -30,6 +30,8 @@ _description = [ depends = ['apache', 'firewall', 'names'] +managed_packages = ['zram-tools'] + APACHE_CONF_ENABLED_DIR = '/etc/apache2/conf-enabled' APACHE_HOMEPAGE_CONF_FILE_NAME = 'freedombox-apache-homepage.conf' APACHE_HOMEPAGE_CONFIG = os.path.join(APACHE_CONF_ENABLED_DIR, @@ -183,6 +185,7 @@ def set_advanced_mode(advanced_mode): def setup(helper, old_version=None): """Install and configure the module.""" + helper.install(managed_packages) _migrate_home_page_config() # systemd-journald is socket activated, it may not be running and it does diff --git a/plinth/modules/config/data/lib/systemd/system/zramswap.service.d/freedombox.conf b/plinth/modules/config/data/lib/systemd/system/zramswap.service.d/freedombox.conf new file mode 100644 index 000000000..01035eaa6 --- /dev/null +++ b/plinth/modules/config/data/lib/systemd/system/zramswap.service.d/freedombox.conf @@ -0,0 +1,7 @@ +# Set the size of the swap to be 50% of RAM. Expected compression is 1:2. That +# means in an average case, 25% of RAM is consumed to provide the swap device. +# This results in the system being able to consume about 125% of RAM capacity to +# run processes. This value is inspired by Fedora which made zram the default +# swap mechanism. https://fedoraproject.org/wiki/Changes/SwapOnZRAM +[Service] +Environment=PERCENT=50