Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: ujust toggle-updates doesn't change AutomaticUpdatePolicy #286

Open
Malix-Labs opened this issue Jun 5, 2024 · 11 comments
Open

Comments

@Malix-Labs
Copy link
Contributor

My updates are still being made automatically even after having it disabled since yesterday

image

image

@Malix-Labs
Copy link
Contributor Author

This is starting to strongly get into my workflow, is there a way to break the automatic download script in some other ways?

@lorduskordus

This comment was marked as outdated.

@Malix-Labs
Copy link
Contributor Author

Malix-Labs commented Jun 14, 2024

  • Reply from @lorduskordus :

    Let me try to help

    Sure, thanks @lorduskordus ! ❤️

    Do cat /usr/etc/rpm-ostreed.conf, does the output look like this ?

     malix@malix-pc ~> cat /usr/etc/rpm-ostreed.conf
     # Entries in this file show the compile time defaults.
     # You can change settings by editing this file.
     # For option meanings, see rpm-ostreed.conf(5).
     
     [Daemon]
     AutomaticUpdatePolicy=stage
     #IdleExitTimeout=60

    Do cat /etc/rpm-ostreed.conf, is the output different ? Does it at least contain the line AutomaticUpdatePolicy=stage ?

     malix@malix-pc ~> cat /etc/rpm-ostreed.conf
     # Entries in this file show the compile time defaults.
     # You can change settings by editing this file.
     # For option meanings, see rpm-ostreed.conf(5).
     
     [Daemon]
     AutomaticUpdatePolicy=stage
     #IdleExitTimeout=60

    The output is similar and both contain the line AutomaticUpdatePolicy=stage

    do sudo nano /etc/rpm-ostreed.conf and change AutomaticUpdatePolicy=stage to AutomaticUpdatePolicy=none manually

    This is what I just did.
    Should I also do this for /usr/etc/rpm-ostreed.conf?
    What's the difference between /etc/rpm-ostreed.conf and /usr/etc/rpm-ostreed.conf?

    Now if everything worked, the output of rpm-ostree status should no longer show something like AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 4min 22s ago and classic auto updates are therefore turned off

     malix@malix-pc ~> rpm-ostree status
     State: idle
     Deployments:
     ● ostree-image-signed:docker://ghcr.io/ublue-os/bluefin-dx-nvidia:latest
                        Digest: sha256:1ed65ccae6d651ee175e0dbff2e6a3f1bf12871f4e58a261cdb0e4346c4a3fc5
                       Version: 40.20240611.0 (2024-06-11T21:57:17Z)
               LayeredPackages: google-chrome-stable
     
       ostree-image-signed:docker://ghcr.io/ublue-os/bluefin-dx-nvidia:latest
                        Digest: sha256:1ed65ccae6d651ee175e0dbff2e6a3f1bf12871f4e58a261cdb0e4346c4a3fc5
                       Version: 40.20240611.0 (2024-06-11T21:57:17Z)
               LayeredPackages: google-chrome-stable

    Indeed

    However, it seems that my ujust toggle-updates script was in fact broken from the start, since now I can't enable the updates back

     malix@malix-pc ~> ujust toggle-updates
     Automatic updates are currently: Disabled
     Enable or Disable automatic updates?
     # I selected "enable"
     Created symlink /etc/systemd/system/timers.target.wants/ublue-update.timer → /usr/lib/systemd/system/ublue-update.timer.
     malix@malix-pc ~> rpm-ostree status
     State: idle
     Deployments:
     ● ostree-image-signed:docker://ghcr.io/ublue-os/bluefin-dx-nvidia:latest
                        Digest: sha256:1ed65ccae6d651ee175e0dbff2e6a3f1bf12871f4e58a261cdb0e4346c4a3fc5
                       Version: 40.20240611.0 (2024-06-11T21:57:17Z)
               LayeredPackages: google-chrome-stable
     
       ostree-image-signed:docker://ghcr.io/ublue-os/bluefin-dx-nvidia:latest
                        Digest: sha256:1ed65ccae6d651ee175e0dbff2e6a3f1bf12871f4e58a261cdb0e4346c4a3fc5
                       Version: 40.20240611.0 (2024-06-11T21:57:17Z)
               LayeredPackages: google-chrome-stable

Log

malix@malix-pc ~> ujust --show toggle-updates
# Turn automatic updates on or off
toggle-updates ACTION="prompt":
    #!/usr/bin/bash
    source /usr/lib/ujust/ujust.sh
    CURRENT_STATE="Disabled"
    if systemctl is-enabled ublue-update.timer | grep -q enabled; then
      CURRENT_STATE="Enabled"
    fi
    OPTION={{ ACTION }}
    if [ "$OPTION" == "prompt" ]; then
      echo "Automatic updates are currently: ${bold}${CURRENT_STATE}${normal}"
      echo "Enable or Disable automatic updates?"
      OPTION=$(ugum choose Enable Disable)
    elif [ "$OPTION" == "help" ]; then
      echo "Usage: ujust toggle-updates <option>"
      echo "  <option>: Specify the quick option - 'enable' or 'disable'"
      echo "  Use 'enable' to Enable automatic updates."
      echo "  Use 'disable' to Disable automatic updates."
      exit 0
    fi
    if [ "${OPTION,,}" == "enable" ]; then
      sudo systemctl enable ublue-update.timer
    elif [ "${OPTION,,}" == "disable" ]; then
      sudo systemctl disable ublue-update.timer
    fi

@lorduskordus

This comment was marked as outdated.

@Malix-Labs
Copy link
Contributor Author

Malix-Labs commented Jun 14, 2024

@lorduskordus
Copy link

lorduskordus commented Jun 16, 2024

Now that I looked at Bluefin's topgrade config, I think Bluefin's ublue-update does handle rpm-ostree itself and the only issue here is that the classic rpm-ostree updates are enabled, when they shouldn't be.

It's happening because the main image (that Bluefin is based on) pulls ublue-os/config, which contains the ublue-os-update-services package and main's post-install.sh script configures and enables it. This was used back when ublue-update didn't exist. The custom image module I'm using, that installs ublue-update removes this package.

Try running this to see if ublue-os-update-services package is installed:

rpm -q ublue-os-update-services

As for whether ublue-update handles rpm-ostree, if you can, try running this (with auto-updates disabled & when you know a new image exists, new images are built daily at about 16:40 UTC)

systemctl start ublue-update.service

If I'm correct, it will update your system using rpm-ostree. You should see a new entry in rpm-ostree status.

Bluefin's / Aurora's maintainers would either have to override remove the ublue-os-update-services package as well or remove it from main / config entirely.


However, it seems that my ujust toggle-updates script was in fact broken from the start, since now I can't enable the updates back

The line: AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 4min 22s ago is only related to the classic rpm-ostree auto updates. If you run ujust toggle-updates again, the CURRENT_STATE informs you whether the ublue-update.timer is enabled. If it is, auto-updates are on.

Lastly, to be clear, if I am correct, then 'undoing the package' by disabling the classic rpm-ostree updates (AutomaticUpdatePolicy=none and disabling the service) + disabling the services handling Flatpak (All of them are listed at the end of my first comment) is everything you need to do and you can use the ujust toggle-updates script.

@Malix-Labs
Copy link
Contributor Author

  • Comment from @lorduskordus :

    Try running this to see if ublue-os-update-services package is installed

     malix@malix-pc ~> rpm -q ublue-os-update-services
     package ublue-os-update-services is not installed

    Yup, not installed

    About the script, the updates apparently stopped, but the script still needs to be fixed

@Malix-Labs
Copy link
Contributor Author

After the recent 3.0.0 update, I wanted to toggle the automatic updates again,
Do you know how I could make it?

@lorduskordus

This comment has been minimized.

@Malix-Labs
Copy link
Contributor Author

Thanks for the AutomaticUpdatePolicy workaround

It would be nice if it could be added to ujust toggle-updates

@Malix-Labs Malix-Labs changed the title Automatic Updates still enabled after toggling it off ujust toggle-updates doesn't change AutomaticUpdatePolicy Updates still enabled after toggling it off Jul 3, 2024
@Malix-Labs Malix-Labs changed the title ujust toggle-updates doesn't change AutomaticUpdatePolicy Updates still enabled after toggling it off Problem: ujust toggle-updates doesn't change AutomaticUpdatePolicy Jul 3, 2024
@lorduskordus
Copy link

I installed Bluefin in a VM yesterday to not pollute this issue with assumptions anymore.

Disabled classic automatic updates provided by Fedora

  • Ran systemctl start ublue-update.service manually after new image was released. It updated the system.
  • Waited through the ublue-update.timer just to be sure. It updated the system.

That means ublue-update does handle rpm-ostree, so I guess I was right saying the classic automatic updates provided by Fedora should not be enabled. (Two tools handling system updates, disabling ublue-update doesnt stop the other tool, so system updates are still handled, hence why this issue was created.)

ujust toggle-updates works just fine, all that's needed to do is not ship classic automatic updates by Fedora on by default. It is likely an oversight.


Before ublue-update is triggered:
1

ublue-update is running:
2

ublue-update finished:
3


@Malix-off Turn off the classic auto updates by Fedora

In /etc/rpm-ostreed.conf set AutomaticUpdatePolicy=none

and do:

systemctl reload rpm-ostreed
systemctl disable rpm-ostreed-automatic.timer --now 

Use ujust toggle-updates normally, as ublue-update handles everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants