mirror of
https://github.com/systemd/systemd
synced 2025-11-21 09:44:44 +01:00
Compare commits
9 Commits
1353564b9d
...
606a08b1b5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
606a08b1b5 | ||
|
|
67111e1bd9 | ||
|
|
575087d68b | ||
|
|
01c6565548 | ||
|
|
39305cf974 | ||
|
|
a5592a2e00 | ||
|
|
5f7e04dd35 | ||
|
|
3dbb2fa239 | ||
|
|
60e1c11dc8 |
@ -81,7 +81,7 @@
|
||||
factory reset operation is by starting the <filename>factory-reset.target</filename>
|
||||
unit.</para>
|
||||
|
||||
<para>This sets the <varname>FactoryResetRequested</varname> EFI variable, see below.</para>
|
||||
<para>This sets the <varname>FactoryResetRequest</varname> EFI variable, see below.</para>
|
||||
|
||||
<para>This operation is executed when the <filename>systemd-factory-reset-request.service</filename>
|
||||
unit is started (which is typically one of the services hooked into
|
||||
|
||||
@ -563,7 +563,7 @@ CPUWeight=20 DisableControllers=cpu / \
|
||||
an absolute number of tasks or a percentage value that is taken relative to the configured maximum
|
||||
number of tasks on the system. If assigned the special value <literal>infinity</literal>, no tasks
|
||||
limit is applied. This controls the <literal>pids.max</literal> control group attribute. For
|
||||
details about this control group attribute, the
|
||||
details about this control group attribute, see the
|
||||
<ulink url="https://docs.kernel.org/admin-guide/cgroup-v2.html#pid">pids controller
|
||||
</ulink>.
|
||||
The effective configuration is reported as <varname>EffectiveTasksMax=</varname>.</para>
|
||||
|
||||
@ -167,6 +167,7 @@ static int unmute_pid1(Context *c) {
|
||||
assert(c);
|
||||
|
||||
if (!c->muted_pid1) {
|
||||
if (c->mute_pid1)
|
||||
log_debug("Not restoring PID 1 status console output level.");
|
||||
return 0;
|
||||
}
|
||||
@ -185,14 +186,16 @@ static int mute_kernel(Context *c) {
|
||||
|
||||
assert(c);
|
||||
|
||||
if (!arg_mute_kernel) {
|
||||
if (!c->mute_kernel) {
|
||||
log_debug("Muting of kernel printk() console output disabled.");
|
||||
c->saved_kernel = -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (detect_container() > 0) {
|
||||
log_debug("Skipping muting of print() console output, because running in a container.");
|
||||
log_debug("Skipping muting of printk() console output, because running in a container.");
|
||||
|
||||
c->mute_kernel = false;
|
||||
c->saved_kernel = -1;
|
||||
return 0;
|
||||
}
|
||||
@ -222,6 +225,7 @@ static int unmute_kernel(Context *c) {
|
||||
assert(c);
|
||||
|
||||
if (c->saved_kernel < 0) {
|
||||
if (c->mute_kernel)
|
||||
log_debug("Not restoring kernel printk() console output level.");
|
||||
return 0;
|
||||
}
|
||||
@ -244,28 +248,6 @@ static int unmute_kernel(Context *c) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void context_done(Context *c) {
|
||||
assert(c);
|
||||
|
||||
(void) unmute_pid1(c);
|
||||
(void) unmute_kernel(c);
|
||||
|
||||
if (c->link) {
|
||||
(void) sd_varlink_set_userdata(c->link, NULL);
|
||||
c->link = sd_varlink_flush_close_unref(c->link);
|
||||
}
|
||||
}
|
||||
|
||||
static Context* context_free(Context *c) {
|
||||
if (!c)
|
||||
return NULL;
|
||||
|
||||
context_done(c);
|
||||
return mfree(c);
|
||||
}
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Context*, context_free);
|
||||
|
||||
static void vl_on_disconnect(sd_varlink_server *server, sd_varlink *link, void *userdata) {
|
||||
assert(link);
|
||||
|
||||
@ -273,7 +255,13 @@ static void vl_on_disconnect(sd_varlink_server *server, sd_varlink *link, void *
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
context_free(c);
|
||||
(void) unmute_pid1(c);
|
||||
(void) unmute_kernel(c);
|
||||
|
||||
(void) sd_varlink_set_userdata(c->link, NULL);
|
||||
sd_varlink_flush_close_unref(c->link);
|
||||
|
||||
free(c);
|
||||
}
|
||||
|
||||
static int vl_method_mute(
|
||||
@ -286,7 +274,7 @@ static int vl_method_mute(
|
||||
|
||||
assert(link);
|
||||
|
||||
_cleanup_(context_freep) Context *nc = new(Context, 1);
|
||||
_cleanup_free_ Context *nc = new(Context, 1);
|
||||
if (!nc)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -380,7 +368,7 @@ static int run(int argc, char* argv[]) {
|
||||
if (!arg_mute_pid1 && !arg_mute_kernel)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Not asked to mute anything, refusing.");
|
||||
|
||||
_cleanup_(context_done) Context c = {
|
||||
Context c = {
|
||||
.mute_pid1 = arg_mute_pid1,
|
||||
.mute_kernel = arg_mute_kernel,
|
||||
.saved_kernel = -1,
|
||||
@ -398,7 +386,7 @@ static int run(int argc, char* argv[]) {
|
||||
RET_GATHER(ret, mute_pid1(&c));
|
||||
RET_GATHER(ret, mute_kernel(&c));
|
||||
|
||||
/* Now tell service manager we area ready to go */
|
||||
/* Now tell service manager we are ready to go */
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_message =
|
||||
notify_start("READY=1\n"
|
||||
"STATUS=Console status output muted temporarily.",
|
||||
|
||||
@ -10,9 +10,6 @@
|
||||
[Unit]
|
||||
Description=Console Output Muting Service Slice
|
||||
Documentation=man:systemd-mute-console(8)
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Before=shutdown.target
|
||||
|
||||
[Slice]
|
||||
# Serialize requests to mute the console.
|
||||
|
||||
@ -19,3 +19,4 @@ ListenStream=/run/systemd/io.systemd.BootControl
|
||||
FileDescriptorName=varlink
|
||||
SocketMode=0600
|
||||
Accept=yes
|
||||
MaxConnectionsPerSource=16
|
||||
|
||||
@ -20,3 +20,4 @@ ListenStream=/run/systemd/io.systemd.MuteConsole
|
||||
FileDescriptorName=varlink
|
||||
SocketMode=0600
|
||||
Accept=yes
|
||||
MaxConnectionsPerSource=16
|
||||
|
||||
@ -20,6 +20,7 @@ ListenStream=/run/systemd/io.systemd.PCRLock
|
||||
FileDescriptorName=varlink
|
||||
SocketMode=0600
|
||||
Accept=yes
|
||||
MaxConnectionsPerSource=16
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
|
||||
@ -20,3 +20,4 @@ ListenStream=/run/systemd/io.systemd.Repart
|
||||
FileDescriptorName=varlink
|
||||
SocketMode=0600
|
||||
Accept=yes
|
||||
MaxConnectionsPerSource=16
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user