intercity-next icon indicating copy to clipboard operation
intercity-next copied to clipboard

Intercity shows "swap disabled" on servers where it's enabled at install

Open michiels opened this issue 8 years ago • 6 comments

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.

schermafbeelding 2016-10-06 om 12 30 14

root@emma-hairstyle:~# swapon --show=NAME,TYPE,SIZE
NAME      TYPE      SIZE
/dev/vda5 partition   4G

michiels avatar Oct 06 '16 10:10 michiels

@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!

jvanbaarsen avatar Oct 06 '16 10:10 jvanbaarsen

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 avatar Oct 06 '16 10:10 michiels

@michiels It is executed every 30 minutes. So if the user enables swap manually, we can also detect that!

jvanbaarsen avatar Oct 06 '16 10:10 jvanbaarsen

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 avatar Oct 06 '16 10:10 michiels

@michiels Yeah I also add it to the installation step.

jvanbaarsen avatar Oct 06 '16 10:10 jvanbaarsen

Perfect

michiels avatar Oct 06 '16 11:10 michiels