summaryrefslogtreecommitdiff
path: root/src/core/timer.c
Commit message (Collapse)AuthorAge
* core: do not spawn jobs or touch other units during coldpluggingIvan Shapovalov2015-03-07
| | | | | | | | | | | | | Because the order of coldplugging is not defined, we can reference a not-yet-coldplugged unit and read its state while it has not yet been set to a meaningful value. This way, already active units may get started again. We fix this by deferring such actions until all units have been at least somehow coldplugged. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=88401
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | 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.
* core: output unit status output strings to console, only if we actually are ↵Lennart Poettering2015-01-28
| | | | | | | | | changing unit state Unit _start() and _stop() implementations can fail with -EAGAIN to delay execution temporarily. Thus, we should not output status messages before invoking these calls, but after, and only when we know that the invocation actually made a change.
* timer: timer can be a transient unitWaLyong Cho2014-12-08
|
* treewide: convert some left-over (usec_t) -1 to USEC_INFINITYLennart Poettering2014-11-28
|
* treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1Lennart Poettering2014-11-28
|
* treewide: more log_*_errno + return simplificationsMichal Schmidt2014-11-28
|
* core: convert log_unit_*() to log_unit_*_errno()Michal Schmidt2014-11-28
| | | | | | Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_unit_(debug|info|notice|warning|error|emergency)\(([^"]+), "(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_unit_\1_errno(\2, \5, "\3%m"\4);/'
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* log: rearrange log function namingLennart Poettering2014-11-27
| | | | | | | | | | - Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
* timer: reenable TIMER_ACTIVE timers when restartedMichael Chapman2014-11-07
| | | | | | | | | A timer configured with OnActiveSec will start its associated unit again if the timer is stopped, then started. However, if the timer unit is restarted -- with "systemctl restart", say -- this does not occur. This commit ensures that TIMER_ACTIVE timers are re-enabled whenever the timer is started, even if that's within a restart job.
* Do not format USEC_INFINITY as NULLZbigniew Jędrzejewski-Szmek2014-09-29
| | | | | | | | | | | systemctl would print 'CPUQuotaPerSecUSec=(null)' for no limit. This does not look right. Since USEC_INFINITY is one of the valid values, format_timespan() could return NULL, and we should wrap every use of it in strna() or similar. But most callers didn't do that, and it seems more robust to return a string ("infinity") that makes sense most of the time, even if in some places the result will not be grammatically correct.
* timer: order OnCalendar units after timer-sync.target if DefaultDependencies=noTobias Geerinckx-Rice2014-08-14
| | | | | Avoids triggering timers prematurely on systems with significantly inaccurate clocks, or some embedded platforms that lack one entirely.
* time-util: add and use USEC/NSEC_INFINIYKay Sievers2014-07-29
|
* timer: name the stamp file consistentlyMichał Bartoszkiewicz2014-06-26
| | | | | The stamp file for systemd --user timers was named stamp-foo.timer if XDG_DATA_HOME was unset, but foo.timer otherwise.
* core: timer - switch to touch_file()Kay Sievers2014-05-24
|
* core: Make sure a stamp file exists for all Persistent=true timersThomas Bächler2014-04-12
| | | | | | | | | | If a persistent timer has no stamp file yet, it behaves just like a normal timer until it runs for the first time. If the system is always shut down while the timer is supposed to run, a stamp file is never created and Peristent=true has no effect. This patch fixes this by creating a stamp file with the current time when the timer is first started.
* core: add a setting to globally control the default for timer unit accuracyLennart Poettering2014-03-24
|
* timer: support timers that can resume the system from suspendLennart Poettering2014-03-24
|
* sd-event: rework API to support CLOCK_REALTIME_ALARM and ↵Lennart Poettering2014-03-24
| | | | CLOCK_BOOTTIME_ALARM, too
* timer: add timer persistance (aka anacron-like behaviour)Lennart Poettering2014-03-21
|
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
* core: no need to list properties for PropertiesChanged messages anymoreLennart Poettering2013-12-22
| | | | Since the vtable includes this information anyway, let's just use that
* timer: make timer accuracy configurableLennart Poettering2013-11-21
| | | | And make it default to 1min
* core: convert PID 1 to libsystemd-busLennart Poettering2013-11-20
| | | | | | | | | | | | | | | | | | | | | | 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.
* list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering2013-10-14
| | | | | | | each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
* Add __attribute__((const, pure, format)) in various placesZbigniew Jędrzejewski-Szmek2013-05-02
| | | | | | | | 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.
* unit: rework stop pending logicLennart Poettering2013-04-25
| | | | | | | | | | | When a trigger unit wants to know if a stop is queued for it, we should just check precisely that and do not check whether it is actually stopped already. This is because we use these checks usually from state change calls where the state variables are not updated yet. This change splits unit_pending_inactive() into two calls unit_inactive_or_pending() and unit_stop_pending(). The former checks state and pending jobs, the latter only pending jobs.
* timer: make sure we restart timers even if units are still running or if one ↵Lennart Poettering2013-04-23
| | | | of their conditions fails
* unit: rework trigger dependency logicLennart Poettering2013-04-23
| | | | | | | | | | | 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.
* Move bus_error to dbus-common and remove bus_error_message_or_strerrorSimon Peeters2013-04-18
| | | | | bus_error and bus_error_message_or_strerror dit almost exactly the same, so use only one of them and place it in dbus-common.
* util: make time formatting a bit smarterLennart Poettering2013-04-04
| | | | | | | | | | | Instead of outputting "5h 55s 50ms 3us" we'll now output "5h 55.050003s". Also, while outputting the accuracy is configurable. Basically we now try use "dot notation" for all time values > 1min. For >= 1s we use 's' as unit, otherwise for >= 1ms we use 'ms' as unit, and finally 'us'. This should give reasonably values in most cases.
* units: introduce new timers.target and paths.target to hook timer/path units ↵Lennart Poettering2013-03-25
| | | | into for boot
* timer: downgrade time change message to debugMichal Schmidt2013-03-25
| | | | | | | | The manager already prints "Time has been changed" at level info. It seems too verbose to print the time change message additionally for every waiting timer unit. Downgrade the per-unit message to debug.
* timer: fix grammar in messageZbigniew Jędrzejewski-Szmek2013-03-15
|
* units: for all unit settings that take lists, allow the empty string for ↵Lennart Poettering2013-01-17
| | | | | | resetting the lists https://bugzilla.redhat.com/show_bug.cgi?id=756787
* dbus: properly serialize calendar timer dataLennart Poettering2013-01-10
| | | | | | | 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...
* systemd: use unit logging macrosZbigniew Jędrzejewski-Szmek2013-01-06
|
* timer: recalculate next elapse for calendar timer units when the system ↵Lennart Poettering2012-11-25
| | | | clock is changed
* timer: implement calendar time eventsLennart Poettering2012-11-23
|
* core: move ManagerRunningAs to sharedZbigniew Jędrzejewski-Szmek2012-09-18
| | | | | | | Note: I did s/MANAGER/SYSTEMD/ everywhere, even though it makes the patch quite verbose. Nevertheless, keeping MANAGER prefix in some places, and SYSTEMD prefix in others would just lead to confusion down the road. Better to rip off the band-aid now.
* manager: extend performance measurement interface to include firmware/loader ↵Lennart Poettering2012-09-13
| | | | | | | | | | | | | times This only adds the fields to the D-Bus interfaces but doesn't fill them in with anything useful yet. Gummiboot exposes the necessary bits of information to use however and as soon as I get my fingers on a proper UEFI laptop I'll hook up the remaining bits. Since we want to stabilize the D-Bus interface soon and include it in the stability promise we should get the last fixes in, hence this change now.
* unit: get rid of UnitVTable.suffix, which is now unusedLennart Poettering2012-07-10
|
* relicense to LGPLv2.1 (with exceptions)Lennart Poettering2012-04-12
| | | | | | | | | | | | | | 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-11