-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
Currently kde installs a fake utmp session to listen for this. This provides an alternative mechanism as discussed in #23574. Example with 'shutdown 6 -r' and shutdown -c': PRIORITY=6 SYSLOG_FACILITY=4 SYSLOG_IDENTIFIER=systemd-logind ... CODE_FILE=src/login/logind-utmp.c CODE_LINE=90 CODE_FUNC=warn_wall MESSAGE_ID=9e7066279dc8403da79ce4b1a69064b2 OPERATOR=root MESSAGE=The system will reboot at Thu 2022-06-30 12:16:43 CEST! ACTION=reboot PRIORITY=5 SYSLOG_FACILITY=4 SYSLOG_IDENTIFIER=systemd-logind ... OPERATOR=root CODE_FILE=src/login/logind-dbus.c CODE_LINE=2407 CODE_FUNC=method_cancel_scheduled_shutdown MESSAGE=System shutdown has been cancelled MESSAGE_ID=249f6fb9e6e2428c96f3f0875681ffa3 ACTION=reboot
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2347,7 +2347,6 @@ static int method_cancel_scheduled_shutdown(sd_bus_message *message, void *userd | |
|
||
if (m->enable_wall_messages) { | ||
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL; | ||
_cleanup_free_ char *username = NULL; | ||
const char *tty = NULL; | ||
uid_t uid = 0; | ||
|
||
|
@@ -2357,7 +2356,14 @@ static int method_cancel_scheduled_shutdown(sd_bus_message *message, void *userd | |
(void) sd_bus_creds_get_tty(creds, &tty); | ||
} | ||
|
||
username = uid_to_name(uid); | ||
_cleanup_free_ char *username = uid_to_name(uid); | ||
|
||
log_struct(LOG_INFO, | ||
LOG_MESSAGE("System shutdown has been cancelled"), | ||
"ACTION=%s", handle_action_to_string(a->handle), | ||
"MESSAGE_ID=" SD_MESSAGE_LOGIND_SHUTDOWN_CANCELED_STR, | ||
username ? "OPERATOR=%s" : NULL, username); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
keszybz
Author
Member
|
||
|
||
utmp_wall("System shutdown has been cancelled", | ||
username, tty, logind_wall_tty_filter, m); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,6 +203,14 @@ _SD_BEGIN_DECLARATIONS; | |
#define SD_MESSAGE_TIME_SYNC SD_ID128_MAKE(7c,8a,41,f3,7b,76,49,41,a0,e1,78,0b,1b,e2,f0,37) | ||
#define SD_MESSAGE_TIME_SYNC_STR SD_ID128_MAKE_STR(7c,8a,41,f3,7b,76,49,41,a0,e1,78,0b,1b,e2,f0,37) | ||
|
||
#define SD_MESSAGE_LOGIND_SHUTDOWN SD_ID128_MAKE(9e,70,66,27,9d,c8,40,3d,a7,9c,e4,b1,a6,90,64,b2) | ||
This comment has been minimized.
Sorry, something went wrong.
poettering
Member
|
||
#define SD_MESSAGE_LOGIND_SHUTDOWN_STR SD_ID128_MAKE_STR(9e,70,66,27,9d,c8,40,3d,a7,9c,e4,b1,a6,90,64,b2) | ||
|
||
#define SD_MESSAGE_LOGIND_SHUTDOWN_CANCELED \ | ||
SD_ID128_MAKE(24,9f,6f,b9,e6,e2,42,8c,96,f3,f0,87,56,81,ff,a3) | ||
#define SD_MESSAGE_LOGIND_SHUTDOWN_CANCELED_STR \ | ||
SD_ID128_MAKE_STR(24,9f,6f,b9,e6,e2,42,8c,96,f3,f0,87,56,81,ff,a3) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
This comment has been minimized.
Sorry, something went wrong. |
||
_SD_END_DECLARATIONS; | ||
|
||
#endif |
"operator"? that's a new word we haven't used so far?
maybe
REQUESTED_BY_USER=
?