Restructuring of configuration files and man pages
New features
We now read configuration options from the following files and folders:
/etc/systemd/swap.conf.d/*.conf
/run/systemd/swap.conf.d/*.conf
/usr/lib/systemd/swap.conf.d/*.conf
/etc/systemd/swap.conf
/usr/share/systemd-swap/swap-default.conf
(With priority from top to bottom).
We now support some new configuration options:
swapfc_remove_free_swap_perc
Allows defining at what % of available ram we remove a swap file (defaluts to 55 which is the old value ofswapfc_free_swap_perc
+ 40.swapfc_min_count
Just how you can define the maximum number of swap files created by swapfc, you can now define a minimum that will always be allocated (for instanse to restore the old behaviour of creating a swap file on startup set this to1
). Defaults to0
.swapfc_priority
Sets the priority of swap files created by swapfc (decreasing by one for every swap file created). Defaults to-2
(old default).
There are two new man pages, 5 swap.conf
and 8 systemd-swap
.
Please read through them and send in grammar mistakes and anything you would like to be added 🥳 .
Misc
- Further removal of use of external programs thus improving performance (thanks zenofile).
- Additional systemd hardening.
- Run as
type=notify
which should improve the output ofsystemctl status systemd-swap
. - Run systemd-swap at "realtime" priority (1ac16cb if you're interested).
- Code refactoring and cleanup.
- Log when we start creating swap files and warn if combining zram with zswap/swapfc/swapd.
- Never shred the swap file before using it (previously it would shred if the filesystem was not ext* or btrfs) (3f2e5a9 & 41d86af).