** Description changed:

  * Problem description:
  
  It is quite easy to accidentally trigger the on-demand installation of
  LXD's snap which takes a while. This is something that can, for example,
  happen inside a LXD instance where the operator didn't notice the
  instance was "entered". Something:
  
  $ lxc launch ubuntu-minimal:noble c1
  $ lxc shell c1 # accidentally enter `c1`
  # lxc list     # try to interact with LXD in the host but mistakenly triggers 
lxd-installer
  
  This last step is taking a while because multiple snaps need to be
  installed due to that `lxc list` being run in the wrong environment
  (instance instead of host). This is why
  https://bugs.launchpad.net/ubuntu/+source/lxd-installer/+bug/2073941 and
  https://discourse.ubuntu.com/t/when-an-lxc-command-is-used-on-a-system-
  without-lxc-lxd-lxd-is-immediately-installed-should-it-be-that-way/46570
  were opened/reported.
  
  * Motivation for the FFe:
  
  A better behavior would be for `lxd-installer` to detect if there is a
  terminal and if yes, prompt for a confirmation before doing the lengthy
  installation process. If no terminal is detect, it should assume that
  LXD is to be installed on-demand (current behavior). That is what
  https://code.launchpad.net/~sdeziel/ubuntu/+source/lxd-
  installer/+git/lxd-installer/+merge/471653
  
  * Additional information:
  
  lxd-installer authoritative sources live at
  https://code.launchpad.net/~git-ubuntu-import/ubuntu/+source/lxd-
  installer/+git/lxd-installer/+ref/ubuntu/devel so this is not a new
  upstream release per se. As such, the only changelog would be:
  
    * scripts/lxc: ask before proceeding if interactive (LP: #2073941, LP:
  #2080277)
  
  This changelog and the associated changes are being proposed for merging
  in https://code.launchpad.net/~sdeziel/ubuntu/+source/lxd-
  installer/+git/lxd-installer/+merge/471653
  
  The changes themselves are simply to prompt for confirmation before
  proceeding with the lengthy installation if a terminal is detected.
  
  Source build logs:
  
- #FIXME
+ $ dpkg-buildpackage --build=source --no-sign -sa
+ dpkg-buildpackage: info: source package lxd-installer
+ dpkg-buildpackage: info: source version 8
+ dpkg-buildpackage: info: source distribution oracular
+ dpkg-buildpackage: info: source changed by Simon Deziel 
<simon.dez...@canonical.com>
+  dpkg-source --before-build .
+  debian/rules clean
+ dh clean
+    dh_auto_clean
+    dh_clean
+  dpkg-source -b .
+ dpkg-source: info: using source format '3.0 (native)'
+ dpkg-source: info: building lxd-installer in lxd-installer_8.tar.xz
+ dpkg-source: info: building lxd-installer in lxd-installer_8.dsc
+  dpkg-genbuildinfo --build=source -O../lxd-installer_8_source.buildinfo
+  dpkg-genchanges -sa --build=source -O../lxd-installer_8_source.changes
+ dpkg-genchanges: info: including full source code in upload
+  dpkg-source --after-build .
+ dpkg-buildpackage: info: source-only upload: Debian-native package
  
  Binary build logs:
  
- #FIXME
+ $ dpkg-buildpackage --build=binary --no-sign -sa
+ dpkg-buildpackage: info: source package lxd-installer
+ dpkg-buildpackage: info: source version 8
+ dpkg-buildpackage: info: source distribution oracular
+ dpkg-buildpackage: info: source changed by Simon Deziel 
<simon.dez...@canonical.com>
+ dpkg-buildpackage: info: host architecture amd64
+  dpkg-source --before-build .
+  debian/rules clean
+ dh clean
+    dh_auto_clean
+    dh_clean
+  debian/rules binary
+ dh binary
+    dh_update_autotools_config
+    dh_autoreconf
+    dh_auto_configure
+    dh_auto_build
+       make -j12 "INSTALL=install --strip-program=true"
+ make[1]: Entering directory '/home/ubuntu/lxd-installer'
+ true
+ make[1]: Leaving directory '/home/ubuntu/lxd-installer'
+    dh_auto_test
+    create-stamp debian/debhelper-build-stamp
+    dh_prep
+    dh_auto_install --destdir=debian/lxd-installer/
+       make -j12 install 
DESTDIR=/home/ubuntu/lxd-installer/debian/lxd-installer AM_UPDATE_INFO_DIR=no 
"INSTALL=install --strip-program=true"
+ make[1]: Entering directory '/home/ubuntu/lxd-installer'
+ mkdir -p /home/ubuntu/lxd-installer/debian/lxd-installer/usr/sbin 
/home/ubuntu/lxd-installer/debian/lxd-installer/usr/share/lxd-installer
+ install -m 0755 scripts/lxc 
/home/ubuntu/lxd-installer/debian/lxd-installer/usr/sbin
+ ln -sf lxc /home/ubuntu/lxd-installer/debian/lxd-installer/usr/sbin/lxd
+ install -m 0755 lxd-installer-service 
/home/ubuntu/lxd-installer/debian/lxd-installer/usr/share/lxd-installer
+ make[1]: Leaving directory '/home/ubuntu/lxd-installer'
+    dh_installdocs
+    dh_installchangelogs
+    dh_installsystemd
+    dh_perl
+    dh_link
+    dh_strip_nondeterminism
+    dh_compress
+    dh_fixperms
+    dh_missing
+    dh_installdeb
+    dh_gencontrol
+ dpkg-gencontrol: warning: Depends field of package lxd-installer: 
substitution variable ${shlibs:Depends} used, but is not defined
+    dh_md5sums
+    dh_builddeb
+ dpkg-deb: building package 'lxd-installer' in '../lxd-installer_8_all.deb'.
+  dpkg-genbuildinfo --build=binary -O../lxd-installer_8_amd64.buildinfo
+  dpkg-genchanges -sa --build=binary -O../lxd-installer_8_amd64.changes
+ dpkg-genchanges: info: binary-only upload (no source code included)
+  dpkg-source --after-build .
+ dpkg-buildpackage: info: binary-only upload (no source included)
+ 
  
  Install logs from a LXD VM:
  
- #FIXME
+ $ lxc launch ubuntu-daily:24.10 c1
+ Launching c1
+ $ lxc file push /tmp/l/lxd-installer_8_all.deb c1/tmp/
+ $ lxc shell c1                                                                
         
+ root@c1:~# apt-get install /tmp/lxd-installer_8_all.deb 
+ Reading package lists... Done
+ Building dependency tree... Done
+ Reading state information... Done
+ Note, selecting 'lxd-installer' instead of '/tmp/lxd-installer_8_all.deb'
+ The following packages will be upgraded:
+   lxd-installer
+ 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
+ Need to get 0 B/4912 B of archives.
+ After this operation, 1024 B of additional disk space will be used.
+ Get:1 /tmp/lxd-installer_8_all.deb lxd-installer all 8 [4912 B]
+ (Reading database ... 38022 files and directories currently installed.)
+ Preparing to unpack /tmp/lxd-installer_8_all.deb ...
+ Unpacking lxd-installer (8) over (7) ...
+ Setting up lxd-installer (8) ...
+ Scanning processes...                                                         
                                                            
+ 
+ No services need to be restarted.
+ 
+ No containers need to be restarted.
+ 
+ No user sessions are running outdated binaries.
+ 
+ No VM guests are running outdated hypervisor (qemu) binaries on this
+ host.
+ 
+ 
+ And now to confirm the prompt is only present when running interactively:
+ 
+ root@c1:~# lxc list
+ Would you like to install LXD snap now (Y/n)? 
+ n
+ 
+ 
+ When "scripted", there is no prompting:
+ 
+ root@c1:~# lxc list | cat
+ Installing LXD snap, please be patient.
+ If this is your first time running LXD on this machine, you should also run: 
lxd init
+ To start your first container, try: lxc launch ubuntu:24.04
+ Or for a virtual machine: lxc launch ubuntu:24.04 --vm
+ 
+ +------+-------+------+------+------+-----------+
+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+ +------+-------+------+------+------+-----------+
+ 
+ 
+ This shows that accidentally running a `lxc` command interactively will be 
easy to cancel.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2080277

Title:
  FFe: lxd-installer should prompt before installing LXD

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxd-installer/+bug/2080277/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to