1
0
mirror of https://github.com/systemd/systemd synced 2025-11-22 10:14:45 +01:00

Compare commits

..

No commits in common. "346b7b6b4931fc6bee9e820e0160dd024a86ed52" and "5c7be924941456c10e7c0c290160c4baa84f776d" have entirely different histories.

9 changed files with 34 additions and 40 deletions

View File

@ -179,8 +179,8 @@
<citerefentry><refentrytitle>sd_booted</refentrytitle><manvolnum>3</manvolnum></citerefentry>. An <citerefentry><refentrytitle>sd_booted</refentrytitle><manvolnum>3</manvolnum></citerefentry>. An
alternate way to check for this state is to call alternate way to check for this state is to call
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> with <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> with
the <command>is-system-running</command> command. It will output <literal>offline</literal> if the the <command>is-system-running</command> command. It will return <literal>offline</literal> if the
system was not booted with systemd, though the return value has a different meaning.</para></listitem> system was not booted with systemd. </para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>

View File

@ -35,8 +35,6 @@
"reset-failed:Reset failed state for all, one, or more units" "reset-failed:Reset failed state for all, one, or more units"
"list-dependencies:Show unit dependency tree" "list-dependencies:Show unit dependency tree"
"clean:Remove configuration, state, cache, logs or runtime data of units" "clean:Remove configuration, state, cache, logs or runtime data of units"
"freeze:Freeze one or more units specified on the command line using cgroup freezer"
"thaw:Thaw (unfreeze) one or more units specified on the command line."
"bind:Bind mount a path from the host into a unit's namespace" "bind:Bind mount a path from the host into a unit's namespace"
"mount-image:Mount an image from the host into a unit's namespace" "mount-image:Mount an image from the host into a unit's namespace"
"whoami:Determines as part of which unit the command is being invoked" "whoami:Determines as part of which unit the command is being invoked"
@ -317,7 +315,7 @@ done
} }
# Completion functions for STOPPABLE_UNITS # Completion functions for STOPPABLE_UNITS
for fun in stop condstop kill try-restart condrestart freeze thaw; do for fun in stop kill try-restart condrestart ; do
(( $+functions[_systemctl_$fun] )) || _systemctl_$fun() (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
{ {
local _sys_active_units; _systemctl_active_units local _sys_active_units; _systemctl_active_units

View File

@ -79,8 +79,6 @@ const char* glyph_full(Glyph code, bool force_utf) {
[GLYPH_SPARKLES] = "*", [GLYPH_SPARKLES] = "*",
[GLYPH_LOW_BATTERY] = "!", [GLYPH_LOW_BATTERY] = "!",
[GLYPH_WARNING_SIGN] = "!", [GLYPH_WARNING_SIGN] = "!",
[GLYPH_COMPUTER_DISK] = "o",
[GLYPH_WORLD] = "W",
[GLYPH_RED_CIRCLE] = "o", [GLYPH_RED_CIRCLE] = "o",
[GLYPH_YELLOW_CIRCLE] = "o", [GLYPH_YELLOW_CIRCLE] = "o",
[GLYPH_BLUE_CIRCLE] = "o", [GLYPH_BLUE_CIRCLE] = "o",

View File

@ -955,7 +955,7 @@ finish:
return r; return r;
} }
int terminal_reset_ansi_seq(int fd) { static int terminal_reset_ansi_seq(int fd) {
int r, k; int r, k;
assert(fd >= 0); assert(fd >= 0);

View File

@ -34,8 +34,6 @@
bool isatty_safe(int fd); bool isatty_safe(int fd);
int terminal_reset_ansi_seq(int fd);
typedef enum TerminalResetFlags { typedef enum TerminalResetFlags {
TERMINAL_RESET_SWITCH_TO_TEXT = 1 << 0, TERMINAL_RESET_SWITCH_TO_TEXT = 1 << 0,
TERMINAL_RESET_AVOID_ANSI_SEQ = 1 << 1, TERMINAL_RESET_AVOID_ANSI_SEQ = 1 << 1,

View File

@ -90,12 +90,8 @@ modulesloaddir=${modules_load_dir}
catalog_dir=${prefix}/lib/systemd/catalog catalog_dir=${prefix}/lib/systemd/catalog
catalogdir=${catalog_dir} catalogdir=${catalog_dir}
system_alloc_uid_min={{SYSTEM_ALLOC_UID_MIN}}
systemallocuidmin=${system_alloc_uid_min}
system_uid_max={{SYSTEM_UID_MAX}} system_uid_max={{SYSTEM_UID_MAX}}
systemuidmax=${system_uid_max} systemuidmax=${system_uid_max}
system_alloc_gid_min={{SYSTEM_ALLOC_GID_MIN}}
systemallocgidmin=${system_alloc_gid_min}
system_gid_max={{SYSTEM_GID_MAX}} system_gid_max={{SYSTEM_GID_MAX}}
systemgidmax=${system_gid_max} systemgidmax=${system_gid_max}

View File

@ -5384,7 +5384,7 @@ static int run_container(
/* Registration always happens on the system bus */ /* Registration always happens on the system bus */
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *system_bus = NULL; _cleanup_(sd_bus_flush_close_unrefp) sd_bus *system_bus = NULL;
if (arg_register || (arg_privileged && !arg_keep_unit)) { if (arg_register || arg_privileged) {
r = sd_bus_default_system(&system_bus); r = sd_bus_default_system(&system_bus);
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to open system bus: %m"); return log_error_errno(r, "Failed to open system bus: %m");
@ -5399,21 +5399,21 @@ static int run_container(
/* Scope allocation happens on the user bus if we are unpriv, otherwise system bus. */ /* Scope allocation happens on the user bus if we are unpriv, otherwise system bus. */
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *user_bus = NULL; _cleanup_(sd_bus_flush_close_unrefp) sd_bus *user_bus = NULL;
_cleanup_(sd_bus_unrefp) sd_bus *runtime_bus = NULL; _cleanup_(sd_bus_unrefp) sd_bus *runtime_bus = NULL;
if (arg_privileged)
runtime_bus = sd_bus_ref(system_bus);
else {
r = sd_bus_default_user(&user_bus);
if (r < 0)
return log_error_errno(r, "Failed to open user bus: %m");
r = sd_bus_set_close_on_exit(user_bus, false);
if (r < 0)
return log_error_errno(r, "Failed to disable close-on-exit behaviour: %m");
runtime_bus = sd_bus_ref(user_bus);
}
if (!arg_keep_unit) { if (!arg_keep_unit) {
if (arg_privileged)
runtime_bus = sd_bus_ref(system_bus);
else {
r = sd_bus_default_user(&user_bus);
if (r < 0)
return log_error_errno(r, "Failed to open user bus: %m");
r = sd_bus_set_close_on_exit(user_bus, false);
if (r < 0)
return log_error_errno(r, "Failed to disable close-on-exit behaviour: %m");
runtime_bus = sd_bus_ref(user_bus);
}
/* When a new scope is created for this container, then we'll be registered as its controller, in which /* When a new scope is created for this container, then we'll be registered as its controller, in which
* case PID 1 will send us a friendly RequestStop signal, when it is asked to terminate the * case PID 1 will send us a friendly RequestStop signal, when it is asked to terminate the
* scope. Let's hook into that, and cleanly shut down the container, and print a friendly message. */ * scope. Let's hook into that, and cleanly shut down the container, and print a friendly message. */

View File

@ -81,9 +81,11 @@ static int allowed_fstypes(char ***ret_strv) {
assert(ret_strv); assert(ret_strv);
e = secure_getenv("SYSTEMD_DISSECT_FILE_SYSTEMS"); e = secure_getenv("SYSTEMD_DISSECT_FILE_SYSTEMS");
if (e) if (e) {
l = strv_split(e, ":"); l = strv_split(e, ":");
else if (!l)
return -ENOMEM;
} else {
l = strv_new("btrfs", l = strv_new("btrfs",
"erofs", "erofs",
"ext4", "ext4",
@ -91,10 +93,12 @@ static int allowed_fstypes(char ***ret_strv) {
"squashfs", "squashfs",
"vfat", "vfat",
"xfs"); "xfs");
if (!l) if (!l)
return -ENOMEM; return -ENOMEM;
}
*ret_strv = TAKE_PTR(l); *ret_strv = TAKE_PTR(l);
return 0; return 0;
} }

View File

@ -133,6 +133,13 @@ static void pty_forward_disconnect(PTYForward *f) {
/* STDIN/STDOUT should not be non-blocking normally, so let's reset it */ /* STDIN/STDOUT should not be non-blocking normally, so let's reset it */
(void) fd_nonblock(f->output_fd, false); (void) fd_nonblock(f->output_fd, false);
if (colors_enabled()) {
(void) loop_write(f->output_fd, ANSI_NORMAL ANSI_ERASE_TO_END_OF_SCREEN, SIZE_MAX);
if (f->title)
(void) loop_write(f->output_fd, ANSI_WINDOW_TITLE_POP, SIZE_MAX);
}
if (f->last_char_set && f->last_char != '\n') { if (f->last_char_set && f->last_char != '\n') {
const char *s; const char *s;
@ -146,13 +153,6 @@ static void pty_forward_disconnect(PTYForward *f) {
f->last_char = '\n'; f->last_char = '\n';
} }
if (colors_enabled()) {
if (f->title)
(void) loop_write(f->output_fd, ANSI_WINDOW_TITLE_POP, SIZE_MAX);
terminal_reset_ansi_seq(f->output_fd);
}
if (f->close_output_fd) if (f->close_output_fd)
f->output_fd = safe_close(f->output_fd); f->output_fd = safe_close(f->output_fd);
} }