at 15.09-beta 1177 lines 48 kB view raw
1diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in 2index e30d9a8..a3d399b 100644 3--- a/rules/99-systemd.rules.in 4+++ b/rules/99-systemd.rules.in 5@@ -14,10 +14,6 @@ KERNEL=="vport*", TAG+="systemd" 6 SUBSYSTEM=="block", KERNEL!="ram*", TAG+="systemd" 7 SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0" 8 9-# Ignore encrypted devices with no identified superblock on it, since 10-# we are probably still calling mke2fs or mkswap on it. 11-SUBSYSTEM=="block", KERNEL!="ram*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0" 12- 13 # Ignore raid devices that are not yet assembled and started 14 SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0" 15 SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0" 16diff --git a/src/core/job.c b/src/core/job.c 17index eaa4bb1..db44fee 100644 18--- a/src/core/job.c 19+++ b/src/core/job.c 20@@ -352,6 +352,9 @@ bool job_type_is_redundant(JobType a, UnitActiveState b) { 21 return 22 b == UNIT_ACTIVATING; 23 24+ case JOB_NOP: 25+ return true; 26+ 27 default: 28 assert_not_reached("Invalid job type"); 29 } 30diff --git a/src/core/job.h b/src/core/job.h 31index 1e7c61b..ee8e54a 100644 32--- a/src/core/job.h 33+++ b/src/core/job.h 34@@ -49,9 +49,11 @@ enum JobType { 35 _JOB_TYPE_MAX_MERGING, 36 37 /* JOB_NOP can enter into a transaction, but as it won't pull in 38- * any dependencies, it won't have to merge with anything. 39- * job_install() avoids the problem of merging JOB_NOP too (it's 40- * special-cased, only merges with other JOB_NOPs). */ 41+ * any dependencies and it uses the special 'nop_job' slot in Unit, 42+ * it won't have to merge with anything (except possibly into another 43+ * JOB_NOP, previously installed). JOB_NOP is special-cased in 44+ * job_type_is_*() functions so that the transaction can be 45+ * activated. */ 46 JOB_NOP = _JOB_TYPE_MAX_MERGING, /* do nothing */ 47 48 _JOB_TYPE_MAX_IN_TRANSACTION, 49@@ -190,11 +192,15 @@ _pure_ static inline bool job_type_is_mergeable(JobType a, JobType b) { 50 } 51 52 _pure_ static inline bool job_type_is_conflicting(JobType a, JobType b) { 53- return !job_type_is_mergeable(a, b); 54+ return a != JOB_NOP && b != JOB_NOP && !job_type_is_mergeable(a, b); 55 } 56 57 _pure_ static inline bool job_type_is_superset(JobType a, JobType b) { 58 /* Checks whether operation a is a "superset" of b in its actions */ 59+ if (b == JOB_NOP) 60+ return true; 61+ if (a == JOB_NOP) 62+ return false; 63 return a == job_type_lookup_merge(a, b); 64 } 65 66diff --git a/src/core/manager.c b/src/core/manager.c 67index d427d88..256d6f7 100644 68--- a/src/core/manager.c 69+++ b/src/core/manager.c 70@@ -662,9 +662,11 @@ static int manager_setup_notify(Manager *m) { 71 return -errno; 72 } 73 74- if (m->running_as == SYSTEMD_SYSTEM) 75+ if (m->running_as == SYSTEMD_SYSTEM) { 76 m->notify_socket = strdup("/run/systemd/notify"); 77- else { 78+ if (!m->notify_socket) 79+ return log_oom(); 80+ } else { 81 const char *e; 82 83 e = getenv("XDG_RUNTIME_DIR"); 84@@ -674,9 +676,11 @@ static int manager_setup_notify(Manager *m) { 85 } 86 87 m->notify_socket = strappend(e, "/systemd/notify"); 88+ if (!m->notify_socket) 89+ return log_oom(); 90+ 91+ mkdir_parents_label(m->notify_socket, 0755); 92 } 93- if (!m->notify_socket) 94- return log_oom(); 95 96 strncpy(sa.un.sun_path, m->notify_socket, sizeof(sa.un.sun_path)-1); 97 r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)); 98diff --git a/src/core/shutdown.c b/src/core/shutdown.c 99index 20cf526..03cfddc 100644 100--- a/src/core/shutdown.c 101+++ b/src/core/shutdown.c 102@@ -75,7 +75,9 @@ static int parse_argv(int argc, char *argv[]) { 103 assert(argc >= 1); 104 assert(argv); 105 106- while ((c = getopt_long(argc, argv, "", options, NULL)) >= 0) 107+ /* "-" prevents getopt from permuting argv[] and moving the verb away 108+ * from argv[1]. Our interface to initrd promises it'll be there. */ 109+ while ((c = getopt_long(argc, argv, "-", options, NULL)) >= 0) 110 switch (c) { 111 112 case ARG_LOG_LEVEL: 113@@ -113,6 +115,13 @@ static int parse_argv(int argc, char *argv[]) { 114 115 break; 116 117+ case '\001': 118+ if (!arg_verb) 119+ arg_verb = optarg; 120+ else 121+ log_error("Excess arguments, ignoring"); 122+ break; 123+ 124 case '?': 125 return -EINVAL; 126 127@@ -120,15 +129,11 @@ static int parse_argv(int argc, char *argv[]) { 128 assert_not_reached("Unhandled option code."); 129 } 130 131- if (optind >= argc) { 132+ if (!arg_verb) { 133 log_error("Verb argument missing."); 134 return -EINVAL; 135 } 136 137- arg_verb = argv[optind]; 138- 139- if (optind + 1 < argc) 140- log_error("Excess arguments, ignoring"); 141 return 0; 142 } 143 144diff --git a/src/core/snapshot.c b/src/core/snapshot.c 145index 5eed615..c2678cb 100644 146--- a/src/core/snapshot.c 147+++ b/src/core/snapshot.c 148@@ -208,7 +208,7 @@ int snapshot_create(Manager *m, const char *name, bool cleanup, sd_bus_error *e, 149 return sd_bus_error_setf(e, SD_BUS_ERROR_INVALID_ARGS, "Unit name %s lacks snapshot suffix.", name); 150 151 if (manager_get_unit(m, name)) 152- sd_bus_error_setf(e, BUS_ERROR_UNIT_EXISTS, "Snapshot %s exists already.", name); 153+ return sd_bus_error_setf(e, BUS_ERROR_UNIT_EXISTS, "Snapshot %s exists already.", name); 154 155 } else { 156 157diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in 158index d5b86bf..9c66e7b 100644 159--- a/src/core/systemd.pc.in 160+++ b/src/core/systemd.pc.in 161@@ -14,8 +14,8 @@ systemduserunitdir=@userunitdir@ 162 systemduserpresetdir=@userpresetdir@ 163 systemdsystemconfdir=@pkgsysconfdir@/system 164 systemduserconfdir=@pkgsysconfdir@/user 165-systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemdsystemunitdir}:/usr/lib/systemd/system:/lib/systemd/system 166-systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemduserunitdir}:/usr/lib/systemd/user:/usr/share/systemd/user 167+systemdsystemunitpath=${systemdsystemconfdir}:/etc/systemd/system:/etc/systemd-mutable/system:/nix/var/nix/profiles/default/lib/systemd/user:/run/systemd/system:${systemdsystemunitdir} 168+systemduserunitpath=${systemduserconfdir}:/etc/systemd/user:/etc/systemd-mutable/user:/nix/var/nix/profiles/default/lib/systemd/system:/run/systemd/user:${systemduserunitdir} 169 systemdsystemgeneratordir=@systemgeneratordir@ 170 systemdusergeneratordir=@usergeneratordir@ 171 systemdsleepdir=@systemsleepdir@ 172diff --git a/src/core/timer.c b/src/core/timer.c 173index a3713e2..5c4e9f9 100644 174--- a/src/core/timer.c 175+++ b/src/core/timer.c 176@@ -521,6 +521,7 @@ fail: 177 178 static int timer_start(Unit *u) { 179 Timer *t = TIMER(u); 180+ TimerValue *v; 181 182 assert(t); 183 assert(t->state == TIMER_DEAD || t->state == TIMER_FAILED); 184@@ -530,6 +531,11 @@ static int timer_start(Unit *u) { 185 186 t->last_trigger = DUAL_TIMESTAMP_NULL; 187 188+ /* Reenable all timers that depend on unit activation time */ 189+ LIST_FOREACH(value, v, t->values) 190+ if (v->base == TIMER_ACTIVE) 191+ v->disabled = false; 192+ 193 if (t->stamp_path) { 194 struct stat st; 195 196diff --git a/src/core/umount.c b/src/core/umount.c 197index cffa453..4d1a9ff 100644 198--- a/src/core/umount.c 199+++ b/src/core/umount.c 200@@ -385,6 +385,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e 201 * anyway, since we are running from it. They have 202 * already been remounted ro. */ 203 if (path_equal(m->path, "/") 204+ || path_equal(m->path, "/nix") 205+ || path_equal(m->path, "/nix/store") 206 #ifndef HAVE_SPLIT_USR 207 || path_equal(m->path, "/usr") 208 #endif 209diff --git a/src/delta/delta.c b/src/delta/delta.c 210index 25c4a0b..e1f2d6d 100644 211--- a/src/delta/delta.c 212+++ b/src/delta/delta.c 213@@ -487,7 +487,7 @@ static int parse_flags(const char *flag_str, int flags) { 214 const char *word, *state; 215 size_t l; 216 217- FOREACH_WORD(word, l, flag_str, state) { 218+ FOREACH_WORD_SEPARATOR(word, l, flag_str, ",", state) { 219 if (strneq("masked", word, l)) 220 flags |= SHOW_MASKED; 221 else if (strneq ("equivalent", word, l)) 222diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c 223index 70a5918..1926e52 100644 224--- a/src/fsck/fsck.c 225+++ b/src/fsck/fsck.c 226@@ -315,8 +315,7 @@ int main(int argc, char *argv[]) { 227 return EXIT_FAILURE; 228 } 229 230- cmdline[i++] = "/sbin/fsck"; 231- cmdline[i++] = arg_repair; 232+ cmdline[i++] = "/run/current-system/sw/bin/fsck"; 233 cmdline[i++] = "-T"; 234 235 /* 236diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c 237index e257c12..1e04553 100644 238--- a/src/fstab-generator/fstab-generator.c 239+++ b/src/fstab-generator/fstab-generator.c 240@@ -485,7 +485,7 @@ static int add_usr_mount(void) { 241 return log_oom(); 242 } 243 244- if (!arg_usr_what || !arg_usr_options) 245+ if (!arg_usr_what) 246 return 0; 247 248 what = fstab_node_to_udev_node(arg_usr_what); 249@@ -494,7 +494,13 @@ static int add_usr_mount(void) { 250 return -1; 251 } 252 253- opts = arg_usr_options; 254+ if (!arg_usr_options) 255+ opts = arg_root_rw > 0 ? "rw" : "ro"; 256+ else if (!mount_test_option(arg_usr_options, "ro") && 257+ !mount_test_option(arg_usr_options, "rw")) 258+ opts = strappenda(arg_usr_options, ",", arg_root_rw > 0 ? "rw" : "ro"); 259+ else 260+ opts = arg_usr_options; 261 262 log_debug("Found entry what=%s where=/sysroot/usr type=%s", what, strna(arg_usr_fstype)); 263 return add_mount(what, 264diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c 265index e487369..ff4e9c9 100644 266--- a/src/hostname/hostnamectl.c 267+++ b/src/hostname/hostnamectl.c 268@@ -536,5 +536,5 @@ int main(int argc, char *argv[]) { 269 r = hostnamectl_main(bus, argc, argv); 270 271 finish: 272- return r < 0 ? EXIT_FAILURE : r; 273+ return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; 274 } 275diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c 276index 8a2c0fc..9de3ddd 100644 277--- a/src/journal/journal-file.c 278+++ b/src/journal/journal-file.c 279@@ -1657,7 +1657,7 @@ static int generic_array_bisect( 280 } 281 } 282 283- if (k > n) { 284+ if (k >= n) { 285 if (direction == DIRECTION_UP) { 286 i = n; 287 subtract_one = true; 288diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c 289index f50faf4..03579fd 100644 290--- a/src/journal/journalctl.c 291+++ b/src/journal/journalctl.c 292@@ -682,7 +682,7 @@ static int parse_argv(int argc, char *argv[]) { 293 assert_not_reached("Unhandled option"); 294 } 295 296- if (arg_follow && !arg_no_tail && arg_lines == ARG_LINES_DEFAULT) 297+ if (arg_follow && !arg_no_tail && !arg_since && arg_lines == ARG_LINES_DEFAULT) 298 arg_lines = 10; 299 300 if (!!arg_directory + !!arg_file + !!arg_machine > 1) { 301diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c 302index 12735c4..08b143b 100644 303--- a/src/journal/journald-server.c 304+++ b/src/journal/journald-server.c 305@@ -1655,6 +1655,7 @@ void server_done(Server *s) { 306 free(s->buffer); 307 free(s->tty_path); 308 free(s->cgroup_root); 309+ free(s->hostname_field); 310 311 if (s->mmap) 312 mmap_cache_unref(s->mmap); 313diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c 314index 372f3ed..d56ee51 100644 315--- a/src/libsystemd-network/network-internal.c 316+++ b/src/libsystemd-network/network-internal.c 317@@ -392,10 +392,12 @@ void serialize_dhcp_routes(FILE *f, const char *key, struct sd_dhcp_route *route 318 319 fprintf(f, "%s=", key); 320 321- for (i = 0; i < size; i++) 322- fprintf(f, "%s/%" PRIu8 ",%s%s", inet_ntoa(routes[i].dst_addr), 323- routes[i].dst_prefixlen, inet_ntoa(routes[i].gw_addr), 324+ for (i = 0; i < size; i++) { 325+ fprintf(f, "%s/%" PRIu8, inet_ntoa(routes[i].dst_addr), 326+ routes[i].dst_prefixlen); 327+ fprintf(f, ",%s%s", inet_ntoa(routes[i].gw_addr), 328 (i < (size - 1)) ? " ": ""); 329+ } 330 331 fputs("\n", f); 332 } 333diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c 334index 0eba4c3..9986b52 100644 335--- a/src/libsystemd-network/sd-dhcp-client.c 336+++ b/src/libsystemd-network/sd-dhcp-client.c 337@@ -68,7 +68,6 @@ struct sd_dhcp_client { 338 uint32_t mtu; 339 uint32_t xid; 340 usec_t start_time; 341- uint16_t secs; 342 unsigned int attempt; 343 usec_t request_sent; 344 sd_event_source *timeout_t1; 345@@ -321,10 +320,12 @@ static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret, 346 _cleanup_free_ DHCPPacket *packet; 347 size_t optlen, optoffset, size; 348 be16_t max_size; 349+ usec_t time_now; 350+ uint16_t secs; 351 int r; 352 353 assert(client); 354- assert(client->secs); 355+ assert(client->start_time); 356 assert(ret); 357 assert(_optlen); 358 assert(_optoffset); 359@@ -344,7 +345,15 @@ static int client_message_init(sd_dhcp_client *client, DHCPPacket **ret, 360 361 /* Although 'secs' field is a SHOULD in RFC 2131, certain DHCP servers 362 refuse to issue an DHCP lease if 'secs' is set to zero */ 363- packet->dhcp.secs = htobe16(client->secs); 364+ r = sd_event_now(client->event, clock_boottime_or_monotonic(), &time_now); 365+ if (r < 0) 366+ return r; 367+ assert(time_now >= client->start_time); 368+ 369+ /* seconds between sending first and last DISCOVER 370+ * must always be strictly positive to deal with broken servers */ 371+ secs = ((time_now - client->start_time) / USEC_PER_SEC) ? : 1; 372+ packet->dhcp.secs = htobe16(secs); 373 374 /* RFC2132 section 4.1 375 A client that cannot receive unicast IP datagrams until its protocol 376@@ -441,24 +450,12 @@ static int dhcp_client_send_raw(sd_dhcp_client *client, DHCPPacket *packet, 377 static int client_send_discover(sd_dhcp_client *client) { 378 _cleanup_free_ DHCPPacket *discover = NULL; 379 size_t optoffset, optlen; 380- usec_t time_now; 381 int r; 382 383 assert(client); 384 assert(client->state == DHCP_STATE_INIT || 385 client->state == DHCP_STATE_SELECTING); 386 387- /* See RFC2131 section 4.4.1 */ 388- 389- r = sd_event_now(client->event, clock_boottime_or_monotonic(), &time_now); 390- if (r < 0) 391- return r; 392- assert(time_now >= client->start_time); 393- 394- /* seconds between sending first and last DISCOVER 395- * must always be strictly positive to deal with broken servers */ 396- client->secs = ((time_now - client->start_time) / USEC_PER_SEC) ? : 1; 397- 398 r = client_message_init(client, &discover, DHCP_DISCOVER, 399 &optlen, &optoffset); 400 if (r < 0) 401@@ -875,10 +872,8 @@ static int client_start(sd_dhcp_client *client) { 402 } 403 client->fd = r; 404 405- if (client->state == DHCP_STATE_INIT) { 406+ if (client->state == DHCP_STATE_INIT || client->state == DHCP_STATE_INIT_REBOOT) 407 client->start_time = now(clock_boottime_or_monotonic()); 408- client->secs = 0; 409- } 410 411 return client_initialize_events(client, client_receive_message_raw); 412 } 413@@ -1269,6 +1264,9 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message, 414 if (r >= 0) { 415 client->timeout_resend = 416 sd_event_source_unref(client->timeout_resend); 417+ client->receive_message = 418+ sd_event_source_unref(client->receive_message); 419+ client->fd = asynchronous_close(client->fd); 420 421 if (IN_SET(client->state, DHCP_STATE_REQUESTING, 422 DHCP_STATE_REBOOTING)) 423diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c 424index 4fb01c0..b7c9a07 100644 425--- a/src/libsystemd-network/sd-dhcp-lease.c 426+++ b/src/libsystemd-network/sd-dhcp-lease.c 427@@ -50,7 +50,7 @@ int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) { 428 429 int sd_dhcp_lease_get_lifetime(sd_dhcp_lease *lease, uint32_t *lifetime) { 430 assert_return(lease, -EINVAL); 431- assert_return(lease, -EINVAL); 432+ assert_return(lifetime, -EINVAL); 433 434 *lifetime = lease->lifetime; 435 436diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c 437index fa4f9b5..dbec1a2 100644 438--- a/src/libsystemd-network/sd-dhcp6-client.c 439+++ b/src/libsystemd-network/sd-dhcp6-client.c 440@@ -200,19 +200,19 @@ int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *du 441 442 switch (type) { 443 case DHCP6_DUID_LLT: 444- if (duid_len <= sizeof(client->duid.llt)) 445+ if (duid_len <= sizeof(client->duid.llt) - 2) 446 return -EINVAL; 447 break; 448 case DHCP6_DUID_EN: 449- if (duid_len != sizeof(client->duid.en)) 450+ if (duid_len != sizeof(client->duid.en) - 2) 451 return -EINVAL; 452 break; 453 case DHCP6_DUID_LL: 454- if (duid_len <= sizeof(client->duid.ll)) 455+ if (duid_len <= sizeof(client->duid.ll) - 2) 456 return -EINVAL; 457 break; 458 case DHCP6_DUID_UUID: 459- if (duid_len != sizeof(client->duid.uuid)) 460+ if (duid_len != sizeof(client->duid.uuid) - 2) 461 return -EINVAL; 462 break; 463 default: 464@@ -222,7 +222,7 @@ int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *du 465 466 client->duid.raw.type = htobe16(type); 467 memcpy(&client->duid.raw.data, duid, duid_len); 468- client->duid_len = duid_len; 469+ client->duid_len = duid_len + 2; /* +2 for sizeof(type) */ 470 471 return 0; 472 } 473diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c 474index 18afe0f..5658c61 100644 475--- a/src/libsystemd/sd-bus/bus-match.c 476+++ b/src/libsystemd/sd-bus/bus-match.c 477@@ -537,7 +537,7 @@ static int bus_match_find_compare_value( 478 else if (BUS_MATCH_CAN_HASH(t)) 479 n = hashmap_get(c->compare.children, value_str); 480 else { 481- for (n = c->child; !value_node_same(n, t, value_u8, value_str); n = n->next) 482+ for (n = c->child; n && !value_node_same(n, t, value_u8, value_str); n = n->next) 483 ; 484 } 485 486diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c 487index 0ab1119..6c3230a 100644 488--- a/src/libsystemd/sd-bus/bus-objects.c 489+++ b/src/libsystemd/sd-bus/bus-objects.c 490@@ -617,6 +617,9 @@ static int property_get_set_callbacks_run( 491 return r; 492 493 } else { 494+ const char *signature = NULL; 495+ char type = 0; 496+ 497 if (c->vtable->type != _SD_BUS_VTABLE_WRITABLE_PROPERTY) 498 return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_PROPERTY_READ_ONLY, "Property '%s' is not writable.", c->member); 499 500@@ -628,6 +631,13 @@ static int property_get_set_callbacks_run( 501 502 c->last_iteration = bus->iteration_counter; 503 504+ r = sd_bus_message_peek_type(m, &type, &signature); 505+ if (r < 0) 506+ return r; 507+ 508+ if (type != 'v' || !streq(strempty(signature), strempty(c->vtable->x.property.signature))) 509+ return sd_bus_reply_method_errorf(m, SD_BUS_ERROR_INVALID_ARGS, "Incorrect parameters for property '%s', expected '%s', got '%s'.", c->member, strempty(c->vtable->x.property.signature), strempty(signature)); 510+ 511 r = sd_bus_message_enter_container(m, 'v', c->vtable->x.property.signature); 512 if (r < 0) 513 return r; 514diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c 515index b501a52..740133a 100644 516--- a/src/libsystemd/sd-rtnl/rtnl-message.c 517+++ b/src/libsystemd/sd-rtnl/rtnl-message.c 518@@ -36,6 +36,8 @@ 519 #define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->container_offsets[i]) : NULL) 520 #define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers ++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr; 521 522+#define RTA_TYPE(rta) ((rta)->rta_type & NLA_TYPE_MASK) 523+ 524 static int message_new_empty(sd_rtnl *rtnl, sd_rtnl_message **ret) { 525 sd_rtnl_message *m; 526 527@@ -566,8 +568,8 @@ int sd_rtnl_message_append_string(sd_rtnl_message *m, unsigned short type, const 528 size = (size_t)r; 529 530 if (size) { 531- length = strnlen(data, size); 532- if (length >= size) 533+ length = strnlen(data, size+1); 534+ if (length > size) 535 return -EINVAL; 536 } else 537 length = strlen(data); 538@@ -1066,7 +1068,7 @@ int rtnl_message_parse(sd_rtnl_message *m, 539 *rta_tb_size = max + 1; 540 541 for (; RTA_OK(rta, rt_len); rta = RTA_NEXT(rta, rt_len)) { 542- type = rta->rta_type; 543+ type = RTA_TYPE(rta); 544 545 /* if the kernel is newer than the headers we used 546 when building, we ignore out-of-range attributes 547@@ -1222,7 +1224,7 @@ int socket_read_message(sd_rtnl *rtnl) { 548 } 549 } 550 551- for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len); new_msg = NLMSG_NEXT(new_msg, len)) { 552+ for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len) && !done; new_msg = NLMSG_NEXT(new_msg, len)) { 553 _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL; 554 const NLType *nl_type; 555 556@@ -1237,7 +1239,8 @@ int socket_read_message(sd_rtnl *rtnl) { 557 if (new_msg->nlmsg_type == NLMSG_DONE) { 558 /* finished reading multi-part message */ 559 done = true; 560- break; 561+ 562+ continue; 563 } 564 565 /* check that we support this message type */ 566diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c 567index 2699374..e2afcb8 100644 568--- a/src/libudev/libudev-device.c 569+++ b/src/libudev/libudev-device.c 570@@ -730,8 +730,13 @@ _public_ struct udev_device *udev_device_new_from_syspath(struct udev *udev, con 571 return NULL; 572 } else { 573 /* everything else just needs to be a directory */ 574- if (stat(path, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) 575+ if (stat(path, &statbuf) != 0) 576 return NULL; 577+ 578+ if (!S_ISDIR(statbuf.st_mode)) { 579+ errno = EISDIR; 580+ return NULL; 581+ } 582 } 583 584 udev_device = udev_device_new(udev); 585diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c 586index b6d9bc6..759794f 100644 587--- a/src/nspawn/nspawn.c 588+++ b/src/nspawn/nspawn.c 589@@ -758,7 +758,7 @@ static int mount_binds(const char *dest, char **l, bool ro) { 590 * and char devices. */ 591 if (S_ISDIR(source_st.st_mode)) { 592 r = mkdir_label(where, 0755); 593- if (r < 0) { 594+ if (r < 0 && errno != EEXIST) { 595 log_error("Failed to create mount point %s: %s", where, strerror(-r)); 596 597 return r; 598@@ -818,7 +818,7 @@ static int mount_tmpfs(const char *dest) { 599 return log_oom(); 600 601 r = mkdir_label(where, 0755); 602- if (r < 0) { 603+ if (r < 0 && errno != EEXIST) { 604 log_error("creating mount point for tmpfs %s failed: %s", where, strerror(-r)); 605 606 return r; 607@@ -3073,6 +3073,7 @@ int main(int argc, char *argv[]) { 608 goto finish; 609 } 610 } else { 611+#if 0 612 const char *p; 613 614 p = strappenda(arg_directory, 615@@ -3082,6 +3083,7 @@ int main(int argc, char *argv[]) { 616 goto finish; 617 618 } 619+#endif 620 } 621 } else { 622 char template[] = "/tmp/nspawn-root-XXXXXX"; 623diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c 624index 7375f77..ec8efcc 100644 625--- a/src/resolve/resolved-dns-packet.c 626+++ b/src/resolve/resolved-dns-packet.c 627@@ -866,7 +866,7 @@ fail: 628 629 int dns_packet_read_name(DnsPacket *p, char **_ret, 630 bool allow_compression, size_t *start) { 631- size_t saved_rindex, after_rindex = 0; 632+ size_t saved_rindex, after_rindex = 0, jump_barrier; 633 _cleanup_free_ char *ret = NULL; 634 size_t n = 0, allocated = 0; 635 bool first = true; 636@@ -876,6 +876,7 @@ int dns_packet_read_name(DnsPacket *p, char **_ret, 637 assert(_ret); 638 639 saved_rindex = p->rindex; 640+ jump_barrier = p->rindex; 641 642 for (;;) { 643 uint8_t c, d; 644@@ -922,7 +923,7 @@ int dns_packet_read_name(DnsPacket *p, char **_ret, 645 goto fail; 646 647 ptr = (uint16_t) (c & ~0xc0) << 8 | (uint16_t) d; 648- if (ptr < DNS_PACKET_HEADER_SIZE || ptr >= saved_rindex) { 649+ if (ptr < DNS_PACKET_HEADER_SIZE || ptr >= jump_barrier) { 650 r = -EBADMSG; 651 goto fail; 652 } 653@@ -930,9 +931,13 @@ int dns_packet_read_name(DnsPacket *p, char **_ret, 654 if (after_rindex == 0) 655 after_rindex = p->rindex; 656 657+ /* Jumps are limited to a "prior occurence" (RFC-1035 4.1.4) */ 658+ jump_barrier = ptr; 659 p->rindex = ptr; 660- } else 661+ } else { 662+ r = -EBADMSG; 663 goto fail; 664+ } 665 } 666 667 if (!GREEDY_REALLOC(ret, allocated, n + 1)) { 668diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c 669index 7d258c9..6dd4cad 100644 670--- a/src/resolve/resolved.c 671+++ b/src/resolve/resolved.c 672@@ -108,7 +108,7 @@ int main(int argc, char *argv[]) { 673 674 finish: 675 sd_notify(false, 676- "STOPPIN=1\n" 677+ "STOPPING=1\n" 678 "STATUS=Shutting down..."); 679 680 return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; 681diff --git a/src/run/run.c b/src/run/run.c 682index e3b6293..dcefb5c 100644 683--- a/src/run/run.c 684+++ b/src/run/run.c 685@@ -573,9 +573,12 @@ int main(int argc, char* argv[]) { 686 if (r <= 0) 687 goto finish; 688 689- r = find_binary(argv[optind], &command); 690+ r = find_binary(argv[optind], arg_transport == BUS_TRANSPORT_LOCAL, &command); 691 if (r < 0) { 692- log_error("Failed to find executable %s: %s", argv[optind], strerror(-r)); 693+ log_error("Failed to find executable %s%s: %s", 694+ argv[optind], 695+ arg_transport == BUS_TRANSPORT_LOCAL ? "" : " on local system", 696+ strerror(-r)); 697 goto finish; 698 } 699 argv[optind] = command; 700diff --git a/src/shared/install.c b/src/shared/install.c 701index 035b44c..cab93e8 100644 702--- a/src/shared/install.c 703+++ b/src/shared/install.c 704@@ -1620,12 +1620,10 @@ int unit_file_enable( 705 STRV_FOREACH(i, files) { 706 UnitFileState state; 707 708+ /* We only want to know if this unit is masked, so we ignore 709+ * errors from unit_file_get_state, deferring other checks. 710+ * This allows templated units to be enabled on the fly. */ 711 state = unit_file_get_state(scope, root_dir, *i); 712- if (state < 0) { 713- log_error("Failed to get unit file state for %s: %s", *i, strerror(-state)); 714- return state; 715- } 716- 717 if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) { 718 log_error("Failed to enable unit: Unit %s is masked", *i); 719 return -ENOTSUP; 720diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c 721index 8f75a8e..c800e01 100644 722--- a/src/shared/path-lookup.c 723+++ b/src/shared/path-lookup.c 724@@ -86,17 +86,14 @@ static char** user_dirs( 725 const char * const config_unit_paths[] = { 726 USER_CONFIG_UNIT_PATH, 727 "/etc/systemd/user", 728+ "/etc/systemd-mutable/user", 729 NULL 730 }; 731 732 const char * const runtime_unit_path = "/run/systemd/user"; 733 734 const char * const data_unit_paths[] = { 735- "/usr/local/lib/systemd/user", 736- "/usr/local/share/systemd/user", 737 USER_DATA_UNIT_PATH, 738- "/usr/lib/systemd/user", 739- "/usr/share/systemd/user", 740 NULL 741 }; 742 743@@ -260,13 +257,11 @@ int lookup_paths_init( 744 STRV_IFNOTNULL(generator_early), 745 USER_CONFIG_UNIT_PATH, 746 "/etc/systemd/user", 747+ "/etc/systemd-mutable/user", 748+ "/nix/var/nix/profiles/default/lib/systemd/user", 749 "/run/systemd/user", 750 STRV_IFNOTNULL(generator), 751- "/usr/local/lib/systemd/user", 752- "/usr/local/share/systemd/user", 753 USER_DATA_UNIT_PATH, 754- "/usr/lib/systemd/user", 755- "/usr/share/systemd/user", 756 STRV_IFNOTNULL(generator_late), 757 NULL); 758 } else 759@@ -276,14 +271,11 @@ int lookup_paths_init( 760 STRV_IFNOTNULL(generator_early), 761 SYSTEM_CONFIG_UNIT_PATH, 762 "/etc/systemd/system", 763+ "/etc/systemd-mutable/system", 764+ "/nix/var/nix/profiles/default/lib/systemd/system", 765 "/run/systemd/system", 766 STRV_IFNOTNULL(generator), 767- "/usr/local/lib/systemd/system", 768 SYSTEM_DATA_UNIT_PATH, 769- "/usr/lib/systemd/system", 770-#ifdef HAVE_SPLIT_USR 771- "/lib/systemd/system", 772-#endif 773 STRV_IFNOTNULL(generator_late), 774 NULL); 775 776diff --git a/src/shared/path-util.c b/src/shared/path-util.c 777index 67566bc..be03695 100644 778--- a/src/shared/path-util.c 779+++ b/src/shared/path-util.c 780@@ -563,11 +563,11 @@ int path_is_os_tree(const char *path) { 781 return r >= 0; 782 } 783 784-int find_binary(const char *name, char **filename) { 785+int find_binary(const char *name, bool local, char **filename) { 786 assert(name); 787 788 if (is_path(name)) { 789- if (access(name, X_OK) < 0) 790+ if (local && access(name, X_OK) < 0) 791 return -errno; 792 793 if (filename) { 794@@ -657,7 +657,7 @@ int fsck_exists(const char *fstype) { 795 796 checker = strappenda("fsck.", fstype); 797 798- r = find_binary(checker, &p); 799+ r = find_binary(checker, true, &p); 800 if (r < 0) 801 return r; 802 803diff --git a/src/shared/path-util.h b/src/shared/path-util.h 804index 8d171a5..bd0d324 100644 805--- a/src/shared/path-util.h 806+++ b/src/shared/path-util.h 807@@ -55,7 +55,7 @@ int path_is_mount_point(const char *path, bool allow_symlink); 808 int path_is_read_only_fs(const char *path); 809 int path_is_os_tree(const char *path); 810 811-int find_binary(const char *name, char **filename); 812+int find_binary(const char *name, bool local, char **filename); 813 814 bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update); 815 816diff --git a/src/shared/virt.c b/src/shared/virt.c 817index f9c4e67..f10baab 100644 818--- a/src/shared/virt.c 819+++ b/src/shared/virt.c 820@@ -293,8 +293,26 @@ int detect_container(const char **id) { 821 822 r = read_one_line_file("/run/systemd/container", &m); 823 if (r == -ENOENT) { 824- r = 0; 825- goto finish; 826+ 827+ /* Fallback for cases where PID 1 was not 828+ * systemd (for example, cases where 829+ * init=/bin/sh is used. */ 830+ 831+ r = getenv_for_pid(1, "container", &m); 832+ if (r <= 0) { 833+ 834+ /* If that didn't work, give up, 835+ * assume no container manager. 836+ * 837+ * Note: This means we still cannot 838+ * detect containers if init=/bin/sh 839+ * is passed but privileges dropped, 840+ * as /proc/1/environ is only readable 841+ * with privileges. */ 842+ 843+ r = 0; 844+ goto finish; 845+ } 846 } 847 if (r < 0) 848 return r; 849diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c 850index 28eaa6a..3866308 100644 851--- a/src/systemctl/systemctl.c 852+++ b/src/systemctl/systemctl.c 853@@ -2651,7 +2651,7 @@ static int start_unit_one( 854 855 log_debug("Adding %s to the set", p); 856 r = set_consume(s, p); 857- if (r < 0) 858+ if (r < 0 && r != -EEXIST) 859 return log_oom(); 860 } 861 862@@ -6917,8 +6917,13 @@ done: 863 864 static int halt_now(enum action a) { 865 866-/* Make sure C-A-D is handled by the kernel from this 867- * point on... */ 868+ /* The kernel will automaticall flush ATA disks and suchlike 869+ * on reboot(), but the file systems need to be synce'd 870+ * explicitly in advance. */ 871+ sync(); 872+ 873+ /* Make sure C-A-D is handled by the kernel from this point 874+ * on... */ 875 reboot(RB_ENABLE_CAD); 876 877 switch (a) { 878diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c 879index 63d64b2..57264de 100644 880--- a/src/test/test-path-util.c 881+++ b/src/test/test-path-util.c 882@@ -85,29 +85,30 @@ static void test_path(void) { 883 } 884 } 885 886-static void test_find_binary(const char *self) { 887+static void test_find_binary(const char *self, bool local) { 888 char *p; 889 890- assert_se(find_binary("/bin/sh", &p) == 0); 891+ assert_se(find_binary("/bin/sh", local, &p) == 0); 892 puts(p); 893 assert_se(streq(p, "/bin/sh")); 894 free(p); 895 896- assert_se(find_binary(self, &p) == 0); 897+ assert_se(find_binary(self, local, &p) == 0); 898 puts(p); 899 assert_se(endswith(p, "/test-path-util")); 900 assert_se(path_is_absolute(p)); 901 free(p); 902 903- assert_se(find_binary("sh", &p) == 0); 904+ assert_se(find_binary("sh", local, &p) == 0); 905 puts(p); 906 assert_se(endswith(p, "/sh")); 907 assert_se(path_is_absolute(p)); 908 free(p); 909 910- assert_se(find_binary("xxxx-xxxx", &p) == -ENOENT); 911+ assert_se(find_binary("xxxx-xxxx", local, &p) == -ENOENT); 912 913- assert_se(find_binary("/some/dir/xxxx-xxxx", &p) == -ENOENT); 914+ assert_se(find_binary("/some/dir/xxxx-xxxx", local, &p) == 915+ (local ? -ENOENT : 0)); 916 } 917 918 static void test_prefixes(void) { 919@@ -244,7 +245,8 @@ static void test_strv_resolve(void) { 920 921 int main(int argc, char **argv) { 922 test_path(); 923- test_find_binary(argv[0]); 924+ test_find_binary(argv[0], true); 925+ test_find_binary(argv[0], false); 926 test_prefixes(); 927 test_path_join(); 928 test_fsck_exists(); 929diff --git a/src/udev/udevd.c b/src/udev/udevd.c 930index 2e6c713..193702c 100644 931--- a/src/udev/udevd.c 932+++ b/src/udev/udevd.c 933@@ -994,9 +994,9 @@ static void kernel_cmdline_options(struct udev *udev) { 934 if (r < 0) 935 log_warning("Invalid udev.exec-delay ignored: %s", opt + 16); 936 } else if (startswith(opt, "udev.event-timeout=")) { 937- r = safe_atou64(opt + 16, &arg_event_timeout_usec); 938+ r = safe_atou64(opt + 19, &arg_event_timeout_usec); 939 if (r < 0) { 940- log_warning("Invalid udev.event-timeout ignored: %s", opt + 16); 941+ log_warning("Invalid udev.event-timeout ignored: %s", opt + 19); 942 break; 943 } 944 arg_event_timeout_usec *= USEC_PER_SEC; 945diff --git a/units/console-getty.service.m4.in b/units/console-getty.service.m4.in 946index 8ac51a4..cae9fb5 100644 947--- a/units/console-getty.service.m4.in 948+++ b/units/console-getty.service.m4.in 949@@ -15,7 +15,6 @@ After=rc-local.service 950 Before=getty.target 951 952 [Service] 953-ExecStart=-/sbin/agetty --noclear --keep-baud console 115200,38400,9600 $TERM 954 Type=idle 955 Restart=always 956 RestartSec=0 957diff --git a/units/container-getty@.service.m4.in b/units/container-getty@.service.m4.in 958index 4f7794b..6dfc2e9 100644 959--- a/units/container-getty@.service.m4.in 960+++ b/units/container-getty@.service.m4.in 961@@ -14,9 +14,9 @@ After=rc-local.service 962 )m4_dnl 963 Before=getty.target 964 IgnoreOnIsolate=yes 965+ConditionPathExists=/dev/pts/%I 966 967 [Service] 968-ExecStart=-/sbin/agetty --noclear --keep-baud pts/%I 115200,38400,9600 $TERM 969 Type=idle 970 Restart=always 971 RestartSec=0 972diff --git a/units/emergency.service.in b/units/emergency.service.in 973index 18973e7..3a99660 100644 974--- a/units/emergency.service.in 975+++ b/units/emergency.service.in 976@@ -16,7 +16,6 @@ Before=shutdown.target 977 [Service] 978 Environment=HOME=/root 979 WorkingDirectory=/root 980-ExecStartPre=-/bin/plymouth quit 981 ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.' 982 ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" 983 Type=idle 984diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 985index 46164ab..f194a31 100644 986--- a/units/getty@.service.m4 987+++ b/units/getty@.service.m4 988@@ -23,11 +23,12 @@ IgnoreOnIsolate=yes 989 # On systems without virtual consoles, don't start any getty. Note 990 # that serial gettys are covered by serial-getty@.service, not this 991 # unit. 992-ConditionPathExists=/dev/tty0 993+ConditionPathExists=|/dev/tty0 994+ConditionVirtualization=|lxc 995+ConditionVirtualization=|lxc-libvirt 996 997 [Service] 998 # the VT is cleared by TTYVTDisallocate 999-ExecStart=-/sbin/agetty --noclear %I $TERM 1000 Type=idle 1001 Restart=always 1002 RestartSec=0 1003diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in 1004index 0934a87..7e30c9e 100644 1005--- a/units/kmod-static-nodes.service.in 1006+++ b/units/kmod-static-nodes.service.in 1007@@ -10,7 +10,6 @@ Description=Create list of required static device nodes for the current kernel 1008 DefaultDependencies=no 1009 Before=sysinit.target systemd-tmpfiles-setup-dev.service 1010 ConditionCapability=CAP_SYS_MODULE 1011-ConditionPathExists=/lib/modules/%v/modules.devname 1012 1013 [Service] 1014 Type=oneshot 1015diff --git a/units/local-fs.target b/units/local-fs.target 1016index d2e5429..d26984b 100644 1017--- a/units/local-fs.target 1018+++ b/units/local-fs.target 1019@@ -13,3 +13,5 @@ Conflicts=shutdown.target 1020 After=local-fs-pre.target 1021 OnFailure=emergency.target 1022 OnFailureJobMode=replace-irreversibly 1023+ 1024+X-StopOnReconfiguration=yes 1025diff --git a/units/remote-fs.target b/units/remote-fs.target 1026index 43ffa5c..156a681 100644 1027--- a/units/remote-fs.target 1028+++ b/units/remote-fs.target 1029@@ -12,5 +12,7 @@ After=remote-fs-pre.target 1030 DefaultDependencies=no 1031 Conflicts=shutdown.target 1032 1033+X-StopOnReconfiguration=yes 1034+ 1035 [Install] 1036 WantedBy=multi-user.target 1037diff --git a/units/rescue.service.in b/units/rescue.service.in 1038index fc93f1e..3c87cf8 100644 1039--- a/units/rescue.service.in 1040+++ b/units/rescue.service.in 1041@@ -16,7 +16,6 @@ Before=shutdown.target 1042 [Service] 1043 Environment=HOME=/root 1044 WorkingDirectory=/root 1045-ExecStartPre=-/bin/plymouth quit 1046 ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.' 1047 ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" 1048 Type=idle 1049diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 1050index 4522d0d..96daa5c 100644 1051--- a/units/serial-getty@.service.m4 1052+++ b/units/serial-getty@.service.m4 1053@@ -22,7 +22,6 @@ Before=getty.target 1054 IgnoreOnIsolate=yes 1055 1056 [Service] 1057-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM 1058 Type=idle 1059 Restart=always 1060 UtmpIdentifier=%I 1061diff --git a/units/sysinit.target b/units/sysinit.target 1062index ec33503..4ac47b9 100644 1063--- a/units/sysinit.target 1064+++ b/units/sysinit.target 1065@@ -9,5 +9,4 @@ 1066 Description=System Initialization 1067 Documentation=man:systemd.special(7) 1068 Conflicts=emergency.service emergency.target 1069-Wants=local-fs.target swap.target 1070-After=local-fs.target swap.target emergency.service emergency.target 1071+After=emergency.service emergency.target 1072diff --git a/units/systemd-backlight@.service.in b/units/systemd-backlight@.service.in 1073index ecf3de4..7e83446 100644 1074--- a/units/systemd-backlight@.service.in 1075+++ b/units/systemd-backlight@.service.in 1076@@ -19,3 +19,4 @@ Type=oneshot 1077 RemainAfterExit=yes 1078 ExecStart=@rootlibexecdir@/systemd-backlight load %i 1079 ExecStop=@rootlibexecdir@/systemd-backlight save %i 1080+X-RestartIfChanged=false 1081diff --git a/units/systemd-journal-flush.service.in b/units/systemd-journal-flush.service.in 1082index 699670b..ba22c6d 100644 1083--- a/units/systemd-journal-flush.service.in 1084+++ b/units/systemd-journal-flush.service.in 1085@@ -10,8 +10,10 @@ Description=Trigger Flushing of Journal to Persistent Storage 1086 Documentation=man:systemd-journald.service(8) man:journald.conf(5) 1087 DefaultDependencies=no 1088 Requires=systemd-journald.service 1089-After=systemd-journald.service local-fs.target remote-fs.target 1090+After=systemd-journald.service 1091+After=systemd-remount-fs.service 1092 Before=systemd-user-sessions.service systemd-tmpfiles-setup.service 1093+RequiresMountsFor=/var/log/journal 1094 1095 [Service] 1096 ExecStart=@rootbindir@/journalctl --flush 1097diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in 1098index 4de38fa..2f23c13 100644 1099--- a/units/systemd-journald.service.in 1100+++ b/units/systemd-journald.service.in 1101@@ -14,6 +14,7 @@ After=systemd-journald.socket systemd-journald-dev-log.socket syslog.socket 1102 Before=sysinit.target 1103 1104 [Service] 1105+Type=notify 1106 Sockets=systemd-journald.socket systemd-journald-dev-log.socket 1107 ExecStart=@rootlibexecdir@/systemd-journald 1108 Restart=always 1109@@ -26,3 +27,8 @@ WatchdogSec=1min 1110 # Increase the default a bit in order to allow many simultaneous 1111 # services being run since we keep one fd open per service. 1112 LimitNOFILE=16384 1113+ 1114+# Don't restart journald, since that causes services connected to 1115+# journald to stop logging (see 1116+# https://bugs.freedesktop.org/show_bug.cgi?id=56043). 1117+X-RestartIfChanged=no 1118diff --git a/units/systemd-random-seed.service.in b/units/systemd-random-seed.service.in 1119index b55844b..3ef9fc6 100644 1120--- a/units/systemd-random-seed.service.in 1121+++ b/units/systemd-random-seed.service.in 1122@@ -19,3 +19,4 @@ Type=oneshot 1123 RemainAfterExit=yes 1124 ExecStart=@rootlibexecdir@/systemd-random-seed load 1125 ExecStop=@rootlibexecdir@/systemd-random-seed save 1126+X-RestartIfChanged=false 1127diff --git a/units/systemd-rfkill@.service.in b/units/systemd-rfkill@.service.in 1128index 0e9851b..9f8fa0d 100644 1129--- a/units/systemd-rfkill@.service.in 1130+++ b/units/systemd-rfkill@.service.in 1131@@ -19,3 +19,4 @@ Type=oneshot 1132 RemainAfterExit=yes 1133 ExecStart=@rootlibexecdir@/systemd-rfkill load %I 1134 ExecStop=@rootlibexecdir@/systemd-rfkill save %I 1135+X-RestartIfChanged=false 1136diff --git a/units/systemd-tmpfiles-setup.service.in b/units/systemd-tmpfiles-setup.service.in 1137index e895cda..194146f 100644 1138--- a/units/systemd-tmpfiles-setup.service.in 1139+++ b/units/systemd-tmpfiles-setup.service.in 1140@@ -11,7 +11,7 @@ Documentation=man:tmpfiles.d(5) man:systemd-tmpfiles(8) 1141 DefaultDependencies=no 1142 Conflicts=shutdown.target 1143 After=local-fs.target systemd-sysusers.service 1144-Before=sysinit.target shutdown.target 1145+Before=shutdown.target 1146 RefuseManualStop=yes 1147 1148 [Service] 1149diff --git a/units/systemd-update-utmp.service.in b/units/systemd-update-utmp.service.in 1150index 163eccd..7357c12 100644 1151--- a/units/systemd-update-utmp.service.in 1152+++ b/units/systemd-update-utmp.service.in 1153@@ -11,7 +11,7 @@ Documentation=man:systemd-update-utmp.service(8) man:utmp(5) 1154 DefaultDependencies=no 1155 RequiresMountsFor=/var/log/wtmp 1156 Conflicts=shutdown.target 1157-After=systemd-remount-fs.service systemd-tmpfiles-setup.service auditd.service 1158+After=systemd-remount-fs.service auditd.service 1159 Before=sysinit.target shutdown.target 1160 1161 [Service] 1162@@ -19,3 +19,4 @@ Type=oneshot 1163 RemainAfterExit=yes 1164 ExecStart=@rootlibexecdir@/systemd-update-utmp reboot 1165 ExecStop=@rootlibexecdir@/systemd-update-utmp shutdown 1166+X-RestartIfChanged=false 1167diff --git a/units/systemd-user-sessions.service.in b/units/systemd-user-sessions.service.in 1168index 0869e73..b6ed958 100644 1169--- a/units/systemd-user-sessions.service.in 1170+++ b/units/systemd-user-sessions.service.in 1171@@ -15,3 +15,6 @@ Type=oneshot 1172 RemainAfterExit=yes 1173 ExecStart=@rootlibexecdir@/systemd-user-sessions start 1174 ExecStop=@rootlibexecdir@/systemd-user-sessions stop 1175+ 1176+# Restart kills all active sessions. 1177+X-RestartIfChanged=no