• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 30055979440

23 Jul 2026 05:57PM UTC coverage: 73.111% (+0.04%) from 73.067%
30055979440

push

github

yuwata
user-record: validate JSON shell fields with valid_shell()

The user record loader currently uses a generic filename-or-path check
for shell and fallbackShell. This allows values that homectl rejects,
including relative names, control characters, colons, and trailing
slashes.

Use valid_shell() for all three record locations and cover the top-level,
matching per-machine, and status fallback fields at the loader boundary.

Fixes #43066

35 of 36 new or added lines in 2 files covered. (97.22%)

514 existing lines in 41 files now uncovered.

346901 of 474487 relevant lines covered (73.11%)

1323376.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.68
/src/core/timer.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <stdlib.h>
4
#include <sys/stat.h>
5
#include <unistd.h>
6

7
#include "sd-bus.h"
8

9
#include "alloc-util.h"
10
#include "bus-error.h"
11
#include "calendarspec.h"
12
#include "dbus-timer.h"
13
#include "dbus-unit.h"
14
#include "fs-util.h"
15
#include "manager.h"
16
#include "random-util.h"
17
#include "serialize.h"
18
#include "siphash24.h"
19
#include "special.h"
20
#include "string-table.h"
21
#include "string-util.h"
22
#include "strv.h"
23
#include "timer.h"
24
#include "unit.h"
25
#include "user-util.h"
26
#include "virt.h"
27

28
static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
29
        [TIMER_DEAD]    = UNIT_INACTIVE,
30
        [TIMER_WAITING] = UNIT_ACTIVE,
31
        [TIMER_RUNNING] = UNIT_ACTIVE,
32
        [TIMER_ELAPSED] = UNIT_ACTIVE,
33
        [TIMER_FAILED]  = UNIT_FAILED,
34
};
35

36
static int timer_dispatch(sd_event_source *s, uint64_t usec, void *userdata);
37

38
static void timer_init(Unit *u) {
971✔
39
        Timer *t = ASSERT_PTR(TIMER(u));
971✔
40

41
        assert(u->load_state == UNIT_STUB);
971✔
42

43
        t->next_elapse_monotonic_or_boottime = USEC_INFINITY;
971✔
44
        t->next_elapse_realtime = USEC_INFINITY;
971✔
45
        t->accuracy_usec = u->manager->defaults.timer_accuracy_usec;
971✔
46
        t->remain_after_elapse = true;
971✔
47
}
971✔
48

49
void timer_free_values(Timer *t) {
976✔
50
        TimerValue *v;
976✔
51

52
        assert(t);
976✔
53

54
        while ((v = LIST_POP(value, t->values))) {
2,445✔
55
                calendar_spec_free(v->calendar_spec);
1,469✔
56
                free(v);
1,469✔
57
        }
58
}
976✔
59

60
static void timer_done(Unit *u) {
971✔
61
        Timer *t = ASSERT_PTR(TIMER(u));
971✔
62

63
        timer_free_values(t);
971✔
64

65
        t->monotonic_event_source = sd_event_source_disable_unref(t->monotonic_event_source);
971✔
66
        t->realtime_event_source = sd_event_source_disable_unref(t->realtime_event_source);
971✔
67

68
        t->stamp_path = mfree(t->stamp_path);
971✔
69
}
971✔
70

71
static int timer_verify(Timer *t) {
964✔
72
        assert(t);
964✔
73
        assert(UNIT(t)->load_state == UNIT_LOADED);
964✔
74

75
        if (!t->values && !t->on_clock_change && !t->on_timezone_change)
964✔
76
                return log_unit_error_errno(UNIT(t), SYNTHETIC_ERRNO(ENOEXEC), "Timer unit lacks value setting. Refusing.");
5✔
77

78
        return 0;
79
}
80

81
static int timer_add_default_dependencies(Timer *t) {
964✔
82
        int r;
964✔
83

84
        assert(t);
964✔
85

86
        if (!UNIT(t)->default_dependencies)
964✔
87
                return 0;
88

89
        r = unit_add_dependency_by_name(UNIT(t), UNIT_BEFORE, SPECIAL_TIMERS_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
964✔
90
        if (r < 0)
964✔
91
                return r;
92

93
        if (MANAGER_IS_SYSTEM(UNIT(t)->manager)) {
964✔
94
                r = unit_add_two_dependencies_by_name(UNIT(t), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
718✔
95
                if (r < 0)
718✔
96
                        return r;
97

98
                LIST_FOREACH(value, v, t->values) {
1,213✔
99
                        if (v->base != TIMER_CALENDAR)
961✔
100
                                continue;
495✔
101

102
                        FOREACH_STRING(target, SPECIAL_TIME_SYNC_TARGET, SPECIAL_TIME_SET_TARGET) {
1,398✔
103
                                r = unit_add_dependency_by_name(UNIT(t), UNIT_AFTER, target, true, UNIT_DEPENDENCY_DEFAULT);
932✔
104
                                if (r < 0)
932✔
105
                                        return r;
×
106
                        }
107

108
                        break;
466✔
109
                }
110
        }
111

112
        return unit_add_two_dependencies_by_name(UNIT(t), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
964✔
113
}
114

115
static int timer_add_trigger_dependencies(Timer *t) {
964✔
116
        Unit *x;
964✔
117
        int r;
964✔
118

119
        assert(t);
964✔
120

121
        if (UNIT_TRIGGER(UNIT(t)))
964✔
122
                return 0;
964✔
123

124
        r = unit_load_related_unit(UNIT(t), ".service", &x);
964✔
125
        if (r < 0)
964✔
126
                return r;
127

128
        return unit_add_two_dependencies(UNIT(t), UNIT_BEFORE, UNIT_TRIGGERS, x, true, UNIT_DEPENDENCY_IMPLICIT);
964✔
129
}
130

131
static int timer_setup_persistent(Timer *t) {
964✔
132
        _cleanup_free_ char *stamp_path = NULL;
964✔
133
        int r;
964✔
134

135
        assert(t);
964✔
136

137
        if (!t->persistent)
964✔
138
                return 0;
139

140
        if (MANAGER_IS_SYSTEM(UNIT(t)->manager)) {
460✔
141

142
                r = unit_add_mounts_for(UNIT(t), "/var/lib/systemd/timers", UNIT_DEPENDENCY_FILE, UNIT_MOUNT_REQUIRES);
460✔
143
                if (r < 0)
460✔
144
                        return r;
145

146
                stamp_path = strjoin("/var/lib/systemd/timers/stamp-", UNIT(t)->id);
460✔
147
        } else {
148
                const char *e;
×
149

150
                e = getenv("XDG_DATA_HOME");
×
151
                if (e)
×
152
                        stamp_path = strjoin(e, "/systemd/timers/stamp-", UNIT(t)->id);
×
153
                else {
154

155
                        _cleanup_free_ char *h = NULL;
×
156

157
                        r = get_home_dir(&h);
×
158
                        if (r < 0)
×
159
                                return log_unit_error_errno(UNIT(t), r, "Failed to determine home directory: %m");
×
160

161
                        stamp_path = strjoin(h, "/.local/share/systemd/timers/stamp-", UNIT(t)->id);
×
162
                }
163
        }
164

165
        if (!stamp_path)
460✔
166
                return log_oom();
×
167

168
        return free_and_replace(t->stamp_path, stamp_path);
460✔
169
}
170

171
static uint64_t timer_get_fixed_delay_hash(Timer *t) {
×
172
        static const uint8_t hash_key[] = {
×
173
                0x51, 0x0a, 0xdb, 0x76, 0x29, 0x51, 0x42, 0xc2,
174
                0x80, 0x35, 0xea, 0xe6, 0x8e, 0x3a, 0x37, 0xbd
175
        };
176

177
        struct siphash state;
×
178
        sd_id128_t machine_id;
×
179
        uid_t uid;
×
180
        int r;
×
181

182
        assert(t);
×
183

184
        uid = getuid();
×
185
        r = sd_id128_get_machine(&machine_id);
×
186
        if (r < 0) {
×
187
                log_unit_debug_errno(UNIT(t), r,
×
188
                                     "Failed to get machine ID for the fixed delay calculation, proceeding with 0: %m");
189
                machine_id = SD_ID128_NULL;
×
190
        }
191

192
        siphash24_init(&state, hash_key);
×
193
        siphash24_compress_typesafe(machine_id, &state);
×
194
        siphash24_compress_boolean(MANAGER_IS_SYSTEM(UNIT(t)->manager), &state);
×
195
        siphash24_compress_typesafe(uid, &state);
×
196
        siphash24_compress_string(UNIT(t)->id, &state);
×
197

198
        return siphash24_finalize(&state);
×
199
}
200

201
static int timer_load(Unit *u) {
978✔
202
        Timer *t = ASSERT_PTR(TIMER(u));
978✔
203
        int r;
978✔
204

205
        assert(u->load_state == UNIT_STUB);
978✔
206

207
        r = unit_load_fragment_and_dropin(u, true);
978✔
208
        if (r < 0)
978✔
209
                return r;
210

211
        if (u->load_state != UNIT_LOADED)
966✔
212
                return 0;
213

214
        /* This is a new unit? Then let's add in some extras */
215
        r = timer_add_trigger_dependencies(t);
964✔
216
        if (r < 0)
964✔
217
                return r;
218

219
        r = timer_setup_persistent(t);
964✔
220
        if (r < 0)
964✔
221
                return r;
222

223
        r = timer_add_default_dependencies(t);
964✔
224
        if (r < 0)
964✔
225
                return r;
226

227
        return timer_verify(t);
964✔
228
}
229

230
static void timer_dump(Unit *u, FILE *f, const char *prefix) {
3✔
231
        Timer *t = ASSERT_PTR(TIMER(u));
3✔
232
        Unit *trigger;
3✔
233

234
        assert(f);
3✔
235
        assert(prefix);
3✔
236

237
        trigger = UNIT_TRIGGER(u);
3✔
238

239
        fprintf(f,
22✔
240
                "%sTimer State: %s\n"
241
                "%sResult: %s\n"
242
                "%sUnit: %s\n"
243
                "%sPersistent: %s\n"
244
                "%sWakeSystem: %s\n"
245
                "%sAccuracy: %s\n"
246
                "%sRemainAfterElapse: %s\n"
247
                "%sFixedRandomDelay: %s\n"
248
                "%sOnClockChange: %s\n"
249
                "%sOnTimeZoneChange: %s\n"
250
                "%sDeferReactivation: %s\n",
251
                prefix, timer_state_to_string(t->state),
252
                prefix, timer_result_to_string(t->result),
253
                prefix, trigger ? trigger->id : "n/a",
254
                prefix, yes_no(t->persistent),
255
                prefix, yes_no(t->wake_system),
256
                prefix, FORMAT_TIMESPAN(t->accuracy_usec, 1),
3✔
257
                prefix, yes_no(t->remain_after_elapse),
258
                prefix, yes_no(t->fixed_random_delay),
259
                prefix, yes_no(t->on_clock_change),
260
                prefix, yes_no(t->on_timezone_change),
261
                prefix, yes_no(t->defer_reactivation));
262

263
        LIST_FOREACH(value, v, t->values)
7✔
264
                if (v->base == TIMER_CALENDAR) {
4✔
265
                        _cleanup_free_ char *p = NULL;
2✔
266

267
                        (void) calendar_spec_to_string(v->calendar_spec, &p);
2✔
268

269
                        fprintf(f,
2✔
270
                                "%s%s: %s\n",
271
                                prefix,
272
                                timer_base_to_string(v->base),
273
                                strna(p));
274
                } else
275
                        fprintf(f,
2✔
276
                                "%s%s: %s\n",
277
                                prefix,
278
                                timer_base_to_string(v->base),
279
                                FORMAT_TIMESPAN(v->value, 0));
2✔
280
}
3✔
281

282
static void timer_set_state(Timer *t, TimerState state) {
1,221✔
283
        TimerState old_state;
1,221✔
284

285
        assert(t);
1,221✔
286

287
        if (t->state != state)
1,221✔
288
                bus_unit_send_pending_change_signal(UNIT(t), false);
1,171✔
289

290
        old_state = t->state;
1,221✔
291
        t->state = state;
1,221✔
292

293
        if (state != TIMER_WAITING) {
1,221✔
294
                t->monotonic_event_source = sd_event_source_disable_unref(t->monotonic_event_source);
313✔
295
                t->realtime_event_source = sd_event_source_disable_unref(t->realtime_event_source);
313✔
296
                t->next_elapse_monotonic_or_boottime = USEC_INFINITY;
313✔
297
                t->next_elapse_realtime = USEC_INFINITY;
313✔
298
        }
299

300
        if (state != old_state)
1,221✔
301
                log_unit_debug(UNIT(t), "Changed %s -> %s", timer_state_to_string(old_state), timer_state_to_string(state));
1,171✔
302

303
        unit_notify(UNIT(t), state_translation_table[old_state], state_translation_table[state], /* reload_success= */ true);
1,221✔
304
}
1,221✔
305

306
static void timer_enter_waiting(Timer *t, bool time_change);
307

308
static int timer_coldplug(Unit *u) {
655✔
309
        Timer *t = ASSERT_PTR(TIMER(u));
655✔
310

311
        assert(t->state == TIMER_DEAD);
655✔
312

313
        if (t->deserialized_state == t->state)
655✔
314
                return 0;
315

316
        if (t->deserialized_state == TIMER_WAITING)
516✔
317
                timer_enter_waiting(t, false);
514✔
318
        else
319
                timer_set_state(t, t->deserialized_state);
2✔
320

321
        return 0;
322
}
323

324
static void timer_enter_dead(Timer *t, TimerResult f) {
292✔
325
        assert(t);
292✔
326

327
        if (t->result == TIMER_SUCCESS || f == TIMER_FAILURE_START_LIMIT_HIT)
292✔
328
                t->result = f;
292✔
329

330
        unit_log_result(UNIT(t), t->result == TIMER_SUCCESS, timer_result_to_string(t->result));
292✔
331
        timer_set_state(t, t->result != TIMER_SUCCESS ? TIMER_FAILED : TIMER_DEAD);
584✔
332
}
292✔
333

334
static void timer_enter_elapsed(Timer *t, bool leave_around) {
2✔
335
        assert(t);
2✔
336

337
        /* If a unit is marked with RemainAfterElapse=yes we leave it
338
         * around even after it elapsed once, so that starting it
339
         * later again does not necessarily mean immediate
340
         * retriggering. We unconditionally leave units with
341
         * TIMER_UNIT_ACTIVE or TIMER_UNIT_INACTIVE triggers around,
342
         * since they might be restarted automatically at any time
343
         * later on. */
344

345
        if (t->remain_after_elapse || leave_around)
2✔
346
                timer_set_state(t, TIMER_ELAPSED);
2✔
347
        else
348
                timer_enter_dead(t, TIMER_SUCCESS);
×
349
}
2✔
350

351
static void add_random_delay(Timer *t, usec_t *v) {
911✔
352
        usec_t add;
911✔
353

354
        assert(t);
911✔
355
        assert(v);
911✔
356

357
        if (t->random_delay_usec == 0)
911✔
358
                return;
359
        if (*v == USEC_INFINITY)
191✔
360
                return;
361

362
        add = (t->fixed_random_delay ? timer_get_fixed_delay_hash(t) : random_u64()) % t->random_delay_usec;
382✔
363

364
        if (*v + add < *v) /* overflow */
191✔
365
                *v = (usec_t) -2; /* Highest possible value, that is not USEC_INFINITY */
×
366
        else
367
                *v += add;
191✔
368

369
        log_unit_debug(UNIT(t), "Adding %s random time.", FORMAT_TIMESPAN(add, 0));
191✔
370
}
371

372
static void timer_enter_waiting(Timer *t, bool time_change) {
910✔
373
        bool found_monotonic = false, found_realtime = false;
910✔
374
        bool leave_around = false;
910✔
375
        triple_timestamp ts;
910✔
376
        Unit *trigger;
910✔
377
        int r;
910✔
378

379
        assert(t);
910✔
380

381
        trigger = UNIT_TRIGGER(UNIT(t));
910✔
382
        if (!trigger) {
910✔
383
                log_unit_error(UNIT(t), "Unit to trigger vanished.");
×
384
                goto fail;
×
385
        }
386

387
        triple_timestamp_now(&ts);
910✔
388
        t->next_elapse_monotonic_or_boottime = t->next_elapse_realtime = 0;
910✔
389

390
        LIST_FOREACH(value, v, t->values) {
2,336✔
391
                if (v->disabled)
1,426✔
392
                        continue;
13✔
393

394
                if (v->base == TIMER_CALENDAR) {
1,413✔
395
                        bool rebase_after_boot_time = false;
410✔
396
                        usec_t b, random_offset = 0;
410✔
397
                        usec_t boot_monotonic = UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].monotonic;
410✔
398

399
                        if (t->random_offset_usec != 0)
410✔
400
                                random_offset = timer_get_fixed_delay_hash(t) % t->random_offset_usec;
×
401

402
                        /* If DeferReactivation= is enabled, schedule the job based on the last time
403
                         * the trigger unit entered inactivity. Otherwise, if we know the last time
404
                         * this was triggered, schedule the job based relative to that. If we don't,
405
                         * just start from the activation time or realtime.
406
                         *
407
                         * Unless we have a real last-trigger time, we subtract the random_offset because
408
                         * any event that elapsed within the last random_offset has actually been delayed
409
                         * and thus hasn't truly elapsed yet. */
410

411
                        if (t->defer_reactivation &&
410✔
412
                            dual_timestamp_is_set(&trigger->inactive_enter_timestamp)) {
3✔
413
                                if (dual_timestamp_is_set(&t->last_trigger))
2✔
414
                                        b = MAX(trigger->inactive_enter_timestamp.realtime,
2✔
415
                                                t->last_trigger.realtime);
416
                                else
417
                                        b = trigger->inactive_enter_timestamp.realtime;
418
                        } else if (dual_timestamp_is_set(&t->last_trigger)) {
408✔
419
                                b = t->last_trigger.realtime;
24✔
420

421
                                /* Check if the last_trigger timestamp is older than the current machine
422
                                 * boot. If so, this means the timestamp came from a stamp file of a
423
                                 * persistent timer and we need to rebase it to make RandomizedDelaySec=
424
                                 * work (see below). */
425
                                if (t->last_trigger.monotonic < boot_monotonic)
24✔
426
                                        rebase_after_boot_time = true;
22✔
427
                        } else if (dual_timestamp_is_set(&UNIT(t)->inactive_exit_timestamp))
384✔
428
                                b = UNIT(t)->inactive_exit_timestamp.realtime - random_offset;
322✔
429
                        else {
430
                                b = ts.realtime - random_offset;
62✔
431
                                rebase_after_boot_time = true;
62✔
432
                        }
433

434
                        if (b > ts.realtime) {
410✔
435
                                /* The base we picked is in the future relative to the current realtime. This
436
                                 * happens when the wall clock is set backwards while the timer is already
437
                                 * waiting: the base was recorded from the old, later time. Feeding a future
438
                                 * base to calendar_spec_next_usec() would schedule the next elapse relative to
439
                                 * that stale time instead of now, so systemctl list-timers keeps showing the
440
                                 * pre-adjustment elapse and the timer never catches up (see #6036). Clamp to
441
                                 * now (minus the random offset, matching the "start from now" branch above) so
442
                                 * we recalculate from the current time. */
UNCOV
443
                                log_unit_debug(UNIT(t),
×
444
                                               "Calendar timer base time %s is in the future, recalculating from the current time.",
445
                                               FORMAT_TIMESTAMP(b));
UNCOV
446
                                b = ts.realtime - random_offset;
×
447
                        }
448

449
                        r = calendar_spec_next_usec(v->calendar_spec, b, &v->next_elapse);
410✔
450
                        if (r < 0)
410✔
UNCOV
451
                                continue;
×
452

453
                        v->next_elapse += random_offset;
410✔
454

455
                        if (rebase_after_boot_time) {
410✔
456
                                /* To make the delay due to RandomizedDelaySec= work even at boot, if the scheduled
457
                                 * time has already passed, set the time when systemd first started as the scheduled
458
                                 * time. Note that we base this on the monotonic timestamp of the boot, not the
459
                                 * realtime one, since the wallclock might have been off during boot. */
460
                                usec_t rebased = map_clock_usec(boot_monotonic, CLOCK_MONOTONIC, CLOCK_REALTIME);
84✔
461
                                if (v->next_elapse < rebased)
84✔
UNCOV
462
                                        v->next_elapse = rebased;
×
463
                        }
464

465
                        if (!found_realtime)
410✔
466
                                t->next_elapse_realtime = v->next_elapse;
410✔
467
                        else
UNCOV
468
                                t->next_elapse_realtime = MIN(t->next_elapse_realtime, v->next_elapse);
×
469

470
                        found_realtime = true;
471

472
                } else {
473
                        usec_t base;
1,003✔
474

475
                        switch (v->base) {
1,003✔
476

477
                        case TIMER_ACTIVE:
6✔
478
                                if (state_translation_table[t->state] == UNIT_ACTIVE)
6✔
479
                                        base = UNIT(t)->inactive_exit_timestamp.monotonic;
4✔
480
                                else
481
                                        base = ts.monotonic;
2✔
482
                                break;
483

484
                        case TIMER_BOOT:
194✔
485
                                if (detect_container() <= 0) {
194✔
486
                                        /* CLOCK_MONOTONIC equals the uptime on Linux */
487
                                        base = 0;
488
                                        break;
489
                                }
490
                                /* In a container we don't want to include the time the host
491
                                 * was already up when the container started, so count from
492
                                 * our own startup. */
493
                                _fallthrough_;
462✔
494
                        case TIMER_STARTUP:
495
                                base = UNIT(t)->manager->timestamps[MANAGER_TIMESTAMP_USERSPACE].monotonic;
462✔
496
                                break;
462✔
497

498
                        case TIMER_UNIT_ACTIVE:
500✔
499
                                leave_around = true;
500✔
500
                                base = MAX(trigger->inactive_exit_timestamp.monotonic, t->last_trigger.monotonic);
500✔
501
                                if (base <= 0)
500✔
502
                                        continue;
474✔
503
                                break;
504

505
                        case TIMER_UNIT_INACTIVE:
6✔
506
                                leave_around = true;
6✔
507
                                base = MAX(trigger->inactive_enter_timestamp.monotonic, t->last_trigger.monotonic);
6✔
508
                                if (base <= 0)
6✔
509
                                        continue;
4✔
510
                                break;
511

UNCOV
512
                        default:
×
UNCOV
513
                                assert_not_reached();
×
514
                        }
515

516
                        if (!time_change) {
525✔
517
                                bool is_oneshot = IN_SET(v->base, TIMER_ACTIVE, TIMER_BOOT, TIMER_STARTUP);
501✔
518

519
                                /* Skip recalculating the next elapse timestamp for one-shot timers for which
520
                                 * we've already calculated the value in this activation cycle. */
521
                                if (!(v->next_elapse > 0 &&
520✔
522
                                      t->last_trigger.monotonic > base &&
45✔
523
                                      is_oneshot))
524
                                        v->next_elapse = usec_add(usec_shift_clock(base, CLOCK_MONOTONIC, TIMER_MONOTONIC_CLOCK(t)), v->value);
1,446✔
525

526
                                if (dual_timestamp_is_set(&t->last_trigger) &&
548✔
527
                                    v->next_elapse < triple_timestamp_by_clock(&ts, TIMER_MONOTONIC_CLOCK(t)) &&
107✔
528
                                    is_oneshot) {
529
                                        /* This is a one time trigger, disable it now. */
530
                                        v->disabled = true;
13✔
531
                                        continue;
13✔
532
                                }
533
                        }
534

535
                        if (!found_monotonic)
512✔
536
                                t->next_elapse_monotonic_or_boottime = v->next_elapse;
501✔
537
                        else
538
                                t->next_elapse_monotonic_or_boottime = MIN(t->next_elapse_monotonic_or_boottime, v->next_elapse);
11✔
539

540
                        found_monotonic = true;
541
                }
542
        }
543

544
        if (!found_monotonic && !found_realtime && !t->on_timezone_change && !t->on_clock_change) {
910✔
545
                log_unit_debug(UNIT(t), "Timer is elapsed.");
2✔
546
                timer_enter_elapsed(t, leave_around);
2✔
547
                return;
912✔
548
        }
549

550
        if (found_monotonic) {
908✔
551
                usec_t left;
501✔
552

553
                add_random_delay(t, &t->next_elapse_monotonic_or_boottime);
501✔
554

555
                left = usec_sub_unsigned(t->next_elapse_monotonic_or_boottime, triple_timestamp_by_clock(&ts, TIMER_MONOTONIC_CLOCK(t)));
1,002✔
556
                log_unit_debug(UNIT(t), "Monotonic timer elapses in %s.", FORMAT_TIMESPAN(left, 0));
501✔
557

558
                if (t->monotonic_event_source) {
501✔
559
                        r = sd_event_source_set_time(t->monotonic_event_source, t->next_elapse_monotonic_or_boottime);
49✔
560
                        if (r < 0) {
49✔
UNCOV
561
                                log_unit_warning_errno(UNIT(t), r, "Failed to reschedule monotonic event source: %m");
×
UNCOV
562
                                goto fail;
×
563
                        }
564

565
                        r = sd_event_source_set_enabled(t->monotonic_event_source, SD_EVENT_ONESHOT);
49✔
566
                        if (r < 0) {
49✔
UNCOV
567
                                log_unit_warning_errno(UNIT(t), r, "Failed to enable monotonic event source: %m");
×
UNCOV
568
                                goto fail;
×
569
                        }
570
                } else {
571
                        r = sd_event_add_time(
1,808✔
572
                                        UNIT(t)->manager->event,
452✔
573
                                        &t->monotonic_event_source,
574
                                        t->wake_system ? CLOCK_BOOTTIME_ALARM : CLOCK_MONOTONIC,
452✔
575
                                        t->next_elapse_monotonic_or_boottime, t->accuracy_usec,
452✔
576
                                        timer_dispatch, t);
577
                        if (r < 0) {
452✔
UNCOV
578
                                log_unit_warning_errno(UNIT(t), r, "Failed to add monotonic event source: %m");
×
UNCOV
579
                                goto fail;
×
580
                        }
581

582
                        (void) sd_event_source_set_description(t->monotonic_event_source, "timer-monotonic");
452✔
583
                }
584

585
        } else {
586
                r = sd_event_source_set_enabled(t->monotonic_event_source, SD_EVENT_OFF);
407✔
587
                if (r < 0) {
407✔
UNCOV
588
                        log_unit_warning_errno(UNIT(t), r, "Failed to disable monotonic event source: %m");
×
UNCOV
589
                        goto fail;
×
590
                }
591
        }
592

593
        if (found_realtime) {
908✔
594
                add_random_delay(t, &t->next_elapse_realtime);
410✔
595

596
                log_unit_debug(UNIT(t), "Realtime timer elapses at %s.", FORMAT_TIMESTAMP(t->next_elapse_realtime));
410✔
597

598
                if (t->realtime_event_source) {
410✔
599
                        r = sd_event_source_set_time(t->realtime_event_source, t->next_elapse_realtime);
1✔
600
                        if (r < 0) {
1✔
UNCOV
601
                                log_unit_warning_errno(UNIT(t), r, "Failed to reschedule realtime event source: %m");
×
UNCOV
602
                                goto fail;
×
603
                        }
604

605
                        r = sd_event_source_set_enabled(t->realtime_event_source, SD_EVENT_ONESHOT);
1✔
606
                        if (r < 0) {
1✔
UNCOV
607
                                log_unit_warning_errno(UNIT(t), r, "Failed to enable realtime event source: %m");
×
UNCOV
608
                                goto fail;
×
609
                        }
610
                } else {
611
                        r = sd_event_add_time(
1,636✔
612
                                        UNIT(t)->manager->event,
409✔
613
                                        &t->realtime_event_source,
614
                                        t->wake_system ? CLOCK_REALTIME_ALARM : CLOCK_REALTIME,
409✔
615
                                        t->next_elapse_realtime, t->accuracy_usec,
409✔
616
                                        timer_dispatch, t);
617
                        if (r < 0) {
409✔
UNCOV
618
                                log_unit_warning_errno(UNIT(t), r, "Failed to add realtime event source: %m");
×
UNCOV
619
                                goto fail;
×
620
                        }
621

622
                        (void) sd_event_source_set_description(t->realtime_event_source, "timer-realtime");
409✔
623
                }
624

625
        } else if (t->realtime_event_source) {
498✔
626

UNCOV
627
                r = sd_event_source_set_enabled(t->realtime_event_source, SD_EVENT_OFF);
×
UNCOV
628
                if (r < 0) {
×
UNCOV
629
                        log_unit_warning_errno(UNIT(t), r, "Failed to disable realtime event source: %m");
×
UNCOV
630
                        goto fail;
×
631
                }
632
        }
633

634
        timer_set_state(t, TIMER_WAITING);
908✔
635
        return;
636

UNCOV
637
fail:
×
UNCOV
638
        timer_enter_dead(t, TIMER_FAILURE_RESOURCES);
×
639
}
640

641
static void timer_enter_running(Timer *t) {
17✔
642
        _cleanup_(activation_details_unrefp) ActivationDetails *details = NULL;
17✔
643
        _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
17✔
644
        Unit *trigger;
17✔
645
        Job *job;
17✔
646
        int r;
17✔
647

648
        assert(t);
17✔
649

650
        /* Don't start job if we are supposed to go down */
651
        if (unit_stop_pending(UNIT(t)))
17✔
652
                return;
653

654
        trigger = UNIT_TRIGGER(UNIT(t));
17✔
655
        if (!trigger) {
17✔
UNCOV
656
                log_unit_error(UNIT(t), "Unit to trigger vanished.");
×
UNCOV
657
                goto fail;
×
658
        }
659

660
        details = activation_details_new(UNIT(t));
17✔
661
        if (!details) {
17✔
UNCOV
662
                log_oom();
×
663
                goto fail;
×
664
        }
665

666
        r = manager_add_job(UNIT(t)->manager, JOB_START, trigger, JOB_REPLACE, &error, &job);
17✔
667
        if (r < 0) {
17✔
668
                log_unit_warning(UNIT(t), "Failed to queue unit startup job: %s", bus_error_message(&error, r));
×
669
                goto fail;
×
670
        }
671

672
        dual_timestamp_now(&t->last_trigger);
17✔
673
        ACTIVATION_DETAILS_TIMER(details)->last_trigger = t->last_trigger;
17✔
674

675
        job_set_activation_details(job, details);
17✔
676

677
        if (t->stamp_path)
17✔
UNCOV
678
                touch_file(t->stamp_path, true, t->last_trigger.realtime, UID_INVALID, GID_INVALID, MODE_INVALID);
×
679

680
        timer_set_state(t, TIMER_RUNNING);
17✔
681
        return;
682

UNCOV
683
fail:
×
UNCOV
684
        timer_enter_dead(t, TIMER_FAILURE_RESOURCES);
×
685
}
686

687
static int timer_start(Unit *u) {
331✔
688
        Timer *t = ASSERT_PTR(TIMER(u));
331✔
689
        int r;
331✔
690

691
        assert(IN_SET(t->state, TIMER_DEAD, TIMER_FAILED));
331✔
692

693
        r = unit_acquire_invocation_id(u);
331✔
694
        if (r < 0)
331✔
695
                return r;
696

697
        /* Reenable all timers that depend on unit activation time */
698
        LIST_FOREACH(value, v, t->values)
912✔
699
                if (v->base == TIMER_ACTIVE)
581✔
700
                        v->disabled = false;
2✔
701

702
        if (t->stamp_path) {
331✔
703
                struct stat st;
84✔
704

705
                if (stat(t->stamp_path, &st) >= 0) {
84✔
706
                        usec_t ft;
18✔
707

708
                        /* Load the file timestamp, but only if it is actually in the past. If it is in the future,
709
                         * something is wrong with the system clock. */
710

711
                        ft = timespec_load(&st.st_mtim);
18✔
712
                        if (ft < now(CLOCK_REALTIME))
18✔
713
                                t->last_trigger.realtime = ft;
18✔
714
                        else
UNCOV
715
                                log_unit_warning(u, "Not using persistent file timestamp %s as it is in the future.",
×
716
                                                 FORMAT_TIMESTAMP(ft));
717

718
                } else if (errno == ENOENT)
66✔
719
                        /* The timer has never run before, make sure a stamp file exists. */
720
                        (void) touch_file(t->stamp_path, true, USEC_INFINITY, UID_INVALID, GID_INVALID, MODE_INVALID);
66✔
721
        }
722

723
        t->result = TIMER_SUCCESS;
331✔
724
        timer_enter_waiting(t, false);
331✔
725
        return 1;
331✔
726
}
727

728
static int timer_stop(Unit *u) {
292✔
729
        Timer *t = ASSERT_PTR(TIMER(u));
292✔
730

731
        assert(IN_SET(t->state, TIMER_WAITING, TIMER_RUNNING, TIMER_ELAPSED));
292✔
732

733
        timer_enter_dead(t, TIMER_SUCCESS);
292✔
734
        return 1;
292✔
735
}
736

737
static int timer_serialize(Unit *u, FILE *f, FDSet *fds) {
599✔
738
        Timer *t = ASSERT_PTR(TIMER(u));
599✔
739

740
        assert(f);
599✔
741
        assert(fds);
599✔
742

743
        (void) serialize_item(f, "state", timer_state_to_string(t->state));
599✔
744
        (void) serialize_item(f, "result", timer_result_to_string(t->result));
599✔
745

746
        if (dual_timestamp_is_set(&t->last_trigger))
599✔
747
                (void) serialize_usec(f, "last-trigger-realtime", t->last_trigger.realtime);
8✔
748

749
        if (t->last_trigger.monotonic > 0)
599✔
750
                (void) serialize_usec(f, "last-trigger-monotonic", t->last_trigger.monotonic);
2✔
751

752
        return 0;
599✔
753
}
754

755
static int timer_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
1,076✔
756
        Timer *t = ASSERT_PTR(TIMER(u));
1,076✔
757

758
        assert(key);
1,076✔
759
        assert(value);
1,076✔
760
        assert(fds);
1,076✔
761

762
        if (streq(key, "state")) {
1,076✔
763
                TimerState state;
534✔
764

765
                state = timer_state_from_string(value);
534✔
766
                if (state < 0)
534✔
UNCOV
767
                        log_unit_debug(u, "Failed to parse state value: %s", value);
×
768
                else
769
                        t->deserialized_state = state;
534✔
770

771
        } else if (streq(key, "result")) {
542✔
772
                TimerResult f;
534✔
773

774
                f = timer_result_from_string(value);
534✔
775
                if (f < 0)
534✔
UNCOV
776
                        log_unit_debug(u, "Failed to parse result value: %s", value);
×
777
                else if (f != TIMER_SUCCESS)
534✔
UNCOV
778
                        t->result = f;
×
779

780
        } else if (streq(key, "last-trigger-realtime"))
8✔
781
                (void) deserialize_usec(value, &t->last_trigger.realtime);
6✔
782
        else if (streq(key, "last-trigger-monotonic"))
2✔
783
                (void) deserialize_usec(value, &t->last_trigger.monotonic);
2✔
784
        else
UNCOV
785
                log_unit_debug(u, "Unknown serialization key: %s", key);
×
786

787
        return 0;
1,076✔
788
}
789

790
static UnitActiveState timer_active_state(Unit *u) {
22,069✔
791
        Timer *t = ASSERT_PTR(TIMER(u));
22,069✔
792

793
        return state_translation_table[t->state];
22,069✔
794
}
795

796
static const char *timer_sub_state_to_string(Unit *u) {
575✔
797
        Timer *t = ASSERT_PTR(TIMER(u));
575✔
798

799
        return timer_state_to_string(t->state);
575✔
800
}
801

802
static int timer_dispatch(sd_event_source *s, uint64_t usec, void *userdata) {
17✔
803
        Timer *t = ASSERT_PTR(TIMER(userdata));
17✔
804

805
        if (t->state != TIMER_WAITING)
17✔
806
                return 0;
807

808
        log_unit_debug(UNIT(t), "Timer elapsed.");
17✔
809
        timer_enter_running(t);
17✔
810
        return 0;
17✔
811
}
812

813
static void timer_trigger_notify(Unit *u, Unit *other) {
52✔
814
        Timer *t = ASSERT_PTR(TIMER(u));
52✔
815

816
        assert(other);
52✔
817

818
        /* Filter out invocations with bogus state */
819
        assert(UNIT_IS_LOAD_COMPLETE(other->load_state));
52✔
820

821
        /* Reenable all timers that depend on unit state */
822
        LIST_FOREACH(value, v, t->values)
174✔
823
                if (IN_SET(v->base, TIMER_UNIT_ACTIVE, TIMER_UNIT_INACTIVE))
122✔
824
                        v->disabled = false;
50✔
825

826
        switch (t->state) {
52✔
827

828
        case TIMER_WAITING:
14✔
829
        case TIMER_ELAPSED:
830

831
                /* Recalculate sleep time */
832
                timer_enter_waiting(t, false);
14✔
833
                break;
14✔
834

835
        case TIMER_RUNNING:
38✔
836

837
                if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other))) {
38✔
838
                        log_unit_debug(UNIT(t), "Got notified about unit deactivation.");
15✔
839
                        timer_enter_waiting(t, false);
15✔
840
                }
841
                break;
842

843
        case TIMER_DEAD:
844
        case TIMER_FAILED:
845
                break;
846

UNCOV
847
        default:
×
UNCOV
848
                assert_not_reached();
×
849
        }
850
}
52✔
851

852
static void timer_reset_failed(Unit *u) {
12✔
853
        Timer *t = ASSERT_PTR(TIMER(u));
12✔
854

855
        if (t->state == TIMER_FAILED)
12✔
UNCOV
856
                timer_set_state(t, TIMER_DEAD);
×
857

858
        t->result = TIMER_SUCCESS;
12✔
859
}
12✔
860

861
static void timer_time_change(Unit *u) {
24✔
862
        Timer *t = ASSERT_PTR(TIMER(u));
24✔
863
        usec_t ts;
24✔
864

865
        if (t->state != TIMER_WAITING)
24✔
866
                return;
867

868
        /* If we appear to have triggered in the future, the system clock must
869
         * have been set backwards.  So let's rewind our own clock and allow
870
         * the future triggers to happen again :).  Exactly the same as when
871
         * you start a timer unit with Persistent=yes. */
872
        ts = now(CLOCK_REALTIME);
24✔
873
        if (t->last_trigger.realtime > ts)
24✔
UNCOV
874
                t->last_trigger.realtime = ts;
×
875

876
        if (t->on_clock_change) {
24✔
877
                log_unit_debug(u, "Time change, triggering activation.");
×
878
                timer_enter_running(t);
×
879
        } else {
880
                log_unit_debug(u, "Time change, recalculating next elapse.");
24✔
881
                timer_enter_waiting(t, true);
24✔
882
        }
883
}
884

885
static void timer_timezone_change(Unit *u) {
79✔
886
        Timer *t = ASSERT_PTR(TIMER(u));
79✔
887

888
        if (t->state != TIMER_WAITING)
79✔
889
                return;
890

891
        if (t->on_timezone_change) {
12✔
UNCOV
892
                log_unit_debug(u, "Timezone change, triggering activation.");
×
UNCOV
893
                timer_enter_running(t);
×
894
        } else {
895
                log_unit_debug(u, "Timezone change, recalculating next elapse.");
12✔
896
                timer_enter_waiting(t, false);
12✔
897
        }
898
}
899

UNCOV
900
static int timer_clean(Unit *u, ExecCleanMask mask) {
×
901
        Timer *t = ASSERT_PTR(TIMER(u));
×
UNCOV
902
        int r;
×
903

904
        assert(mask != 0);
×
905

UNCOV
906
        if (t->state != TIMER_DEAD)
×
907
                return -EBUSY;
908

UNCOV
909
        if (mask != EXEC_CLEAN_STATE)
×
910
                return -EUNATCH;
911

UNCOV
912
        r = timer_setup_persistent(t);
×
UNCOV
913
        if (r < 0)
×
914
                return r;
915

UNCOV
916
        if (!t->stamp_path)
×
917
                return -EUNATCH;
918

UNCOV
919
        if (unlink(t->stamp_path) && errno != ENOENT)
×
UNCOV
920
                return log_unit_error_errno(u, errno, "Failed to clean stamp file of timer: %m");
×
921

922
        return 0;
923
}
924

925
static int timer_can_clean(Unit *u, ExecCleanMask *ret) {
38✔
926
        Timer *t = ASSERT_PTR(TIMER(u));
38✔
927

928
        assert(ret);
38✔
929

930
        *ret = t->persistent ? EXEC_CLEAN_STATE : 0;
38✔
931
        return 0;
38✔
932
}
933

934
static int timer_test_startable(Unit *u) {
331✔
935
        Timer *t = ASSERT_PTR(TIMER(u));
331✔
936
        int r;
331✔
937

938
        r = unit_test_trigger_loaded(u);
331✔
939
        if (r < 0)
331✔
940
                return r;
941

942
        r = unit_test_start_limit(u);
331✔
943
        if (r < 0) {
331✔
UNCOV
944
                timer_enter_dead(t, TIMER_FAILURE_START_LIMIT_HIT);
×
UNCOV
945
                return r;
×
946
        }
947

948
        return true;
949
}
950

951
static void activation_details_timer_serialize(const ActivationDetails *details, FILE *f) {
2✔
952
        const ActivationDetailsTimer *t = ASSERT_PTR(ACTIVATION_DETAILS_TIMER(details));
2✔
953

954
        assert(f);
2✔
955
        assert(t);
2✔
956

957
        (void) serialize_dual_timestamp(f, "activation-details-timer-last-trigger", &t->last_trigger);
2✔
958
}
2✔
959

960
static int activation_details_timer_deserialize(const char *key, const char *value, ActivationDetails **details) {
2✔
961
        int r;
2✔
962

963
        assert(key);
2✔
964
        assert(value);
2✔
965
        POINTER_MAY_BE_NULL(details);
2✔
966

967
        if (!details || !*details)
2✔
968
                return -EINVAL;
969

970
        ActivationDetailsTimer *t = ACTIVATION_DETAILS_TIMER(*details);
2✔
971
        if (!t)
2✔
972
                return -EINVAL;
973

974
        if (!streq(key, "activation-details-timer-last-trigger"))
2✔
975
                return -EINVAL;
976

977
        r = deserialize_dual_timestamp(value, &t->last_trigger);
2✔
978
        if (r < 0)
2✔
UNCOV
979
                return r;
×
980

981
        return 0;
982
}
983

984
static int activation_details_timer_append_env(const ActivationDetails *details, char ***strv) {
18✔
985
        const ActivationDetailsTimer *t = ASSERT_PTR(ACTIVATION_DETAILS_TIMER(details));
18✔
986
        int r;
18✔
987

988
        assert(strv);
18✔
989
        assert(t);
18✔
990

991
        if (!dual_timestamp_is_set(&t->last_trigger))
18✔
992
                return 0;
993

994
        r = strv_extendf(strv, "TRIGGER_TIMER_REALTIME_USEC=" USEC_FMT, t->last_trigger.realtime);
18✔
995
        if (r < 0)
18✔
996
                return r;
997

998
        r = strv_extendf(strv, "TRIGGER_TIMER_MONOTONIC_USEC=" USEC_FMT, t->last_trigger.monotonic);
18✔
999
        if (r < 0)
18✔
UNCOV
1000
                return r;
×
1001

1002
        return 2; /* Return the number of variables added to the env block */
1003
}
1004

1005
static int activation_details_timer_append_pair(const ActivationDetails *details, char ***strv) {
41✔
1006
        const ActivationDetailsTimer *t = ASSERT_PTR(ACTIVATION_DETAILS_TIMER(details));
41✔
1007
        int r;
41✔
1008

1009
        assert(strv);
41✔
1010
        assert(t);
41✔
1011

1012
        if (!dual_timestamp_is_set(&t->last_trigger))
41✔
1013
                return 0;
1014

1015
        r = strv_extend(strv, "trigger_timer_realtime_usec");
41✔
1016
        if (r < 0)
41✔
1017
                return r;
1018

1019
        r = strv_extendf(strv, USEC_FMT, t->last_trigger.realtime);
41✔
1020
        if (r < 0)
41✔
1021
                return r;
1022

1023
        r = strv_extend(strv, "trigger_timer_monotonic_usec");
41✔
1024
        if (r < 0)
41✔
1025
                return r;
1026

1027
        r = strv_extendf(strv, USEC_FMT, t->last_trigger.monotonic);
41✔
1028
        if (r < 0)
41✔
UNCOV
1029
                return r;
×
1030

1031
        return 2; /* Return the number of pairs added to the env block */
1032
}
1033

1034
uint64_t timer_next_elapse_monotonic(const Timer *t) {
531✔
1035
        assert(t);
531✔
1036

1037
        return (uint64_t) usec_shift_clock(t->next_elapse_monotonic_or_boottime,
531✔
1038
                                           TIMER_MONOTONIC_CLOCK(t), CLOCK_MONOTONIC);
531✔
1039
}
1040

1041
static const char* const timer_base_table[_TIMER_BASE_MAX] = {
1042
        [TIMER_ACTIVE]        = "OnActiveSec",
1043
        [TIMER_BOOT]          = "OnBootSec",
1044
        [TIMER_STARTUP]       = "OnStartupSec",
1045
        [TIMER_UNIT_ACTIVE]   = "OnUnitActiveSec",
1046
        [TIMER_UNIT_INACTIVE] = "OnUnitInactiveSec",
1047
        [TIMER_CALENDAR]      = "OnCalendar",
1048
};
1049

1050
DEFINE_STRING_TABLE_LOOKUP(timer_base, TimerBase);
146✔
1051

1052
char* timer_base_to_usec_string(TimerBase i) {
56✔
1053
        _cleanup_free_ char *buf = NULL;
112✔
1054
        const char *s;
56✔
1055
        size_t l;
56✔
1056

1057
        s = timer_base_to_string(i);
56✔
1058

1059
        if (endswith(s, "Sec")) {
56✔
1060
                /* s/Sec/USec/ */
1061
                l = strlen(s);
35✔
1062
                buf = new(char, l+2);
35✔
1063
                if (!buf)
35✔
1064
                        return NULL;
1065

1066
                memcpy(buf, s, l-3);
35✔
1067
                memcpy(buf+l-3, "USec", 5);
35✔
1068
        } else {
1069
                buf = strdup(s);
21✔
1070
                if (!buf)
21✔
UNCOV
1071
                        return NULL;
×
1072
        }
1073

1074
        return TAKE_PTR(buf);
1075
}
1076

1077
static const char* const timer_result_table[_TIMER_RESULT_MAX] = {
1078
        [TIMER_SUCCESS]                 = "success",
1079
        [TIMER_FAILURE_RESOURCES]       = "resources",
1080
        [TIMER_FAILURE_START_LIMIT_HIT] = "start-limit-hit",
1081
};
1082

1083
DEFINE_STRING_TABLE_LOOKUP(timer_result, TimerResult);
2,018✔
1084

1085
const UnitVTable timer_vtable = {
1086
        .object_size = sizeof(Timer),
1087

1088
        .sections =
1089
                "Unit\0"
1090
                "Timer\0"
1091
                "Install\0",
1092
        .private_section = "Timer",
1093

1094
        .can_transient = true,
1095
        .can_fail = true,
1096
        .can_trigger = true,
1097

1098
        .init = timer_init,
1099
        .done = timer_done,
1100
        .load = timer_load,
1101

1102
        .coldplug = timer_coldplug,
1103

1104
        .dump = timer_dump,
1105

1106
        .start = timer_start,
1107
        .stop = timer_stop,
1108

1109
        .clean = timer_clean,
1110
        .can_clean = timer_can_clean,
1111

1112
        .serialize = timer_serialize,
1113
        .deserialize_item = timer_deserialize_item,
1114

1115
        .active_state = timer_active_state,
1116
        .sub_state_to_string = timer_sub_state_to_string,
1117

1118
        .trigger_notify = timer_trigger_notify,
1119

1120
        .reset_failed = timer_reset_failed,
1121
        .time_change = timer_time_change,
1122
        .timezone_change = timer_timezone_change,
1123

1124
        .bus_set_property = bus_timer_set_property,
1125

1126
        .test_startable = timer_test_startable,
1127
};
1128

1129
const ActivationDetailsVTable activation_details_timer_vtable = {
1130
        .object_size = sizeof(ActivationDetailsTimer),
1131

1132
        .serialize = activation_details_timer_serialize,
1133
        .deserialize = activation_details_timer_deserialize,
1134
        .append_env = activation_details_timer_append_env,
1135
        .append_pair = activation_details_timer_append_pair,
1136
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc