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

autoupgrade not run when the machine doesn't run all the time #15689

Closed
mz-pdm opened this issue May 25, 2016 · 8 comments
Closed

autoupgrade not run when the machine doesn't run all the time #15689

mz-pdm opened this issue May 25, 2016 · 8 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos

Comments

@mz-pdm
Copy link

mz-pdm commented May 25, 2016

Issue description

I've got the following options set in my configuration.nix:

system.autoUpgrade.enable = true;
system.autoUpgrade.dates = "11:45";

However, autoupgrade is never performed on my desktop computer that is switched on only during the day hours. systemd is not going to run the job the first day after boot:

systemctl list-timers

NEXT LEFT LAST PASSED UNIT ACTIVATES
Thu 2016-05-26 02:15:00 CEST 16h left n/a n/a update-locatedb.timer update-locatedb.service
Thu 2016-05-26 08:47:33 CEST 23h left Wed 2016-05-25 08:47:33 CEST 55min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Thu 2016-05-26 11:45:00 CEST 1 day 2h left n/a n/a nixos-upgrade.timer nixos-upgrade.service

Steps to reproduce

Set the options in configuration.nix as above and check with systemctl when the job is going to be run.

Technical details

  • System: 16.03.836.aff03ae (Emu)
  • Nix version: nix-env (Nix) 1.11.2
  • Nixpkgs version: 16.03.836.aff03ae
@grahamc
Copy link
Member

grahamc commented Jun 25, 2016

So if the computer is never on during the time set for auto-upgrade, what time is appropriate for auto-upgrade? How do we pick?

@bjornfor
Copy link
Contributor

@grahamc: I think systemd has an option to start a service as soon as possible if it missed the previous timer event due to the machine being powered off.

@mz-pdm
Copy link
Author

mz-pdm commented Jul 15, 2016

@grahamc: The computer is on during the set time. Let's say it boots on at 9:00 but the job is not run at 11:45 even when the computer is running since 9:00. As you can see from the systemd output above, systemd apparently doesn't want to run the timer the first day after boot for some mysterious reason. And I shutdown the computer in the evening so the job is never run.

@mz-pdm
Copy link
Author

mz-pdm commented Sep 3, 2016

It started to work recently. Now the job is run already the first day after boot.

@mz-pdm mz-pdm closed this as completed Sep 3, 2016
@tex
Copy link
Contributor

tex commented Dec 28, 2020

This is happening to me. Laptop. Every time after startup the two timers (upgrade and gc) shows they never run and will run next day...

configuration.nix:

  system.autoUpgrade.enable = true;
milan@nixos> nixos-version                                                                                                            ~
20.09.2382.ca119749d86 (Nightingale)

milan@nixos> systemctl list-timers                                                                                                    ~
NEXT                        LEFT          LAST                        PASSED     UNIT                         ACTIVATES                >
Mon 2020-12-28 13:33:07 CET 14min left    n/a                         n/a        systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.se>
Mon 2020-12-28 14:55:31 CET 1h 36min left Mon 2020-12-21 18:25:44 CET 6 days ago fstrim.timer                 fstrim.service           >
Mon 2020-12-28 19:30:00 CET 6h left       Thu 2020-12-24 19:30:20 CET 3 days ago borg-system-backup.timer     borg-system-backup.servic>
Tue 2020-12-29 03:15:00 CET 13h left      n/a                         n/a        nix-gc.timer                 nix-gc.service           >
Tue 2020-12-29 04:40:00 CET 15h left      n/a                         n/a        nixos-upgrade.timer          nixos-upgrade.service    >

5 timers listed.
Pass --all to see loaded but inactive timers, too.
milan@nixos> date                                                                                                                     ~
Mon 28 Dec 2020 01:23:29 PM CET
milan@nixos>                                                                                                                          ~

@tex tex reopened this Dec 28, 2020
@tex
Copy link
Contributor

tex commented Dec 28, 2020

Basically issue #75861...

@stale
Copy link

stale bot commented Jun 26, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 26, 2021
@bjornfor
Copy link
Contributor

Closing since we have system.autoUpgrade.persistent option since NixOS 22.05 (from #107957).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos
Projects
None yet
Development

No branches or pull requests

5 participants