add an activateifneeded service
Task Info (Flyspray) | |
---|---|
Opened By | Yuri Kanivetsky (x-yuri) |
Task ID | 76297 |
Type | Feature Request |
Project | Community Packages |
Category | Packages |
Version | None |
OS | All |
Opened | 2022-10-26 09:42:17 UTC |
Status | Assigned |
Assignee | George Rawlinson (rawlinsong) |
Assignee | Morten Linderud (Foxboron) |
Details
Description: I looked into how it works on Ubuntu. There the lxd service is not enabled. What is enabled is the matching socket. And there's an enabled service that runs lxd activateifneeded
on boot:
https://github.com/lxc/lxd/blob/lxd-5.6/lxd/main_activateifneeded.go#L35-L42
Supposedly that's their idea of how it should work:
By default, LXD is socket activated and configured to listen only on a local UNIX socket. While LXD may not be running when you first look at the process listing, any LXC command will start it up.
https://ubuntu.com/server/docs/containers-lxd
My suggestion is to add a service:
/etc/systemd/system/lxd-activateifneeded.service
[Unit] Description=LXD (activateifneeded)
[Service] ExecStart=/usr/bin/lxd activateifneeded Type=oneshot
[Install] WantedBy=multi-user.target
Then after installation, one starts/enables lxd.socket, and optionally enables lxd-activateifneeded.service.
A possibly related bug report:
FS#72614
But it doesn't manifest on my machine.