systemd / zram-generator

Systemd unit generator for zram devices
MIT License
575 stars 48 forks source link

zram doesn't get generated after reboot when using zram-generator.conf #167

Closed ghost closed 1 year ago

ghost commented 1 year ago

After creating and editing the /etc/systemd/zram-generator.conf and restart the system, the zram stopped getting generated. The zram-generator installed is zram-generator-defaults-1.1.2-1.fc36.noarch (Fedora 36 default).

Here is the zram-generator.conf content:

[zram0]
host-memory-limit = none
zram-size = 16384
compression-algorithm = zstd
swap-priority = 32767
options = discard
# writeback-device = /dev/zvol/tarta-zoot/swap-writeback

System information:

[root@belisarius ~]# screenfetch
           /:-------------:\          root@belisarius
        :-------------------::        OS: Fedora 
      :-----------/shhOHbmp---:\      Kernel: x86_64 Linux 5.19.12-200.fc36.x86_64
    /-----------omMMMNNNMMD  ---:     Uptime: 19m
   :-----------sMMMMNMNMP.    ---:    Packages: 2885
  :-----------:MMMdP-------    ---\   Shell: bash 5.1.16
 ,------------:MMMd--------    ---:   Resolution: 1920x1080
 :------------:MMMd-------    .---:   WM: KWin
 :----    oNMMMMMMMMMNho     .----:   GTK Theme: Adwaita [GTK2],  Adwaita [GTK3]
 :--     .+shhhMMMmhhy++   .------/   Disk: 507G / 1.4T (37%)
 :-    -------:MMMd--------------:    CPU: Intel Core i7-6700HQ @ 8x 3.5GHz [47.0°C]
 :-   --------/MMMd-------------;     GPU: NVIDIA GeForce GTX 960M
 :-    ------/hMMMy------------:      RAM: 3662MiB / 15907MiB
 :-- :dMNdhhdNMMNo------------;      
 :---:sdNMMMMNds:------------:       
 :------:://:-------------::         
 :---------------------://           

Here is the systemctl restart systemd-zram-setup@zram0 and related commands output:

[root@belisarius ~]# swapon -s
[root@belisarius ~]# systemctl daemon-reload
[root@belisarius ~]# systemctl restart systemd-zram-setup@zram0
Job for systemd-zram-setup@zram0.service failed because the control process exited with error code.
See "systemctl status systemd-zram-setup@zram0.service" and "journalctl -xeu systemd-zram-setup@zram0.service" for details.
[root@belisarius ~]# systemctl status systemd-zram-setup@zram0.service
× systemd-zram-setup@zram0.service - Create swap on /dev/zram0
     Loaded: loaded (/usr/lib/systemd/system/systemd-zram-setup@.service; static)
     Active: failed (Result: exit-code) since Sat 2022-10-01 19:53:35 -03; 12s ago
       Docs: man:zram-generator(8)
             man:zram-generator.conf(5)
    Process: 7146 ExecStart=/usr/lib/systemd/system-generators/zram-generator --setup-device zram0 (code=exited, status=1/FAILURE)
   Main PID: 7146 (code=exited, status=1/FAILURE)
        CPU: 3ms

Oct 01 19:53:35 belisarius systemd[1]: Starting systemd-zram-setup@zram0.service - Create swap on /dev/zram0...
Oct 01 19:53:35 belisarius zram-generator[7146]: Error: Permission denied (os error 13)
Oct 01 19:53:35 belisarius systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE
Oct 01 19:53:35 belisarius systemd[1]: systemd-zram-setup@zram0.service: Failed with result 'exit-code'.
Oct 01 19:53:35 belisarius systemd[1]: Failed to start systemd-zram-setup@zram0.service - Create swap on /dev/zram0.
[root@belisarius ~]# journalctl -xeu systemd-zram-setup@zram0.service
~
~
~
~
~
~
~
~
Oct 01 19:53:35 belisarius systemd[1]: Starting systemd-zram-setup@zram0.service - Create swap on /dev/zram0...
░░ Subject: A start job for unit systemd-zram-setup@zram0.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit systemd-zram-setup@zram0.service has begun execution.
░░ 
░░ The job identifier is 4284.
Oct 01 19:53:35 belisarius zram-generator[7146]: Error: Permission denied (os error 13)
Oct 01 19:53:35 belisarius systemd[1]: systemd-zram-setup@zram0.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit systemd-zram-setup@zram0.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Oct 01 19:53:35 belisarius systemd[1]: systemd-zram-setup@zram0.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit systemd-zram-setup@zram0.service has entered the 'failed' state with result 'exit-code'.
Oct 01 19:53:35 belisarius systemd[1]: Failed to start systemd-zram-setup@zram0.service - Create swap on /dev/zram0.
░░ Subject: A start job for unit systemd-zram-setup@zram0.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit systemd-zram-setup@zram0.service has finished with a failure.
░░ 
░░ The job identifier is 4284 and the job result is failed.

Here is the full journalctl -b output log: journalctl_output.txt

nabijaczleweli commented 1 year ago

Looks like broken MAC:

$ grep zram journalctl_output.txt
Oct 01 19:24:02 belisarius systemd[564]: /usr/lib/systemd/system-generators/zram-generator failed with exit status 1.
Oct 01 19:24:02 belisarius audit[588]: AVC avc:  denied  { read } for  pid=588 comm="zram-generator" name="zram-generator.conf" dev="sdb6" ino=6384331 scontext=system_u:system_r:init_t:s0>
Oct 01 19:25:32 belisarius systemd[1]: dev-zram0.device: Job dev-zram0.device/start timed out.
Oct 01 19:25:32 belisarius systemd[1]: Timed out waiting for device dev-zram0.device - /dev/zram0.
Oct 01 19:25:32 belisarius systemd[1]: Dependency failed for dev-zram0.swap - /dev/zram0.
Oct 01 19:25:32 belisarius systemd[1]: dev-zram0.swap: Job dev-zram0.swap/start failed with result 'dependency'.
Oct 01 19:25:32 belisarius systemd[1]: dev-zram0.device: Job dev-zram0.device/start failed with result 'timeout'.