]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: allow wall messages to be controlled via config file
authorDavid Härdeman <david@hardeman.nu>
Thu, 21 Nov 2024 19:24:06 +0000 (20:24 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 14 Dec 2024 01:54:58 +0000 (10:54 +0900)
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.

man/logind.conf.xml
src/login/logind-core.c
src/login/logind-gperf.gperf
src/login/logind.c
src/login/logind.conf.in

index 66240b58fe867494506c3a6d261dcfb27894732f..da41d56e7fab310fbbe6cbd92494609b34260263 100644 (file)
 
         <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>
 
index a1c0069f6914b53e73f9da1affe4d7baa02f000b..719aeef0175c91890b2ba99bb0c5857a5facb943 100644 (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;
 
index ce5af2ccfa7bf558a485af7d7f014602f924bedf..e7f39fed2a9dd7bb2c0a6cdbbb230c4942603590 100644 (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)
index 8dc1781edffc9053fb1f38f4fffbd5e13670c527..186778677b674067e1a116be7570ef526734da91 100644 (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,
 
index 2e06b9a050199c58878b69948934b12b52bafbc9..8adf4393c7e8541c281538d89e85cb68dbf1a941 100644 (file)
@@ -52,3 +52,4 @@
 #SessionsMax=8192
 #StopIdleSessionSec=infinity
 #DesignatedMaintenanceTime=
+#EnableWallMessages=yes