···
1
-
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
2
-
index 7164b1e..29401eb 100644
3
-
--- a/man/systemd.special.xml
4
-
+++ b/man/systemd.special.xml
7
-
installation. This is best
9
-
- <varname>WantedBy=multi-uer.target</varname>
10
-
+ <varname>WantedBy=multi-user.target</varname>
12
-
<literal>[Install]</literal>
14
-
diff --git a/rules/80-net-name-slot.rules b/rules/80-net-name-slot.rules
15
-
index 15b5bc4..c5f1b38 100644
16
-
--- a/rules/80-net-name-slot.rules
17
-
+++ b/rules/80-net-name-slot.rules
19
-
# do not edit this file, it will be overwritten on update
21
-
-ACTION=="remove", GOTO="net_name_slot_end"
22
-
+ACTION!="add", GOTO="net_name_slot_end"
23
-
SUBSYSTEM!="net", GOTO="net_name_slot_end"
24
-
NAME!="", GOTO="net_name_slot_end"
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
27
-
index d17bdd9..040b10e 100644
2
+
index db72373..2fc12ca 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -14,10 +14,6 @@ KERNEL=="vport*", TAG+="systemd"
31
-
SUBSYSTEM=="block", KERNEL!="ram*|loop*", TAG+="systemd"
32
-
SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
6
+
SUBSYSTEM=="block", KERNEL!="ram*", TAG+="systemd"
7
+
SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
-# Ignore encrypted devices with no identified superblock on it, since
-# we are probably still calling mke2fs or mkswap on it.
36
-
-SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
11
+
-SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
# Ignore raid devices that are not yet assembled and started
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
41
-
diff --git a/src/core/cgroup-semantics.c b/src/core/cgroup-semantics.c
42
-
index 82b02bb..7df9d01 100644
43
-
--- a/src/core/cgroup-semantics.c
44
-
+++ b/src/core/cgroup-semantics.c
45
-
@@ -255,7 +255,7 @@ static int map_blkio(const CGroupSemantics *s, const char *value, char **ret) {
48
-
static const CGroupSemantics semantics[] = {
49
-
- { "cpu", "cpu.shares", "CPUShare", false, parse_cpu_shares, NULL, NULL },
50
-
+ { "cpu", "cpu.shares", "CPUShares", false, parse_cpu_shares, NULL, NULL },
51
-
{ "memory", "memory.soft_limit_in_bytes", "MemorySoftLimit", false, parse_memory_limit, NULL, NULL },
52
-
{ "memory", "memory.limit_in_bytes", "MemoryLimit", false, parse_memory_limit, NULL, NULL },
53
-
{ "devices", "devices.allow", "DeviceAllow", true, parse_device, map_device, NULL },
54
-
diff --git a/src/core/dbus-execute.h b/src/core/dbus-execute.h
55
-
index 91d70e5..698102f 100644
56
-
--- a/src/core/dbus-execute.h
57
-
+++ b/src/core/dbus-execute.h
59
-
" <property name=\"CPUSchedulingPolicy\" type=\"i\" access=\"read\"/>\n" \
60
-
" <property name=\"CPUSchedulingPriority\" type=\"i\" access=\"read\"/>\n" \
61
-
" <property name=\"CPUAffinity\" type=\"ay\" access=\"read\"/>\n" \
62
-
- " <property name=\"TimerSlackNS\" type=\"t\" access=\"read\"/>\n" \
63
-
+ " <property name=\"TimerSlackNSec\" type=\"t\" access=\"read\"/>\n" \
64
-
" <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\"read\"/>\n" \
65
-
" <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>\n" \
66
-
" <property name=\"StandardInput\" type=\"s\" access=\"read\"/>\n" \
67
-
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
68
-
index 56b02a1..2b6d799 100644
69
-
--- a/src/core/dbus-manager.c
70
-
+++ b/src/core/dbus-manager.c
71
-
@@ -1550,7 +1550,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
72
-
_cleanup_strv_free_ char **l = NULL;
75
-
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
76
-
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
78
-
r = bus_parse_strv(message, &l);
80
-
@@ -1577,7 +1577,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
81
-
_cleanup_strv_free_ char **l = NULL;
84
-
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
85
-
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
87
-
r = bus_parse_strv(message, &l);
89
-
@@ -1605,7 +1605,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
91
-
DBusMessageIter iter;
93
-
- SELINUX_ACCESS_CHECK(connection, message, "reboot");
94
-
+ SELINUX_ACCESS_CHECK(connection, message, "reload");
96
-
if (!dbus_message_iter_init(message, &iter))
98
-
diff --git a/src/core/dbus-swap.c b/src/core/dbus-swap.c
99
-
index 2e99fba..e72749a 100644
100
-
--- a/src/core/dbus-swap.c
101
-
+++ b/src/core/dbus-swap.c
102
-
@@ -93,6 +93,7 @@ static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_swap_append_swap_result, swap_result,
103
-
static const BusProperty bus_swap_properties[] = {
104
-
{ "What", bus_property_append_string, "s", offsetof(Swap, what), true },
105
-
{ "Priority", bus_swap_append_priority, "i", 0 },
106
-
+ { "TimeoutUSec",bus_property_append_usec, "t", offsetof(Swap, timeout_usec)},
107
-
BUS_EXEC_COMMAND_PROPERTY("ExecActivate", offsetof(Swap, exec_command[SWAP_EXEC_ACTIVATE]), false),
108
-
BUS_EXEC_COMMAND_PROPERTY("ExecDeactivate", offsetof(Swap, exec_command[SWAP_EXEC_DEACTIVATE]), false),
109
-
{ "ControlPID", bus_property_append_pid, "u", offsetof(Swap, control_pid) },
diff --git a/src/core/main.c b/src/core/main.c
111
-
index 7fc06be..101ce79 100644
17
+
index 41605ee..8517369 100644
114
-
@@ -1590,14 +1590,14 @@ int main(int argc, char *argv[]) {
115
-
log_error("Failed to adjust timer slack: %m");
117
-
if (arg_capability_bounding_set_drop) {
118
-
- r = capability_bounding_set_drop(arg_capability_bounding_set_drop, true);
119
-
+ r = capability_bounding_set_drop_usermode(arg_capability_bounding_set_drop);
121
-
- log_error("Failed to drop capability bounding set: %s", strerror(-r));
122
-
+ log_error("Failed to drop capability bounding set of usermode helpers: %s", strerror(-r));
125
-
- r = capability_bounding_set_drop_usermode(arg_capability_bounding_set_drop);
126
-
+ r = capability_bounding_set_drop(arg_capability_bounding_set_drop, true);
128
-
- log_error("Failed to drop capability bounding set of usermode helpers: %s", strerror(-r));
129
-
+ log_error("Failed to drop capability bounding set: %s", strerror(-r));
133
-
@@ -1650,6 +1650,7 @@ int main(int argc, char *argv[]) {
134
-
/* This will close all file descriptors that were opened, but
135
-
* not claimed by any unit. */
139
-
if (serialization) {
140
-
fclose(serialization);
141
-
@@ -1857,7 +1858,7 @@ finish:
20
+
@@ -1883,7 +1883,7 @@ finish:
···
args[i++] = "--switched-root";
args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user";
150
-
diff --git a/src/core/manager.c b/src/core/manager.c
151
-
index c7f8f20..0508628 100644
152
-
--- a/src/core/manager.c
153
-
+++ b/src/core/manager.c
154
-
@@ -1372,7 +1372,7 @@ static int manager_process_signal_fd(Manager *m) {
157
-
if (m->running_as == SYSTEMD_SYSTEM) {
158
-
- manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE);
159
-
+ manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY);
163
-
diff --git a/src/core/service.c b/src/core/service.c
164
-
index 3617c24..4d0e2ad 100644
165
-
--- a/src/core/service.c
166
-
+++ b/src/core/service.c
167
-
@@ -2642,6 +2642,9 @@ static int service_serialize(Unit *u, FILE *f, FDSet *fds) {
168
-
if (s->exec_context.var_tmp_dir)
169
-
unit_serialize_item(u, f, "var-tmp-dir", s->exec_context.var_tmp_dir);
171
-
+ if (s->forbid_restart)
172
-
+ unit_serialize_item(u, f, "forbid-restart", yes_no(s->forbid_restart));
177
-
@@ -2776,6 +2779,14 @@ static int service_deserialize_item(Unit *u, const char *key, const char *value,
180
-
s->exec_context.var_tmp_dir = t;
181
-
+ } else if (streq(key, "forbid-restart")) {
184
-
+ b = parse_boolean(value);
186
-
+ log_debug_unit(u->id, "Failed to parse forbid-restart value %s", value);
188
-
+ s->forbid_restart = b;
190
-
log_debug_unit(u->id, "Unknown serialization key '%s'", key);
192
-
diff --git a/src/core/snapshot.c b/src/core/snapshot.c
193
-
index a63eccd..a6807eb 100644
194
-
--- a/src/core/snapshot.c
195
-
+++ b/src/core/snapshot.c
196
-
@@ -217,8 +217,10 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, DBusError *e, Sn
197
-
if (asprintf(&n, "snapshot-%u.snapshot", ++ m->n_snapshots) < 0)
200
-
- if (!manager_get_unit(m, n))
201
-
+ if (!manager_get_unit(m, n)) {
diff --git a/src/core/umount.c b/src/core/umount.c
209
-
index 1e95ad7..9f0e471 100644
30
+
index d1258f0..0311812 100644
212
-
@@ -435,6 +435,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
33
+
@@ -404,6 +404,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
* anyway, since we are running from it. They have
* already been remounted ro. */
if (path_equal(m->path, "/")
···
|| path_equal(m->path, "/usr")
221
-
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
222
-
index 81b7708..edd0b40 100644
223
-
--- a/src/cryptsetup/cryptsetup-generator.c
224
-
+++ b/src/cryptsetup/cryptsetup-generator.c
225
-
@@ -111,6 +111,7 @@ static int create_disk(
226
-
"Conflicts=umount.target\n"
227
-
"DefaultDependencies=no\n"
228
-
"BindsTo=dev-mapper-%i.device\n"
229
-
+ "IgnoreOnIsolate=true\n"
230
-
"After=systemd-readahead-collect.service systemd-readahead-replay.service\n",
233
-
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
234
-
index c17299f..6b3e67e 100644
235
-
--- a/src/fstab-generator/fstab-generator.c
236
-
+++ b/src/fstab-generator/fstab-generator.c
237
-
@@ -351,7 +351,7 @@ static int add_mount(
239
-
if (automount && !path_equal(where, "/")) {
240
-
automount_name = unit_name_from_path(where, ".automount");
242
-
+ if (!automount_name)
245
-
automount_unit = strjoin(arg_dest, "/", automount_name, NULL);
246
-
@@ -596,9 +596,9 @@ static int parse_proc_cmdline(void) {
247
-
} else if (startswith(word, "rd.fstab=")) {
250
-
- r = parse_boolean(word + 6);
251
-
+ r = parse_boolean(word + 9);
253
-
- log_warning("Failed to parse fstab switch %s. Ignoring.", word + 6);
254
-
+ log_warning("Failed to parse fstab switch %s. Ignoring.", word + 9);
258
-
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
259
-
index 38499a6..bb80905 100644
260
-
--- a/src/journal/journal-file.c
261
-
+++ b/src/journal/journal-file.c
262
-
@@ -907,6 +907,8 @@ static int journal_file_append_field(
264
-
osize = offsetof(Object, field.payload) + size;
265
-
r = journal_file_append_object(f, OBJECT_FIELD, osize, &o, &p);
269
-
o->field.hash = htole64(hash);
270
-
memcpy(o->field.payload, field, size);
271
-
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
272
-
index 88163c0..e09ba4c 100644
273
-
--- a/src/journal/journald-server.c
274
-
+++ b/src/journal/journald-server.c
275
-
@@ -333,8 +333,10 @@ void server_rotate(Server *s) {
278
-
log_error("Failed to rotate %s: %s", f->path, strerror(-r));
281
-
log_error("Failed to create user journal: %s", strerror(-r));
282
-
+ hashmap_remove(s->user_journals, k);
285
-
hashmap_replace(s->user_journals, k, f);
286
-
server_fix_perms(s, f, PTR_TO_UINT32(k));
287
-
@@ -975,7 +977,8 @@ int process_event(Server *s, struct epoll_event *ev) {
290
-
if (ev->events != EPOLLIN) {
291
-
- log_error("Got invalid event from epoll.");
292
-
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
293
-
+ "signal fd", ev->events);
297
-
@@ -1024,8 +1027,12 @@ int process_event(Server *s, struct epoll_event *ev) {
298
-
} else if (ev->data.fd == s->dev_kmsg_fd) {
301
-
- if (ev->events != EPOLLIN) {
302
-
- log_error("Got invalid event from epoll.");
303
-
+ if (ev->events & EPOLLERR)
304
-
+ log_warning("/dev/kmsg buffer overrun, some messages lost.");
306
-
+ if (!(ev->events & EPOLLIN)) {
307
-
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
308
-
+ "/dev/kmsg", ev->events);
312
-
@@ -1039,7 +1046,9 @@ int process_event(Server *s, struct epoll_event *ev) {
313
-
ev->data.fd == s->syslog_fd) {
315
-
if (ev->events != EPOLLIN) {
316
-
- log_error("Got invalid event from epoll.");
317
-
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
318
-
+ ev->data.fd == s->native_fd ? "native fd" : "syslog fd",
323
-
@@ -1140,12 +1149,7 @@ int process_event(Server *s, struct epoll_event *ev) {
326
-
if (n > 0 && n_fds == 0) {
327
-
- e = memchr(s->buffer, '\n', n);
331
-
- s->buffer[n] = 0;
333
-
+ s->buffer[n] = 0;
334
-
server_process_syslog_message(s, strstrip(s->buffer), ucred, tv, label, label_len);
335
-
} else if (n_fds > 0)
336
-
log_warning("Got file descriptors via syslog socket. Ignoring.");
337
-
@@ -1167,7 +1171,8 @@ int process_event(Server *s, struct epoll_event *ev) {
338
-
} else if (ev->data.fd == s->stdout_fd) {
340
-
if (ev->events != EPOLLIN) {
341
-
- log_error("Got invalid event from epoll.");
342
-
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
343
-
+ "stdout fd", ev->events);
347
-
@@ -1178,6 +1183,8 @@ int process_event(Server *s, struct epoll_event *ev) {
348
-
StdoutStream *stream;
350
-
if ((ev->events|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) {
351
-
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
352
-
+ "stdout stream", ev->events);
353
-
log_error("Got invalid event from epoll.");
356
-
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
357
-
index 54bf114..bd197d0 100644
358
-
--- a/src/journal/mmap-cache.c
359
-
+++ b/src/journal/mmap-cache.c
360
-
@@ -308,9 +308,13 @@ static void mmap_cache_free(MMapCache *m) {
361
-
while ((c = hashmap_first(m->contexts)))
364
-
+ hashmap_free(m->contexts);
366
-
while ((f = hashmap_first(m->fds)))
369
-
+ hashmap_free(m->fds);
372
-
window_free(m->unused);
374
-
diff --git a/src/libsystemd-bus/bus-internal.c b/src/libsystemd-bus/bus-internal.c
375
-
index 0e66f3d..cac948e 100644
376
-
--- a/src/libsystemd-bus/bus-internal.c
377
-
+++ b/src/libsystemd-bus/bus-internal.c
378
-
@@ -63,7 +63,7 @@ bool object_path_is_valid(const char *p) {
380
-
bool interface_name_is_valid(const char *p) {
382
-
- bool dot, found_dot;
383
-
+ bool dot, found_dot = false;
387
-
@@ -103,7 +103,7 @@ bool interface_name_is_valid(const char *p) {
389
-
bool service_name_is_valid(const char *p) {
391
-
- bool dot, found_dot, unique;
392
-
+ bool dot, found_dot = false, unique;
396
-
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
397
-
index 7d6d848..b0eb2f1 100644
398
-
--- a/src/libsystemd-bus/sd-bus.c
399
-
+++ b/src/libsystemd-bus/sd-bus.c
400
-
@@ -1088,11 +1088,11 @@ static int dispatch_rqueue(sd_bus *bus, sd_bus_message **m) {
413
-
int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *serial) {
414
-
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
415
-
index 5ccaabd..100c1fb 100644
416
-
--- a/src/libudev/libudev-enumerate.c
417
-
+++ b/src/libudev/libudev-enumerate.c
418
-
@@ -299,7 +299,7 @@ _public_ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enume
419
-
/* skip to be delayed devices, and move the to
420
-
* the point where the prefix changes. We can
421
-
* only move one item at a time. */
422
-
- if (!move_later) {
423
-
+ if (move_later == -1) {
424
-
move_later_prefix = devices_delay_later(udev_enumerate->udev, entry->syspath);
426
-
if (move_later_prefix > 0) {
427
-
@@ -718,6 +718,8 @@ static bool match_subsystem(struct udev_enumerate *udev_enumerate, const char *s
429
-
struct udev_list_entry *list_entry;
431
-
+ subsystem = subsystem ? : "";
433
-
udev_list_entry_foreach(list_entry, udev_list_get_entry(&udev_enumerate->subsystem_nomatch_list)) {
434
-
if (fnmatch(udev_list_entry_get_name(list_entry), subsystem, 0) == 0)
436
-
@@ -826,23 +828,27 @@ nomatch:
437
-
static int parent_add_child(struct udev_enumerate *enumerate, const char *path)
439
-
struct udev_device *dev;
442
-
dev = udev_device_new_from_syspath(enumerate->udev, path);
446
-
if (!match_subsystem(enumerate, udev_device_get_subsystem(dev)))
449
-
if (!match_sysname(enumerate, udev_device_get_sysname(dev)))
452
-
if (!match_property(enumerate, dev))
455
-
if (!match_sysattr(enumerate, dev))
459
-
syspath_add(enumerate, udev_device_get_syspath(dev));
463
-
udev_device_unref(dev);
468
-
static int parent_crawl_children(struct udev_enumerate *enumerate, const char *path, int maxdepth)
469
-
diff --git a/src/libudev/libudev.sym b/src/libudev/libudev.sym
470
-
index 8e09430..1e6f885 100644
471
-
--- a/src/libudev/libudev.sym
472
-
+++ b/src/libudev/libudev.sym
473
-
@@ -109,5 +109,6 @@ global:
478
-
udev_device_set_sysattr_value;
480
-
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
481
-
index 7b19ee0..49ee420 100644
482
-
--- a/src/modules-load/modules-load.c
483
-
+++ b/src/modules-load/modules-load.c
484
-
@@ -302,8 +302,8 @@ int main(int argc, char *argv[]) {
486
-
STRV_FOREACH(i, arg_proc_cmdline_modules) {
487
-
k = load_module(ctx, *i);
489
-
- r = EXIT_FAILURE;
490
-
+ if (k < 0 && r == 0)
494
-
r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs);
diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c
496
-
index b1ef912..4f2ab5c 100644
43
+
index d61ecdf..228a3a4 100644
--- a/src/nss-myhostname/netlink.c
+++ b/src/nss-myhostname/netlink.c
499
-
@@ -113,6 +113,10 @@ static int read_reply(int fd, struct address **list, unsigned *n_list) {
46
+
@@ -112,6 +112,10 @@ static int read_reply(int fd, struct address **list, unsigned *n_list) {
ifaddrmsg->ifa_scope == RT_SCOPE_NOWHERE)
···
if (ifaddrmsg->ifa_flags & IFA_F_DEPRECATED)
510
-
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
511
-
index 8d004ba..99340c9 100644
512
-
--- a/src/shared/efivars.c
513
-
+++ b/src/shared/efivars.c
514
-
@@ -383,7 +383,8 @@ int efi_get_boot_options(uint16_t **options) {
515
-
list[count ++] = id;
518
-
- qsort(list, count, sizeof(uint16_t), cmp_uint16);
520
-
+ qsort(list, count, sizeof(uint16_t), cmp_uint16);
524
-
diff --git a/src/shared/env-util.c b/src/shared/env-util.c
525
-
index 6a52fb9..598222c 100644
526
-
--- a/src/shared/env-util.c
527
-
+++ b/src/shared/env-util.c
528
-
@@ -406,7 +406,9 @@ char **strv_env_clean_log(char **e, const char *message) {
539
-
diff --git a/src/shared/log.c b/src/shared/log.c
540
-
index 27317f7..8f4995a 100644
541
-
--- a/src/shared/log.c
542
-
+++ b/src/shared/log.c
543
-
@@ -115,16 +115,20 @@ void log_close_syslog(void) {
545
-
static int create_log_socket(int type) {
547
-
+ struct timeval tv;
549
-
- /* All output to the syslog/journal fds we do asynchronously,
550
-
- * and if the buffers are full we just drop the messages */
552
-
- fd = socket(AF_UNIX, type|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
553
-
+ fd = socket(AF_UNIX, type|SOCK_CLOEXEC, 0);
557
-
fd_inc_sndbuf(fd, SNDBUF_SIZE);
559
-
+ /* We need a blocking fd here since we'd otherwise lose
560
-
+ messages way too early. However, let's not hang forever in the
561
-
+ unlikely case of a deadlock. */
562
-
+ timeval_store(&tv, 1*USEC_PER_MINUTE);
563
-
+ setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
568
-
diff --git a/src/shared/polkit.c b/src/shared/polkit.c
569
-
index cea7074..1c5e9e3 100644
570
-
--- a/src/shared/polkit.c
571
-
+++ b/src/shared/polkit.c
572
-
@@ -38,12 +38,8 @@ int verify_polkit(
574
-
#ifdef ENABLE_POLKIT
575
-
DBusMessage *m = NULL, *reply = NULL;
576
-
- const char *unix_process = "unix-process", *pid = "pid", *starttime = "start-time", *cancel_id = "";
577
-
+ const char *system_bus_name = "system-bus-name", *name = "name", *cancel_id = "";
578
-
uint32_t flags = interactive ? 1 : 0;
580
-
- uint32_t pid_u32;
581
-
- unsigned long long starttime_raw;
582
-
- uint64_t starttime_u64;
583
-
DBusMessageIter iter_msg, iter_struct, iter_array, iter_dict, iter_variant;
585
-
dbus_bool_t authorized = FALSE, challenge = FALSE;
586
-
@@ -68,14 +64,6 @@ int verify_polkit(
588
-
#ifdef ENABLE_POLKIT
590
-
- pid_raw = bus_get_unix_process_id(c, sender, error);
591
-
- if (pid_raw == 0)
594
-
- r = get_starttime_of_pid(pid_raw, &starttime_raw);
598
-
m = dbus_message_new_method_call(
599
-
"org.freedesktop.PolicyKit1",
600
-
"/org/freedesktop/PolicyKit1/Authority",
601
-
@@ -86,22 +74,13 @@ int verify_polkit(
603
-
dbus_message_iter_init_append(m, &iter_msg);
605
-
- pid_u32 = (uint32_t) pid_raw;
606
-
- starttime_u64 = (uint64_t) starttime_raw;
608
-
if (!dbus_message_iter_open_container(&iter_msg, DBUS_TYPE_STRUCT, NULL, &iter_struct) ||
609
-
- !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &unix_process) ||
610
-
+ !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &system_bus_name) ||
611
-
!dbus_message_iter_open_container(&iter_struct, DBUS_TYPE_ARRAY, "{sv}", &iter_array) ||
612
-
!dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) ||
613
-
- !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &pid) ||
614
-
- !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "u", &iter_variant) ||
615
-
- !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT32, &pid_u32) ||
616
-
- !dbus_message_iter_close_container(&iter_dict, &iter_variant) ||
617
-
- !dbus_message_iter_close_container(&iter_array, &iter_dict) ||
618
-
- !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) ||
619
-
- !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &starttime) ||
620
-
- !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "t", &iter_variant) ||
621
-
- !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT64, &starttime_u64) ||
622
-
+ !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &name) ||
623
-
+ !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "s", &iter_variant) ||
624
-
+ !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_STRING, &sender) ||
625
-
!dbus_message_iter_close_container(&iter_dict, &iter_variant) ||
626
-
!dbus_message_iter_close_container(&iter_array, &iter_dict) ||
627
-
!dbus_message_iter_close_container(&iter_struct, &iter_array) ||
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
629
-
index 3cca861..f6052dd 100644
58
+
index 0887bc3..6b502ce 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
632
-
@@ -1482,7 +1482,7 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me
634
-
} else if (dbus_message_is_signal(message, "org.freedesktop.systemd1.Manager", "JobRemoved")) {
636
-
- const char *path, *result, *unit;
637
-
+ const char *path, *result, *unit, *r;
639
-
if (dbus_message_get_args(message, &error,
640
-
DBUS_TYPE_UINT32, &id,
641
-
@@ -1491,7 +1491,11 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me
642
-
DBUS_TYPE_STRING, &result,
643
-
DBUS_TYPE_INVALID)) {
645
-
- free(set_remove(d->set, (char*) path));
646
-
+ r = set_remove(d->set, (char*) path);
648
-
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
652
-
if (!isempty(result))
653
-
d->result = strdup(result);
654
-
@@ -1511,7 +1515,11 @@ static DBusHandlerResult wait_filter(DBusConnection *connection, DBusMessage *me
655
-
/* Compatibility with older systemd versions <
656
-
* 183 during upgrades. This should be dropped
658
-
- free(set_remove(d->set, (char*) path));
659
-
+ r = set_remove(d->set, (char*) path);
661
-
+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
61
+
@@ -2561,7 +2561,7 @@ static int start_unit_one(
666
-
d->result = strdup(result);
667
-
@@ -1867,7 +1875,7 @@ static int start_unit_one(
63
+
log_debug("Adding %s to the set", p);
64
+
r = set_consume(s, p);
66
+
+ if (r < 0 && r != -EEXIST)
670
-
r = set_consume(s, p);
672
-
+ if (r < 0 && r != -EEXIST) {
673
-
log_error("Failed to add path to set.");
diff --git a/units/emergency.service.in b/units/emergency.service.in
677
-
index 442f0e0..6b7eafd 100644
71
+
index 94c090f..0d20640 100644
--- a/units/emergency.service.in
+++ b/units/emergency.service.in
@@ -15,7 +15,6 @@ Before=shutdown.target
···
ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
ExecStopPost=@SYSTEMCTL@ --fail --no-block default
82
+
diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
83
+
index aa853b8..f76cde0 100644
84
+
--- a/units/getty@.service.m4
85
+
+++ b/units/getty@.service.m4
86
+
@@ -23,7 +23,9 @@ IgnoreOnIsolate=yes
87
+
# On systems without virtual consoles, don't start any getty. Note
88
+
# that serial gettys are covered by serial-getty@.service, not this
90
+
-ConditionPathExists=/dev/tty0
91
+
+ConditionPathExists=|/dev/tty0
92
+
+ConditionVirtualization=|lxc
93
+
+ConditionVirtualization=|lxc-libvirt
96
+
# the VT is cleared by TTYVTDisallocate
diff --git a/units/local-fs.target b/units/local-fs.target
689
-
index 18c3d74..a09054c 100644
98
+
index ae3cedc..0e36840 100644
--- a/units/local-fs.target
+++ b/units/local-fs.target
692
-
@@ -11,3 +11,5 @@ Documentation=man:systemd.special(7)
693
-
After=local-fs-pre.target
101
+
@@ -13,3 +13,5 @@ DefaultDependencies=no
102
+
Conflicts=shutdown.target
OnFailure=emergency.target
695
-
OnFailureIsolate=no
104
+
OnFailureJobMode=replace-irreversibly
+X-StopOnReconfiguration=yes
diff --git a/units/remote-fs.target b/units/remote-fs.target
699
-
index 09213e8..47b4cf5 100644
108
+
index 43ffa5c..156a681 100644
--- a/units/remote-fs.target
+++ b/units/remote-fs.target
702
-
@@ -10,5 +10,7 @@ Description=Remote File Systems
703
-
Documentation=man:systemd.special(7)
704
-
After=remote-fs-pre.target
111
+
@@ -12,5 +12,7 @@ After=remote-fs-pre.target
112
+
DefaultDependencies=no
113
+
Conflicts=shutdown.target
+X-StopOnReconfiguration=yes
WantedBy=multi-user.target
diff --git a/units/rescue.service.m4.in b/units/rescue.service.m4.in
711
-
index 269797a..2c640f4 100644
120
+
index 552ef89..af3915f 100644
--- a/units/rescue.service.m4.in
+++ b/units/rescue.service.m4.in
@@ -16,7 +16,6 @@ Before=shutdown.target
···
-After=local-fs.target swap.target emergency.service emergency.target
+After=emergency.service emergency.target
143
+
diff --git a/units/systemd-backlight@.service.in b/units/systemd-backlight@.service.in
144
+
index e945d87..77728f2 100644
145
+
--- a/units/systemd-backlight@.service.in
146
+
+++ b/units/systemd-backlight@.service.in
147
+
@@ -19,3 +19,4 @@ Type=oneshot
148
+
RemainAfterExit=yes
149
+
ExecStart=@rootlibexecdir@/systemd-backlight load %i
150
+
ExecStop=@rootlibexecdir@/systemd-backlight save %i
151
+
+X-RestartIfChanged=false
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
735
-
index ab2e50c..9563a7d 100644
153
+
index de93879..c9a49f3 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
738
-
@@ -24,3 +24,8 @@ CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_SYSLOG C
156
+
@@ -25,3 +25,8 @@ WatchdogSec=1min
# Increase the default a bit in order to allow many simultaneous
# services being run since we keep one fd open per service.
···
+# journald to stop logging (see
+# https://bugs.freedesktop.org/show_bug.cgi?id=56043).
165
+
diff --git a/units/systemd-random-seed.service.in b/units/systemd-random-seed.service.in
166
+
index 1879b2f..9b895b9 100644
167
+
--- a/units/systemd-random-seed.service.in
168
+
+++ b/units/systemd-random-seed.service.in
169
+
@@ -19,3 +19,4 @@ Type=oneshot
170
+
RemainAfterExit=yes
171
+
ExecStart=@rootlibexecdir@/systemd-random-seed load
172
+
ExecStop=@rootlibexecdir@/systemd-random-seed save
173
+
+X-RestartIfChanged=false
174
+
diff --git a/units/systemd-rfkill@.service.in b/units/systemd-rfkill@.service.in
175
+
index 9d264a2..c505535 100644
176
+
--- a/units/systemd-rfkill@.service.in
177
+
+++ b/units/systemd-rfkill@.service.in
178
+
@@ -19,3 +19,4 @@ Type=oneshot
179
+
RemainAfterExit=yes
180
+
ExecStart=@rootlibexecdir@/systemd-rfkill load %I
181
+
ExecStop=@rootlibexecdir@/systemd-rfkill save %I
182
+
+X-RestartIfChanged=false
183
+
diff --git a/units/systemd-update-utmp.service.in b/units/systemd-update-utmp.service.in
184
+
index da7dda7..4cc550d 100644
185
+
--- a/units/systemd-update-utmp.service.in
186
+
+++ b/units/systemd-update-utmp.service.in
187
+
@@ -19,3 +19,4 @@ Type=oneshot
188
+
RemainAfterExit=yes
189
+
ExecStart=@rootlibexecdir@/systemd-update-utmp reboot
190
+
ExecStop=@rootlibexecdir@/systemd-update-utmp shutdown
191
+
+X-RestartIfChanged=false
diff --git a/units/systemd-user-sessions.service.in b/units/systemd-user-sessions.service.in
index 0869e73..b6ed958 100644
--- a/units/systemd-user-sessions.service.in