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

systemd / systemd / 15263807472

26 May 2025 08:53PM UTC coverage: 72.046% (-0.002%) from 72.048%
15263807472

push

github

yuwata
src/core/manager.c: log preset activity on first boot

This gives us a little more information about what units were enabled
or disabled on that first boot and will be useful for OS developers
tracking down the source of unit state.

An example with this enabled looks like:

```
NET: Registered PF_VSOCK protocol family
systemd[1]: Applying preset policy.
systemd[1]: Unit /etc/systemd/system/dnsmasq.service is masked, ignoring.
systemd[1]: Unit /etc/systemd/system/systemd-repart.service is masked, ignoring.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket'.
systemd[1]: Removed '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir.mount' → '/etc/systemd/system/var-mnt-workdir.mount'.
systemd[1]: Created symlink '/etc/systemd/system/multi-user.target.wants/var-mnt-workdir\x2dtmp.mount' → '/etc/systemd/system/var-mnt-workdir\x2dtmp.mount'.
systemd[1]: Created symlink '/etc/systemd/system/afterburn-sshkeys.target.requires/afterburn-sshkeys@core.service' → '/usr/lib/systemd/system/afterburn-sshkeys@.service'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-varlink.socket' → '/usr/lib/systemd/system/systemd-resolved-varlink.socket'.
systemd[1]: Created symlink '/etc/systemd/system/sockets.target.wants/systemd-resolved-monitor.socket' → '/usr/lib/systemd/system/systemd-resolved-monitor.socket'.
systemd[1]: Populated /etc with preset unit settings.
```

Considering it only happens on first boot and not on every boot I think
the extra information is worth the extra verbosity in the logs just for
that boot.

5 of 6 new or added lines in 1 file covered. (83.33%)

5463 existing lines in 165 files now uncovered.

299151 of 415222 relevant lines covered (72.05%)

702386.45 hits per line

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

96.23
/src/basic/ordered-set.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2

3
#include <stdio.h>
4
#include <stdlib.h>
5
#include <string.h>
6

7
#include "fileio.h"
8
#include "ordered-set.h"
9
#include "strv.h"
10

11
int ordered_set_ensure_allocated(OrderedSet **s, const struct hash_ops *ops) {
110,141✔
12
        if (*s)
110,141✔
13
                return 0;
14

15
        *s = ordered_set_new(ops);
37,254✔
16
        if (!*s)
37,254✔
UNCOV
17
                return -ENOMEM;
×
18

19
        return 0;
20
}
21

22
int ordered_set_ensure_put(OrderedSet **s, const struct hash_ops *ops, void *p) {
90,611✔
23
        int r;
90,611✔
24

25
        r = ordered_set_ensure_allocated(s, ops);
90,611✔
26
        if (r < 0)
90,611✔
27
                return r;
28

29
        return ordered_set_put(*s, p);
90,611✔
30
}
31

32
int ordered_set_consume(OrderedSet *s, void *p) {
3,157✔
33
        int r;
3,157✔
34

35
        r = ordered_set_put(s, p);
3,157✔
36
        if (r <= 0)
3,157✔
37
                free(p);
10✔
38

39
        return r;
3,157✔
40
}
41

42
int ordered_set_put_strdup(OrderedSet **s, const char *p) {
1,181✔
43
        char *c;
1,181✔
44
        int r;
1,181✔
45

46
        assert(s);
1,181✔
47
        assert(p);
1,181✔
48

49
        r = ordered_set_ensure_allocated(s, &string_hash_ops_free);
1,181✔
50
        if (r < 0)
1,181✔
51
                return r;
52

53
        if (ordered_set_contains(*s, p))
1,181✔
54
                return 0;
55

56
        c = strdup(p);
1,150✔
57
        if (!c)
1,150✔
58
                return -ENOMEM;
59

60
        return ordered_set_consume(*s, c);
1,150✔
61
}
62

63
int ordered_set_put_strdupv(OrderedSet **s, char **l) {
11,896✔
64
        int n = 0, r;
11,896✔
65

66
        STRV_FOREACH(i, l) {
11,974✔
67
                r = ordered_set_put_strdup(s, *i);
78✔
68
                if (r < 0)
78✔
69
                        return r;
70

71
                n += r;
78✔
72
        }
73

74
        return n;
75
}
76

77
int ordered_set_put_string_set(OrderedSet **s, OrderedSet *l) {
23,751✔
78
        int n = 0, r;
23,751✔
79
        char *p;
23,751✔
80

81
        /* Like ordered_set_put_strv, but for an OrderedSet of strings */
82

83
        ORDERED_SET_FOREACH(p, l) {
23,923✔
84
                r = ordered_set_put_strdup(s, p);
172✔
85
                if (r < 0)
172✔
UNCOV
86
                        return r;
×
87

88
                n += r;
172✔
89
        }
90

91
        return n;
23,751✔
92
}
93

94
void ordered_set_print(FILE *f, const char *field, OrderedSet *s) {
44,824✔
95
        bool space = false;
44,824✔
96
        char *p;
44,824✔
97

98
        assert(f);
44,824✔
99
        assert(field);
44,824✔
100

101
        if (ordered_set_isempty(s))
44,824✔
102
                return;
44,136✔
103

104
        fputs(field, f);
688✔
105

106
        ORDERED_SET_FOREACH(p, s)
1,826✔
107
                fputs_with_separator(f, p, NULL, &space);
1,138✔
108

109
        fputc('\n', f);
688✔
110
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc