mirror of
https://github.com/systemd/systemd
synced 2026-04-07 15:44:49 +02:00
Compare commits
7 Commits
434a270ccd
...
15bd1496c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15bd1496c9 | ||
|
|
710843e562 | ||
|
|
84a4e4affd | ||
|
|
6cd25c8ebb | ||
|
|
33528484c4 | ||
|
|
2a908e9a93 | ||
|
|
d3a4313524 |
@ -1 +1 @@
|
|||||||
258.1
|
258.2
|
||||||
|
|||||||
@ -163,6 +163,8 @@ static inline bool osc_char_is_valid(char c) {
|
|||||||
return (unsigned char) c >= 32 && (unsigned char) c < 127;
|
return (unsigned char) c >= 32 && (unsigned char) c < 127;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define VTNR_MAX 63
|
||||||
|
|
||||||
static inline bool vtnr_is_valid(unsigned n) {
|
static inline bool vtnr_is_valid(unsigned n) {
|
||||||
return n >= 1 && n <= 63;
|
return n >= 1 && n <= VTNR_MAX;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <linux/oom.h>
|
#include <linux/oom.h>
|
||||||
|
#include <linux/vt.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
@ -1927,6 +1928,32 @@ static void finish_remaining_processes(ManagerObjective objective) {
|
|||||||
broadcast_signal(SIGKILL, /* wait_for_exit= */ false, /* send_sighup= */ false, arg_defaults.timeout_stop_usec);
|
broadcast_signal(SIGKILL, /* wait_for_exit= */ false, /* send_sighup= */ false, arg_defaults.timeout_stop_usec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void reduce_vt(ManagerObjective objective) {
|
||||||
|
int r;
|
||||||
|
|
||||||
|
if (objective != MANAGER_SOFT_REBOOT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Switches back to VT 1, and releases all other VTs, in an attempt to return to a situation similar
|
||||||
|
* to how it was during the original kernel initialization. This is important because if some random
|
||||||
|
* TTY is in foreground, /dev/console will end up pointing to it, where the future init system will
|
||||||
|
* then write its status output to, but where it probably shouldn't be writing to. */
|
||||||
|
|
||||||
|
r = chvt(1);
|
||||||
|
if (r < 0)
|
||||||
|
log_debug_errno(r, "Failed to switch to VT TTY 1, ignoring: %m");
|
||||||
|
|
||||||
|
_cleanup_close_ int tty0_fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK);
|
||||||
|
if (tty0_fd < 0)
|
||||||
|
return (void) log_debug_errno(tty0_fd, "Failed to open '/dev/tty0', ignoring: %m");
|
||||||
|
|
||||||
|
for (int ttynr = 2; ttynr <= VTNR_MAX; ttynr++)
|
||||||
|
if (ioctl(tty0_fd, VT_DISALLOCATE, ttynr) < 0)
|
||||||
|
log_debug_errno(errno, "Failed to disallocate VT TTY %i, ignoring: %m", ttynr);
|
||||||
|
else
|
||||||
|
log_debug("Successfully disallocated VT TTY %i.", ttynr);
|
||||||
|
}
|
||||||
|
|
||||||
static int do_reexecute(
|
static int do_reexecute(
|
||||||
ManagerObjective objective,
|
ManagerObjective objective,
|
||||||
int argc,
|
int argc,
|
||||||
@ -1994,6 +2021,7 @@ static int do_reexecute(
|
|||||||
(void) setrlimit(RLIMIT_MEMLOCK, saved_rlimit_memlock);
|
(void) setrlimit(RLIMIT_MEMLOCK, saved_rlimit_memlock);
|
||||||
|
|
||||||
finish_remaining_processes(objective);
|
finish_remaining_processes(objective);
|
||||||
|
reduce_vt(objective);
|
||||||
|
|
||||||
if (switch_root_dir) {
|
if (switch_root_dir) {
|
||||||
r = switch_root(/* new_root= */ switch_root_dir,
|
r = switch_root(/* new_root= */ switch_root_dir,
|
||||||
|
|||||||
@ -1762,8 +1762,14 @@ int dhcp4_start_full(Link *link, bool set_ipv6_connectivity) {
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(link);
|
assert(link);
|
||||||
|
assert(link->manager);
|
||||||
assert(link->network);
|
assert(link->network);
|
||||||
|
|
||||||
|
/* On stopping/restarting networkd, we may drop IPv6 connectivity (which depends on KeepConfiguration=
|
||||||
|
* setting). Do not (re)start DHCPv4 client in that case. See issue #39299. */
|
||||||
|
if (link->manager->state != MANAGER_RUNNING)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!link->dhcp_client)
|
if (!link->dhcp_client)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@ -2225,7 +2225,7 @@ static int link_update_flags(Link *link, sd_netlink_message *message) {
|
|||||||
if (!had_carrier && link_has_carrier(link))
|
if (!had_carrier && link_has_carrier(link))
|
||||||
r = link_carrier_gained(link);
|
r = link_carrier_gained(link);
|
||||||
else if (had_carrier && !link_has_carrier(link))
|
else if (had_carrier && !link_has_carrier(link))
|
||||||
link_carrier_lost(link);
|
r = link_carrier_lost(link);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
|||||||
@ -377,6 +377,8 @@ static int link_set_ip_forwarding(Link *link, int family) {
|
|||||||
if (FLAGS_SET(link->network->ip_masquerade, AF_TO_ADDRESS_FAMILY(family)) &&
|
if (FLAGS_SET(link->network->ip_masquerade, AF_TO_ADDRESS_FAMILY(family)) &&
|
||||||
link->manager->ip_forwarding[family == AF_INET6] < 0) {
|
link->manager->ip_forwarding[family == AF_INET6] < 0) {
|
||||||
|
|
||||||
|
log_link_notice(link, "IPMasquerade= is enabled on the interface, enabling the global IPv6Forwarding= setting, which may affect NDisc and DHCPv6 client on other interfaces.");
|
||||||
|
|
||||||
link->manager->ip_forwarding[family == AF_INET6] = true;
|
link->manager->ip_forwarding[family == AF_INET6] = true;
|
||||||
manager_set_ip_forwarding(link->manager, family);
|
manager_set_ip_forwarding(link->manager, family);
|
||||||
|
|
||||||
|
|||||||
@ -198,7 +198,7 @@ static int dispatch_dns_configuration(const char *name, sd_json_variant *variant
|
|||||||
}
|
}
|
||||||
|
|
||||||
int dns_configuration_from_json(sd_json_variant *variant, DNSConfiguration **ret) {
|
int dns_configuration_from_json(sd_json_variant *variant, DNSConfiguration **ret) {
|
||||||
return dispatch_dns_configuration(NULL, variant, SD_JSON_LOG, ret);
|
return dispatch_dns_configuration(NULL, variant, SD_JSON_LOG|SD_JSON_ALLOW_EXTENSIONS, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dns_is_accessible(DNSConfiguration *c) {
|
bool dns_is_accessible(DNSConfiguration *c) {
|
||||||
|
|||||||
@ -55,6 +55,8 @@ static int device_monitor_handler(sd_device_monitor *monitor, sd_device *device,
|
|||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user