summaryrefslogtreecommitdiffstats
path: root/src/core/timer.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17497 from anitazha/randomizeonceLennart Poettering2020-11-101-0/+1
|\ | | | | timer: add new feature FixedRandomDelay=
| * timer: add new feature FixedRandomDelay=Kristijan Gjoshev2020-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | FixedRandomDelay=yes will use `siphash24(sd_id128_get_machine() || MANAGER_IS_SYSTEM(m) || getuid() || u->id)`, where || is concatenation, instead of a random number to choose a value between 0 and RandomizedDelaySec= as the timer delay. This essentially sets up a fixed, but seemingly random, offset for each timer iteration rather than having a random offset recalculated each time it fires. Closes #10355 Co-author: Anita Zhang <the.anitazha@gmail.com>
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|/
* core: optionally, trigger .timer units on timezone and clock changesLennart Poettering2019-04-021-0/+2
| | | | Fixes: #6228
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-4/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* core: undo the dependency inversion between unit.h and all unit typesFelipe Sateler2018-05-151-0/+3
|
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* timer: convert property_get_next_elapse_monotonic() to use usec_shift_clock()Lennart Poettering2017-06-221-0/+2
| | | | Let's use the generic clock shifting logic here.
* core: move enforcement of the start limit into per-unit-type code againLennart Poettering2016-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Let's move the enforcement of the per-unit start limit from unit.c into the type-specific files again. For unit types that know a concept of "result" codes this allows us to hook up the start limit condition to it with an explicit result code. Also, this makes sure that the state checks in clal like service_start() may be done before the start limit is checked, as the start limit really should be checked last, right before everything has been verified to be in order. The generic start limit logic is left in unit.c, but the invocation of it is moved into the per-type files, in the various xyz_start() functions, so that they may place the check at the right location. Note that this change drops the enforcement entirely from device, slice, target and scope units, since these unit types generally may not fail activation, or may only be activated a single time. This is also documented now. Note that restores the "start-limit-hit" result code that existed before 6bf0f408e4833152197fb38fb10a9989c89f3a59 already in the service code. However, it's not introduced for all units that have a result code concept. Fixes #3166.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* core: add new RandomSec= setting for time unitsLennart Poettering2015-11-181-0/+1
| | | | | This allows configuration of a random time on top of the elapse events, in order to spread time events in a network evenly across a range.
* core: add RemainAfterElapse= setting to timer unitsLennart Poettering2015-11-171-0/+1
| | | | | | | | | | Previously, after a timer unit elapsed we'd leave it around for good, which has the nice benefit that starting a timer that shall trigger at a specific point in time multiple times will only result in one trigger instead of possibly many. With this change a new option RemainAfterElapse= is added. It defaults to "true", to mimic the old behaviour. If set to "false" timer units will be unloaded after they elapsed. This is specifically useful for transient timer units.
* Move all unit states to basic/ and extend systemctl --state=helpZbigniew Jędrzejewski-Szmek2015-09-281-13/+0
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-231-1/+0
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* timer: support timers that can resume the system from suspendLennart Poettering2014-03-241-4/+3
|
* timer: add timer persistance (aka anacron-like behaviour)Lennart Poettering2014-03-211-1/+5
|
* timer: make timer accuracy configurableLennart Poettering2013-11-211-0/+2
| | | | And make it default to 1min
* core: convert PID 1 to libsystemd-busLennart Poettering2013-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | This patch converts PID 1 to libsystemd-bus and thus drops the dependency on libdbus. The only remaining code using libdbus is a test case that validates our bus marshalling against libdbus' marshalling, and this dependency can be turned off. This patch also adds a couple of things to libsystem-bus, that are necessary to make the port work: - Synthesizing of "Disconnected" messages when bus connections are severed. - Support for attaching multiple vtables for the same interface on the same path. This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus calls which used an inappropriate signature. As a side effect we will now generate PropertiesChanged messages which carry property contents, rather than just invalidation information.
* Add __attribute__((const, pure, format)) in various placesZbigniew Jędrzejewski-Szmek2013-05-031-6/+6
| | | | | | | | I'm assuming that it's fine if a _const_ or _pure_ function calls assert. It is assumed that the assert won't trigger, and even if it does, it can only trigger on the first call with a given set of parameters, and we don't care if the compiler moves the order of calls.
* timer: make sure we restart timers even if units are still running or if one ↵Lennart Poettering2013-04-231-0/+2
| | | | of their conditions fails
* unit: rework trigger dependency logicLennart Poettering2013-04-231-3/+0
| | | | | | | | | | | Instead of having explicit type-specific callbacks that inform the triggering unit when a triggered unit changes state, make this generic so that state changes are forwarded betwee any triggered and triggering unit. Also, get rid of UnitRef references from automount, timer, path units, to the units they trigger and rely exclsuively on UNIT_TRIGGER type dendencies.
* units: for all unit settings that take lists, allow the empty string for ↵Lennart Poettering2013-01-171-0/+2
| | | | | | resetting the lists https://bugzilla.redhat.com/show_bug.cgi?id=756787
* dbus: properly serialize calendar timer dataLennart Poettering2013-01-101-2/+2
| | | | | | | As it turns out the bus properties for timer units wre really broken, so let's clean this up for good and properly add calendar timer serialization. We really should get that right before finalizing the bus API documentation in the wiki...
* timer: implement calendar time eventsLennart Poettering2012-11-231-5/+11
|
* use #pragma once instead of foo*foo #define guardsShawn Landden2012-07-191-4/+1
| | | | | | | | | | | | | | | | | #pragma once has been "un-deprecated" in gcc since 3.3, and is widely supported in other compilers. I've been using and maintaining (rebasing) this patch for a while now, as it annoyed me to see #ifndef fooblahfoo, etc all over the place, almost arrogant about the annoyance of having to define all these names to perform a commen but neccicary functionality, when a completely superior alternative exists. I havn't sent it till now, cause its kindof a style change, and it is bad voodoo to mess with style that has been established by more established editors. So feel free to lambast me as a crazy bafoon. v2 - preserve externally used headers
* relicense to LGPLv2.1 (with exceptions)Lennart Poettering2012-04-121-4/+4
| | | | | | | | | | | | | | We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
* move libsystemd_core.la sources into core/Kay Sievers2012-04-111-0/+93