intercity-next
intercity-next copied to clipboard
Intercity shows "swap disabled" on servers where it's enabled at install
By default, Ubuntu enables swap for you when you install a server, but our Intercity Swap Settings page shows the message "Swap is disabled on this server". We should probably intelligently check the server when showing that page or at install time, so we can hide this Swap Settings page or at least have the message reflect the server's swap state.
root@emma-hairstyle:~# swapon --show=NAME,TYPE,SIZE
NAME TYPE SIZE
/dev/vda5 partition 4G
@michiels Hm weird, since on DO it is disabled by default. But we can probably add this the the HealthCheck
. and see if we get output from this command, if we do swap is enabled, otherwise we disable it in the DB.
Good catch!
DO (and some other hosting providers) use custom server images that have been modified over the default installation process.
Implementing it in HealthCheck
sounds right! Is that executed at install time? That would be good to refresh the swap status indeed. We don't want people to accidentally create "extra swap" from the swap settings page.
@michiels It is executed every 30 minutes. So if the user enables swap manually, we can also detect that!
Yep sounds good! As long as it's checked at least once during boostrap, because then the Swap Settings page will initially show the correct state.
@michiels Yeah I also add it to the installation step.
Perfect