Systemd Service - Incus equivalent of snap.lxd.activate.service and snap.lxd.daemon.service

Hello,

In the process of migrating from LXD to Incus, some systemd service files include dependencies on LXD, including “Wants=snap.lxd.activate.service” and “Wants=snap.lxd.daemon.service”.
What would be the Incus equivalent (standard Deb installation, not through Zabbly, although I am not sure it matters) of snap.lxd.activate.service and snap.lxd.daemon.service?

Cheers,
D

  • snap.lxd.activate.service => incus-startup.service
  • snap.lxd.daemon.service => incus.service
1 Like

Hi @stgraber , sorry intervene the post but why we need incus-startup.service?
Thanks.

Incus is normally socket activated so the daemon only starts up when you first interact with it.
That’s done to save resources on systems that only rarely use Incus.

But there are a number of cases where you do want Incus to start automatically on boot:

  • If you have auto-started instances (boot.autostart=true or their last-state was RUNNING)
  • If the server is part of a cluster
  • If the server is configured to listen on the network (core.https_address)

That’s what incus-startup handles. It calls incus admin activateifneeded which will then in turn look at the database and figure out whether Incus should be started. If it should, it then connects to it, triggering the socket activation mechanism.

That same systemd unit also handles the clean host shutdown by calling incus admin shutdown when the unit is asked to stop. Having this be done by incus-startup means that you can safely restart the incus unit without all instances being shutdown and started back up.

1 Like

Thanks for the clarification. :+1:
Regards.