Skip to content

Add support for unattended upgrades #1301

Closed

Description

@mattiaswal

Description

Run a script in cron defined by user settings in the YANG model.

Example YANG:

  augment "/sys:system" {
    container unattended-upgrades {
      description
        "Configuration for automatic system software updates.

        When enabled, the system will automatically check for and
        install software upgrades at the specified time.";

      leaf enable {
        type boolean;
        default false;
        description
          "Enable or disable unattended upgrades.

          When set to true, the system will automatically check for
          available software updates and install them at the configured
          time.";
      }

      leaf time {
        type string {
          pattern '[0-2][0-9]:[0-5][0-9]';
        }
        mandatory true;
        description
          "Time of day to run the upgrade check and installation.

          Specified in 24-hour format as HH:MM (e.g., '02:00' for 2 AM,
          '14:30' for 2:30 PM).";
      }

      leaf-list day-of-week {
        type enumeration {
          enum "monday";
          enum "tuesday";
          enum "wednesday";
          enum "thursday";
          enum "friday";
          enum "saturday";
          enum "sunday";
        }
        description
          "Days of the week to run unattended upgrades.

          If not specified, upgrades will run daily. Multiple days
          can be selected to run upgrades only on specific days of
          the week.";
      }
    }
  }

Additional Information

No response

General Information

Anyone can help out by sponsoring development of new features or contributing pull requests.
Please use this issue for discussions related to the feature.

Activity

  1. added
    triagePending investigation & classification (CCB)
    enhancementNew feature or request
    on Dec 3, 2025
  2. wkz commented on Dec 4, 2025

    @wkz
    Contributor

    AFAIK, this is the first, but probably not the last, scheduled config. Should we look at prior work to make sure we can configure all "schedulable" things in a uniform way?

  3. troglobit commented on Dec 4, 2025

    @troglobit
    Contributor

    AFAIK, this is the first, but probably not the last, scheduled config. Should we look at prior work to make sure we can configure all "schedulable" things in a uniform way?

    Agreed. I brought up exactly that model in AFK discussions with @mattiaswal yesterday. Sorry for not updating the issue.

  4. removed
    triagePending investigation & classification (CCB)
    on Dec 8, 2025
  5. added this to the FUTURE milestone on Dec 8, 2025
  6. mattiaswal commented on Dec 21, 2025

    @mattiaswal
    ContributorAuthor

    Good point, new suggestion, using ietf-schedule, limited on what cron supports.

    module: ietf-schedule
    
    module: infix-schedule
    
      augment /sys:system:
        +--rw schedules
           +--rw schedule* [name]
              +--rw name           string
              +--rw enabled?       boolean
              +--rw description?   string
              +--rw (action)
              |  +--:(predefined)
              |  |  +--rw predefined-action?   identityref
              |  +--:(custom)
              |     +--rw command?   string
              +--rw recurrence {schedule:basic-recurrence}?
              |  +---u schedule:recurrence-basic
              |  +--rw byhour*                      uint32
              |  +--rw byminute*                    uint32
              |  +--rw byday* [weekday]
              |  |  +--rw weekday    schedule:weekday
              |  +--rw bymonthday*                  int32
              |  +--rw byyearmonth*                 uint32
              +--ro status
                 +---u schedule:schedule-status
                 +--ro cron-expression?            string
    
  7. troglobit commented on Feb 26, 2026

    @troglobit
    Contributor

    Good point, new suggestion, using ietf-schedule, limited on what cron supports.
    augment /sys:system:
    +--rw schedules
    +--rw schedule* [name]
    +--rw name string
    +--rw enabled? boolean
    +--rw description? string
    +--rw (action)
    | +--:(predefined)
    | | +--rw predefined-action? identityref

    So the idea here is to set up a predefined-action right? First one being check-upgrades perhaps, and then unattended-upgrade and unattended-fixes (for patch-releases only)?

  8. wkz commented on Feb 27, 2026

    @wkz
    Contributor

    Wouldn't you have a single predefined-action ("unattended-updates"), which would mean "at the declared rate, check for and update software according to my policy in /system/software/unattended-updates?

    Inside that container, you would then declare things like "limit to patch releases on the current minor", "update bootloader and OS, but not containers", or whatever.

  9. troglobit commented on May 25, 2026

    @troglobit
    Contributor

    Welcome to the team, officially, @saba8814! For this task, start by familiarizing you with RFC9922 and when you've got an idea about how to run cronjobs with it then we can have a talk about any superfluous nodes/functionality in the YANG model, or even missing nodes on a whiteboard.

    Good luck!

  10. added theissue type on May 25, 2026
  11. 16 remaining items

  12. added 13 commits that reference this issue on Sep 11, 2026
    f7ff5be
    e3ee892
    8c76489
    8ec0677
    da75191
    0463e0f
    7e5038b
    d680330
    c5f086f
    53532c4
    efb15c9
    34594e4
    2beb143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cn:dreamCommon Name: Dream ProjectenhancementNew feature or request

Type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions