Compare commits

...

2 Commits

Author SHA1 Message Date
David Härdeman 6e5a07b1e5
Merge 5aca393303 into c946b13575 2024-11-23 02:41:21 +08: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
5 changed files with 18 additions and 1 deletions

View File

@ -409,6 +409,21 @@
<xi:include href="version-info.xml" xpointer="v257"/></listitem>
</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>
</refsect1>

View File

@ -39,6 +39,7 @@ void manager_reset_config(Manager *m) {
m->remove_ipc = true;
m->inhibit_delay_max = 5 * 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;

View File

@ -54,3 +54,4 @@ Login.SessionsMax, config_parse_uint64, 0, offse
Login.DesignatedMaintenanceTime, config_parse_calendar, 0, offsetof(Manager, maintenance_time)
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.EnableWallMessages, config_parse_bool, 0, offsetof(Manager, enable_wall_messages)

View File

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

View File

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