gcgarner / IOTstack

docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.52k stars 582 forks source link

Why `Disable Swap` doen't last after a reboot? #85

Closed sebi5361 closed 5 years ago

sebi5361 commented 5 years ago

On my Raspberry Pi 3 Model B+, I have noticed that once the swap file is being removed (using the miscellaneous command disable swap), it will turn back after my Pi reboots (I use htop to reassess the swap file size). Wouldn't it be better if the swap file keeps being removed between two reboots?

gcgarner commented 5 years ago

I had a look at my system and it appears that my logfile recreates on reboot as well. To top it off my log2ram seems to have died.

I'll see what i can do to resolve it

gcgarner commented 5 years ago

I've changed the code from

        sudo dphys-swapfile swapoff
        sudo dphys-swapfile uninstall
        sudo update-rc.d dphys-swapfile remove
        echo "Swap file has been removed"

to

        sudo dphys-swapfile swapoff
        sudo dphys-swapfile uninstall
        sudo update-rc.d dphys-swapfile remove
                sudo systemctl disable dphys-swapfile
        echo "Swap file has been removed"

That appears to so the job properly. I'll push when I'm done with the PR for the backups.

now i need to figure what log2ram's problem is

gcgarner commented 5 years ago

... will close after i push the changes

gcgarner commented 5 years ago

pushed update