1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00
The systemd System and Service Manager
Go to file
Alan Jenkins 9ea9faff78 core: let OnCalendar= timer units expire during suspend (#8231)
On timejumps, including suspend, timer_time_change() calls for a
re-calculation of the next elapse.  Sadly I'm not quite sure what the
intended effect of this was!  Because it was not managing to fire
OnCalendar= timers which fired during the suspend... unless the timer had
already fired once before.

Reported, entirely correctly as far as I can see, on stackexchange:
https://unix.stackexchange.com/questions/351829/systemd-timer-that-expired-while-suspended

 /* If we know the last time this was
  * triggered, schedule the job based relative
- * to that. If we don't just start from
- * now. */
+ * to that. If we don't, just start from
+ * the activation time. */

The same code is called for both the initial calculation and this
re-calculation.  If we're _not_ already active, then this is before the
activation time has been recorded in the unit, so just use the current
time as before.  The new code is mechanically adapted from the same
logic for `OnActiveSec=` (case TIMER_ACTIVE in the code which follows).

Tested with `date --set`.

Motivations:

* Rotate monitoring data from Atop into files which are named per-day.
  Fedora currently implements this with a cron job that runs at midnight,
  but that didn't handle suspend correctly either.

* unbound-anchor.timer on Fedora, is used to update DNSSEC "root trust
  anchor" daily, before the TTL expires.  It uses OnCalendar=daily
  AccuracySec=24h.  Which is a bit suspect because the TTL is 2 days, but I
  think it has the right general idea.

  None of the other timer settings are correct, because they would not
  account for time spent in suspend.  Unless you set WakeSystem
  (this feature is currently undocumented).

* So in general, we can expect to see people using OnCalendar= for the same
  cases as cron.daily and cron.monthly.  Which use anacron to keep track of
  jobs which should be run even if the system was down at the time.

  Timers which are configured to run more frequently than that, are
  unlikely to mind if they get run slightly more often that the writer
  realized, relative to the amount of time the system was really running.

* From the user report above: "I only want to use remind to show a desktop
  notification, it seems excessive to wake up the computer for that. Also,
  I would like to get the reminder first thing in the morning, so the
  OnActiveSec doesn't help with that."
2018-02-28 16:12:22 +00:00
.github doc: add a new doc/ directory, and move two markdown docs into them 2018-02-27 19:59:09 +01:00
.mkosi mkosi: remove intltool from deps 2018-02-16 13:01:12 +01:00
catalog catalog: update french translation 2017-12-22 15:34:51 +01:00
coccinelle coccinelle: slightly improve run-coccinelle.sh 2018-02-28 10:01:15 +01:00
doc doc: add a new doc/ directory, and move two markdown docs into them 2018-02-27 19:59:09 +01:00
docs Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb hwdb: Fix Chuwi Hi12 orientation sensor (#8266) 2018-02-23 19:57:13 +01:00
man man: suggests TemporaryFileSystem= when people want to nest bind mounts inside InaccessiblePaths= (#8288) 2018-02-27 08:59:03 +01:00
modprobe.d Add SPDX license headers to various assorted files 2017-11-19 19:08:15 +01:00
network Add license headers and SPDX identifiers to meson.build files 2017-11-19 19:08:15 +01:00
po po: add Japanese translation (#8289) 2018-02-27 22:18:06 +01:00
presets Hook up systemd-tmpfiles as user units 2017-12-06 10:19:35 +01:00
rules rules: skip btrfs check if devices are not ready in 64-btrfs.rules (#8304) 2018-02-28 10:36:06 +01:00
scripts fuzz: add DHCP server fuzzer 2018-01-19 21:48:14 -05:00
shell-completion shell-completion: add --global and unit-paths 2018-02-09 12:27:34 +01:00
src core: let OnCalendar= timer units expire during suspend (#8231) 2018-02-28 16:12:22 +00:00
sysctl.d coredump: accept hostname on command line (#8033) 2018-02-15 12:12:46 +01:00
sysusers.d sysusers: use NOBODY_USER_NAME 2017-12-07 17:12:13 +09:00
test rule-syntax-check: fix handling of runaway strings in comma splitting (#8298) 2018-02-28 03:11:38 +03:00
tmpfiles.d nologin: extend the /run/nologin descriptions a bit (#8244) 2018-02-22 14:21:30 +01:00
tools [gdb-sd_dump_hashmaps.py] String Formatting Update (#7819) 2018-01-27 14:03:08 +01:00
travis-ci Integration of Travis CI and Coverity Scan Analysis (#7691) 2018-01-11 11:41:35 +01:00
units slice: system.slice should be perpetual like -.mount 2018-02-04 22:51:34 +00:00
xorg login: avoid external process call 2018-01-12 18:02:57 +01:00
.dir-locals.el meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
.editorconfig editorconfig: add rule for meson.build files (#6671) 2017-08-28 16:37:23 +02:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore Add mkosi.output/ to .gitignore 2017-11-29 14:33:56 +01:00
.mailmap mailmap: one more person 2018-02-14 09:43:49 +01:00
.travis.yml Integration of Travis CI and Coverity Scan Analysis (#7691) 2018-01-11 11:41:35 +01:00
.vimrc vimrc: fix indentation logic for our docbook xml files 2016-04-29 12:23:34 +02:00
.ycm_extra_conf.py ycm: add doc string for all the functions in configuration file 2017-11-29 13:21:49 -07:00
configure build-sys: add basic support for ./configure && make && make install 2017-07-18 10:05:06 -04:00
LICENSE.GPL2
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile build-sys: Fix Makefile wrapper for install target (#6548) 2017-08-07 11:29:20 +02:00
meson_options.txt meson: add -Dmemory-accounting-default=true|false 2018-02-15 12:02:41 +01:00
meson.build meson: install compat symlinks for systemctl and systemd (#8300) 2018-02-28 10:20:48 +01:00
mkosi.build separate flags from shebang 2017-12-25 19:48:49 +01:00
mkosi.default mkosi: create .mkosi directory 2016-10-06 11:53:58 -04:00
NEWS doc: add a new doc/ directory, and move two markdown docs into them 2018-02-27 19:59:09 +01:00
README README: fix context for CONFIG_DEVPTS_MULTIPLE_INSTANCES 2018-01-17 18:04:27 +00:00
README.md doc: add a new doc/ directory, and move two markdown docs into them 2018-02-27 19:59:09 +01:00
TODO TODO: drop one item 2018-02-20 17:25:05 +01:00
zanata.xml po: add basic fedora.zanata.org configuration 2018-02-19 13:56:57 +01:00

systemd - System and Service Manager

Count of open issues over time Count of open pull requests over time Build Status
Coverity Scan Status
CII Best Practices

Details

General information about systemd can be found in the systemd Wiki.

Information about build requirements are provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the HACKING file for information how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list or join our IRC channel.