Sometimes, systemd-swap produced error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
The cause is:
If zramctl returned "failed to reset: Device or resource busy", systemd-swap just sleep 1 second but not retry exec zramctl.
So I change some code to retry exec zramctl when things happen.
The log:
systemd-swap[643]: INFO: Removing working directory...
systemd-swap[643]: INFO: Removing files in /var/lib/systemd-swap/swapfc/...
systemd-swap[643]: WARN: Combining zram with zswap/swapfc/swapd_auto_swapon can lead to LRU inversion and is strongly recommended against
systemd-swap[643]: INFO: Zram: check availability
systemd-swap[643]: INFO: Zram: not part of kernel, trying to find zram module
systemd-swap[643]: INFO: Zram: module successfully loaded
systemd-swap[643]: INFO: Zram: trying to initialize free device
systemd-swap[643]: Traceback (most recent call last):
systemd-swap[643]: File "/usr/bin/systemd-swap", line 904, in <module>
systemd-swap[643]: main()
systemd-swap[643]: File "/usr/bin/systemd-swap", line 892, in main
systemd-swap[643]: start()
systemd-swap[643]: File "/usr/bin/systemd-swap", line 666, in start
systemd-swap[643]: mode = os.stat(zram_dev).st_mode
systemd-swap[643]: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
Sometimes, systemd-swap produced error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
The cause is: If zramctl returned "failed to reset: Device or resource busy", systemd-swap just sleep 1 second but not retry exec zramctl.
So I change some code to retry exec zramctl when things happen.
The log: