#generator #systemd #unit #memory #system

app zram-generator

Systemd unit generator for zram devices

3 releases

new 0.1.2 Oct 8, 2019
0.1.1 Aug 25, 2018
0.1.0 Aug 25, 2018

MIT license

10KB
218 lines

swap-create@.service generator for zram devices

This program serves two purposes:

  1. It is a simple and fast mechanism to configure /dev/zram* devices if the system has a small amount of memory.

    To create a zram device, create /etc/systemd/zram-generator.conf

    # /etc/systemd/zram-generator.conf
    [zram0]
    memory-limit = 2048
    zram-fraction = 0.25
    

    A zram device will be created for each section. No actual configuration is necessary (the defaults of 2048 and 0.25 will be used unless overriden), but the configuration file with at least one section must exist.

  2. Once we figure out all the details, it should be useful as an example of a systemd generator in rust.

Dependencies

~0.8–1MB
~23K SLoC