** Description changed:

  [ Impact ]
  
  pro status shows livepatch as "disabled" when "canonical-livepatch"
  returns an error. This can be misleading. It would be more helpful to
  propagate the error message up to the user through pro status; that is
  what the fix does.
  
  [ Test Plan ]
  
  In a multipass VM:
  ```
  # attach to pro
  sudo pro attach
  # hack canonical-livepatch to return an error
- cat > error.sh <<EOF  
- #!/bin/sh  
- echo "this is a simulated error" >&2  
- false  
+ cat > error.sh <<EOF
+ #!/bin/sh
+ echo "this is a simulated error" >&2
+ false
  EOF
+ chmod +x error.sh
  sudo rm /snap/bin/canonical-livepatch
  sudo ln -s /home/ubuntu/error.sh /snap/bin/canonical-livepatch
  # check livepatch's status according to pro
  pro status
  ```
  
  Without the fix, livepatch will show as "disabled".
  With the fix, livepatch will show as "warning", and there will be a notice 
that says "Error running canonical-livepatch status:  this is a simulated error"
  
  [ Where problems could occur ]
  
  Since this changes how the status of livepatch is displayed, then a
  mistake could lead to livepatch's status being incorrect
  
  [Original Description]
  
  livepatch shows as disabled when `pro status` is run as a normal user,
  but enabled when run with sudo.
  
  $ pro status
  SERVICE          ENTITLED  STATUS    DESCRIPTION
  esm-apps         yes       enabled   Expanded Security Maintenance for 
Applications
  esm-infra        yes       enabled   Expanded Security Maintenance for 
Infrastructure
  livepatch        yes       disabled  Canonical Livepatch service
  
  $ sudo pro status
  SERVICE          ENTITLED  STATUS    DESCRIPTION
  esm-apps         yes       enabled   Expanded Security Maintenance for 
Applications
  esm-infra        yes       enabled   Expanded Security Maintenance for 
Infrastructure
  livepatch        yes       enabled   Canonical Livepatch service
  
  This is probably a separate issue, but similarly (with a few numbers I have 
replaced by <censored>:
  $ canonical-livepatch status
  internal error, please report: running "canonical-livepatch" failed: 
transient scope could not be started, job /org/freedesktop/systemd1/job/235 
finished with result failed
  
  $ sudo canonical-livepatch status
  last check: 35 minutes ago
  kernel: <censored>
  server check-in: succeeded
  kernel state: ✓ kernel is supported by Canonical.
  patch state: ✓ all applicable livepatch modules inserted
  patch version: <censored>
  tier: stable
  
  ubuntu-advantage-tools 27.14.4~22.04
  Ubuntu 22.04.2 LTS

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

Title:
  pro livepatch status incorrect when run as normal user

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-livepatch-client/+bug/2019997/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to