Compare commits

...

3 Commits

Author SHA1 Message Date
David Härdeman 540bdbc6c1
Merge 5aca393303 into 5b2926d941 2024-11-24 06:31:24 +01:00
Yu Watanabe 5b2926d941 curl-util: do not configure new io event source when the event loop is already dead
Similar to c5ecf09494, but for io event source.

Fixes #35322.
2024-11-23 22:49:57 +01:00
David Härdeman 5aca393303 logind: allow wall messages to be controlled via config file
Right now, the sending of wall messages on reboot/shutdown/etc can be
controlled via DBus properties. This patch adds support for changing the
default via the logind.conf file as well.

Note that the DBus setting is lost if logind is restarted or reloaded,
but it was already the case before this patch that the setting is lost
upon restart.
2024-11-22 11:10:15 +01:00
6 changed files with 22 additions and 1 deletions

View File

@ -409,6 +409,21 @@
<xi:include href="version-info.xml" xpointer="v257"/></listitem> <xi:include href="version-info.xml" xpointer="v257"/></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><varname>EnableWallMessages=</varname></term>
<listitem>
<para>
Controls whether
<citerefentry><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>
messages should be sent to the terminals of all currently logged in users upon shutdown or
reboot. Defaults to <literal>yes</literal>, and can be changed at runtime via the DBus
<literal>EnableWallMessages</literal> and <literal>WallMessagePrefix</literal> properties.
</para>
<xi:include href="version-info.xml" xpointer="v258"/></listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@ -75,6 +75,10 @@ static int curl_glue_socket_callback(CURL *curl, curl_socket_t s, int action, vo
return 0; return 0;
} }
/* Don't configure io event source anymore when the event loop is dead already. */
if (g->event && sd_event_get_state(g->event) == SD_EVENT_FINISHED)
return 0;
r = hashmap_ensure_allocated(&g->ios, &trivial_hash_ops); r = hashmap_ensure_allocated(&g->ios, &trivial_hash_ops);
if (r < 0) { if (r < 0) {
log_oom(); log_oom();

View File

@ -39,6 +39,7 @@ void manager_reset_config(Manager *m) {
m->remove_ipc = true; m->remove_ipc = true;
m->inhibit_delay_max = 5 * USEC_PER_SEC; m->inhibit_delay_max = 5 * USEC_PER_SEC;
m->user_stop_delay = 10 * USEC_PER_SEC; m->user_stop_delay = 10 * USEC_PER_SEC;
m->enable_wall_messages = true;
m->handle_action_sleep_mask = HANDLE_ACTION_SLEEP_MASK_DEFAULT; m->handle_action_sleep_mask = HANDLE_ACTION_SLEEP_MASK_DEFAULT;

View File

@ -54,3 +54,4 @@ Login.SessionsMax, config_parse_uint64, 0, offse
Login.DesignatedMaintenanceTime, config_parse_calendar, 0, offsetof(Manager, maintenance_time) Login.DesignatedMaintenanceTime, config_parse_calendar, 0, offsetof(Manager, maintenance_time)
Login.UserTasksMax, config_parse_compat_user_tasks_max, 0, 0 Login.UserTasksMax, config_parse_compat_user_tasks_max, 0, 0
Login.StopIdleSessionSec, config_parse_sec_fix_0, 0, offsetof(Manager, stop_idle_session_usec) Login.StopIdleSessionSec, config_parse_sec_fix_0, 0, offsetof(Manager, stop_idle_session_usec)
Login.EnableWallMessages, config_parse_bool, 0, offsetof(Manager, enable_wall_messages)

View File

@ -64,7 +64,6 @@ static int manager_new(Manager **ret) {
*m = (Manager) { *m = (Manager) {
.console_active_fd = -EBADF, .console_active_fd = -EBADF,
.reserve_vt_fd = -EBADF, .reserve_vt_fd = -EBADF,
.enable_wall_messages = true,
.idle_action_not_before_usec = now(CLOCK_MONOTONIC), .idle_action_not_before_usec = now(CLOCK_MONOTONIC),
.scheduled_shutdown_action = _HANDLE_ACTION_INVALID, .scheduled_shutdown_action = _HANDLE_ACTION_INVALID,

View File

@ -52,3 +52,4 @@
#SessionsMax=8192 #SessionsMax=8192
#StopIdleSessionSec=infinity #StopIdleSessionSec=infinity
#DesignatedMaintenanceTime= #DesignatedMaintenanceTime=
#EnableWallMessages=yes