mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
Backports of patch from systemd git to stable distributions
aa1f95d264
We keep a mark whether a single-shot timer was triggered in the caller's variable initial. When such a timer elapses while we are serializing/deserializing the inner state, we consider the timer incorrectly as elapsed and don't trigger it later. This patch exploits last_trigger timestamp that we already serialize, hence we can eliminate the argument initial completely. A reproducer for OnBootSec= timers: cat >repro.c <<EOD /* * Compile: gcc repro.c -o repro * Run: ./repro */ #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> #include <time.h> #include <unistd.h> int main(int argc, char *argv[]) { char command[1024]; int pause; struct timespec now; while (1) { usleep(rand() % 200000); // prevent periodic repeats clock_gettime(CLOCK_MONOTONIC, &now); printf("%i\n", now.tv_sec); system("rm -f $PWD/mark"); snprintf(command, 1024, "systemd-run --user --on-boot=%i --timer-property=AccuracySec=100ms " "touch $PWD/mark", now.tv_sec + 1); system(command); system("systemctl --user list-timers"); pause = (1000000000 - now.tv_nsec)/1000 - 70000; // fiddle to hit the middle of reloading usleep(pause > 0 ? pause : 0); system("systemctl --user daemon-reload"); sync(); sleep(2); if (open("./mark", 0) < 0) if (errno == ENOENT) { printf("mark file does not exist\n"); break; } } return 0; } EOD |
||
---|---|---|
.github/ISSUE_TEMPLATE | ||
.lgtm/cpp-queries | ||
.mkosi | ||
catalog | ||
coccinelle | ||
docs | ||
factory/etc | ||
hwdb | ||
man | ||
modprobe.d | ||
network | ||
po | ||
presets | ||
rules | ||
shell-completion | ||
src | ||
sysctl.d | ||
sysusers.d | ||
test | ||
tmpfiles.d | ||
tools | ||
travis-ci | ||
units | ||
xorg | ||
.dir-locals.el | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.mailmap | ||
.travis.yml | ||
.vimrc | ||
.ycm_extra_conf.py | ||
configure | ||
LICENSE.GPL2 | ||
LICENSE.LGPL2.1 | ||
Makefile | ||
meson_options.txt | ||
meson.build | ||
mkosi.build | ||
mkosi.default | ||
NEWS | ||
README | ||
README.md | ||
TODO | ||
zanata.xml |
systemd - System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements is 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 guide for information on 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.
Stable branches with backported patches are available in the stable repo.