maximumadmin/zramd

systemd v254 changes swapon output for zram device

glitsj16 opened this issue · 0 comments

Hi, let me start by expressing my gratitude for creating/offering this excellent application. Have been using it without hiccups for a long time. But after my Arch Linux box got the systemd v254 recently, I did notice some peculiarity. Where before this upgrade swapon consistently reported /dev/zram0, it now shows /zram0 instead.

$ sudo swapon --noheadings --raw --show=name,size,used
/dev/sda2 4,2G 0B
/zram0 1024M 0B

UPDATE:
After doing some more experimenting it turned out we can keep PrivateNetwork and explicitly disable PrivateMounts.

Nothing crucial apparently, the zram device is created and still resides under /dev/zram0. But it's confusing and I opted to disable PrivateNetwork PrivateMounts to get back to the output one would expect from swapon.

PrivateNetwork=yes

$ cat /etc/systemd/system/zramd.service.d/fix-swapon-output.conf
[Service]
# systemd v254 introduced some changes that apparently affected
# swapon output - bring back known good behaviour
# https://github.com/systemd/systemd/commit/6b2d576f2b38c0385bb056af328754ec8966f9fd
PrivateMounts=no

Not sure whether there might be better ways to deal with this systemd change. I'll leave that up to you.