How to have Unifi available, but not started at boot

Hi. I want services.unifi enabled but not started at boot since it can hog memory and is only really needed at time-of-reconfiguration.

I tried the technique the installer profile [1] uses to not-start SSH, but it didn’t work (I applied it, rebooted and it was still running). I don’t speak systemd well enough to intuit what additional steps I need.

Any tips or suggestion of things to try?

[1]: systemd.services.sshd.wantedBy = mkOverride 50 [];

You have a couple of options

  1. systemd.services.unifi.wantedBy = mkForce []; should do the trick
  2. allocate less memory services.unifi.maximumJavaHeapSize = 256;
  3. run it in a container with autoStart = false;

The unifi controller will easily run with less memory allocated so that can be done no matter what.

I use postgres and mariadb (mariadb far less) togther with redis so those are running in containers. This also allows multiple different versions which is very convenient.

2 Likes