mirror of
https://github.com/systemd/systemd
synced 2025-11-22 10:14:45 +01:00
Compare commits
7 Commits
5c7be92494
...
346b7b6b49
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
346b7b6b49 | ||
|
|
c3d5f5f165 | ||
|
|
c4d708c3aa | ||
|
|
9f8c4bc65a | ||
|
|
3d97db8f3c | ||
|
|
e6a05af50b | ||
|
|
341bccdf1e |
@ -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 return <literal>offline</literal> if the
|
the <command>is-system-running</command> command. It will output <literal>offline</literal> if the
|
||||||
system was not booted with systemd. </para></listitem>
|
system was not booted with systemd, though the return value has a different meaning.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|||||||
@ -35,6 +35,8 @@
|
|||||||
"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"
|
||||||
@ -315,7 +317,7 @@ done
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Completion functions for STOPPABLE_UNITS
|
# Completion functions for STOPPABLE_UNITS
|
||||||
for fun in stop kill try-restart condrestart ; do
|
for fun in stop condstop kill try-restart condrestart freeze thaw; 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
|
||||||
|
|||||||
@ -79,6 +79,8 @@ 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",
|
||||||
|
|||||||
@ -955,7 +955,7 @@ finish:
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int terminal_reset_ansi_seq(int fd) {
|
int terminal_reset_ansi_seq(int fd) {
|
||||||
int r, k;
|
int r, k;
|
||||||
|
|
||||||
assert(fd >= 0);
|
assert(fd >= 0);
|
||||||
|
|||||||
@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
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,
|
||||||
|
|||||||
@ -90,8 +90,12 @@ 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}
|
||||||
|
|
||||||
|
|||||||
@ -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) {
|
if (arg_register || (arg_privileged && !arg_keep_unit)) {
|
||||||
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,6 +5399,7 @@ 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_keep_unit) {
|
||||||
if (arg_privileged)
|
if (arg_privileged)
|
||||||
runtime_bus = sd_bus_ref(system_bus);
|
runtime_bus = sd_bus_ref(system_bus);
|
||||||
else {
|
else {
|
||||||
@ -5413,7 +5414,6 @@ static int run_container(
|
|||||||
runtime_bus = sd_bus_ref(user_bus);
|
runtime_bus = sd_bus_ref(user_bus);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!arg_keep_unit) {
|
|
||||||
/* 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. */
|
||||||
|
|||||||
@ -81,11 +81,9 @@ 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, ":");
|
||||||
if (!l)
|
else
|
||||||
return -ENOMEM;
|
|
||||||
} else {
|
|
||||||
l = strv_new("btrfs",
|
l = strv_new("btrfs",
|
||||||
"erofs",
|
"erofs",
|
||||||
"ext4",
|
"ext4",
|
||||||
@ -95,10 +93,8 @@ static int allowed_fstypes(char ***ret_strv) {
|
|||||||
"xfs");
|
"xfs");
|
||||||
if (!l)
|
if (!l)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
*ret_strv = TAKE_PTR(l);
|
*ret_strv = TAKE_PTR(l);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -133,13 +133,6 @@ 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;
|
||||||
|
|
||||||
@ -153,6 +146,13 @@ 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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user