Package: dphys-swapfile
Version: 20100506-4

Hardware: Raspberry Pi 2.
I use Debian release "sid".

My KInfocenter shows:
KDE Plasma Verson:      5.13.2
KDE Frameworks Version: 5.47.0
Qt Version:             5.11.1
Kernel Version:         4.17.0-2-armmp
OS Type:                32-bit

# grep -i swap /boot/config-4.17.0-2-armmp
CONFIG_SWAP=y
CONFIG_MEMCG_SWAP=y
# CONFIG_MEMCG_SWAP_ENABLED is not set
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_FRONTSWAP=y
CONFIG_ZSWAP=y
CONFIG_MTD_SWAP=m
CONFIG_NFS_SWAP=y
CONFIG_SUNRPC_SWAP=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set

I made a guide for 32-bit and 64-bit for Debian for Raspberry Pi here:
https://github.com/evasjo/DebianSbcRaspberry

My 32-bit (armhf) worked with dphys-swapfile in version 20100506-3.
My 64-bit (arm64) works with dphys-swapfile in version 20100506-3.

Swap is not working after upgrde of my 32-bit (armhf) dphys-swapfile
to version 20100506-4.

Test1:
# journalctl
Aug 19 15:24:35 irena systemd[1]: Starting dphys-swapfile - set up,
mount/unmount, and delete a swap file...
Aug 19 15:24:36 irena dphys-swapfile[403]: want /var/swap=1024MByte
Aug 19 15:24:36 irena systemd[1]: dphys-swapfile.service: Main process
exited, code=exited, status=1/FAILURE
Aug 19 15:24:36 irena systemd[1]: dphys-swapfile.service: Failed with
result 'exit-code'.
Aug 19 15:24:36 irena systemd[1]: Failed to start dphys-swapfile - set
up, mount/unmount, and delete a swap file.
# systemctl status swap.target
��� swap.target - Swap
   Loaded: loaded (/lib/systemd/system/swap.target; static; vendor
preset: enabled)
   Active: active since Fri 2018-06-22 11:11:50 UTC; 1 months 27 days ago
     Docs: man:systemd.special(7)
Warning: Journal has been rotated since unit was started. Log output
is incomplete or unavailable.
# systemctl status dphys-swapfile.service
��� dphys-swapfile.service - dphys-swapfile - set up, mount/unmount,
and delete a swap file
   Loaded: loaded (/lib/systemd/system/dphys-swapfile.service;
enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2018-08-19 15:24:36
UTC; 1h 45min ago
     Docs: man:dphys-swapfile(8)
  Process: 403 ExecStart=/sbin/dphys-swapfile setup (code=exited,
status=1/FAILURE)
 Main PID: 403 (code=exited, status=1/FAILURE)
Aug 19 15:24:35 irena systemd[1]: Starting dphys-swapfile - set up,
mount/unmount, and delete a swap file...
Aug 19 15:24:36 irena dphys-swapfile[403]: want /var/swap=1024MByte
Aug 19 15:24:36 irena systemd[1]: dphys-swapfile.service: Main process
exited, code=exited, status=1/FAILURE
Aug 19 15:24:36 irena systemd[1]: dphys-swapfile.service: Failed with
result 'exit-code'.
Aug 19 15:24:36 irena systemd[1]: Failed to start dphys-swapfile - set
up, mount/unmount, and delete a swap file.
# cat /proc/swaps
Filename                                Type            Size    Used    Priority
#
Swap is not working!

Test2:
# systemctl start dphys-swapfile.service
Job for dphys-swapfile.service failed because the control process
exited with error code.
See "systemctl status dphys-swapfile.service" and "journalctl -xe" for details.
# systemctl status dphys-swapfile.service   // Same error message as above
# cat /proc/swaps
Filename                                Type            Size    Used    Priority
#
Swap is not working!    // I tried also to erase row
"ExecStart=/sbin/dphys-swapfile swapon" in dphys-swapfile.service, but
same error message as above.

Test3:
# /sbin/dphys-swapfile setup
want /var/swap=1024MByte
# /sbin/dphys-swapfile swapon
# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/var/swap                               file            1048572 256     -2
#
Swap works!     // Swap works even without command "/sbin/dphys-swapfile setup"

Test4:
Solution:
# nano -w /lib/systemd/system/dphys-swapfile.service
ExecStart=-/sbin/dphys-swapfile setup    // Old:
ExecStart=/sbin/dphys-swapfile setup
Restart computer!
Swap works!

I do not know why "ExecStart=/sbin/dphys-swapfile setup" is not
working in SystemD for me.

// Evald

Reply via email to