|
|
系统message日志无故报 systemd: Started Session :) c. U' A3 d* T( B
Oct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
; x% e( |; p5 E* N/ \( ZOct 20 09:10:01 controller2 systemd: Started Session 110 of user root./ c h6 V3 h& h% O) J
Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.( k6 k) D- |/ [' C
Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
$ G" O# g# D8 Y* ]# C/ y! |! m^C
- Q5 _+ L9 m6 C! X! C& Q[root@controller2 ~]#3 A2 q4 s$ ~4 r( g0 U/ Q* F+ V, L
7 c" x4 R0 L5 X0 X+ G8 p, Q
解决办法:添加syslog配置
* `: e$ U0 c' J0 @" o/ E- S[root@controller2 ~]# echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf
- b8 o2 @% ^* H3 F% Y[root@controller2 ~]# ) ^2 c) k, { s: E
[root@controller2 ~]# echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf
4 b. E- X& {2 c2 w% |& h/ D+ @% {4 \# m' }
6 U0 F6 H( |' l2 H/ I5 O0 o; T
[root@controller2 ~]# tail -f /var/log/messages/ k) p+ u$ t9 u" ^4 a, k$ d
Oct 20 08:10:01 controller2 systemd: Started Session 102 of user root.
8 A% _# a/ w8 x9 V9 L4 p8 k. c& ^Oct 20 08:20:01 controller2 systemd: Started Session 103 of user root.& p6 E- b/ _2 }( D) |
Oct 20 08:30:01 controller2 systemd: Started Session 104 of user root.
3 P* c8 K6 s" }6 T# UOct 20 08:40:01 controller2 systemd: Started Session 105 of user root. f& ?" f2 x- w- M
Oct 20 08:50:01 controller2 systemd: Started Session 106 of user root.) b( @* e$ ~. R: q1 Q$ J* M
Oct 20 09:00:01 controller2 systemd: Started Session 107 of user root.2 H' \5 I* d% o% A7 B0 g
Oct 20 09:01:19 controller2 systemd: Started Session 108 of user root." d! W: i: }% J
Oct 20 09:10:01 controller2 systemd: Started Session 110 of user root.
) x, v9 z. x1 a, l ~+ |Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.
8 C" F# g- ~2 l8 COct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
) D. n" ~1 Z E5 z2 t
. A2 n( [4 R/ z+ N! Z; F' \: {2 I
1 U: c: o9 \2 i6 H$ g3 C/ b重启syslog" S" I$ T; W# }3 q
^C
3 o$ g' K* p* a A3 m. s H[root@controller2 ~]# systemctl restart rsyslog% T3 q! E" P. ^$ i
6 f0 f7 `) B- @, ]: `8 G
1 A- g+ c7 d! z! X" I: a! v0 C[root@controller2 ~]# tail -f /var/log/messages
9 U9 _ W/ Y8 ?/ x0 J4 eOct 20 09:01:19 controller2 systemd: Started Session 108 of user root." u2 R# h- K' |5 V" {. u
Oct 20 09:10:01 controller2 systemd: Started Session 110 of user root.+ S0 s" x: }3 ~
Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.
h4 @( C% O0 k8 q3 ^, r0 W8 _Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.' `/ C, K- W# h* r* A; N3 g
Oct 20 09:15:11 controller2 systemd: Stopping System Logging Service...
2 x$ m. \2 f* W. E/ A: t7 }Oct 20 09:15:11 controller2 rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-55.el7" x-pid="1072" x-info="http://www.rsyslog.com"] exiting on signal 15.
/ g5 Y. y- _! C: oOct 20 09:15:11 controller2 systemd: Stopped System Logging Service. x5 j7 r( `; e u
Oct 20 09:15:11 controller2 systemd: Starting System Logging Service...5 V% N4 r7 |7 ?5 O6 U/ M: f
Oct 20 09:15:11 controller2 rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-55.el7" x-pid="221370" x-info="http://www.rsyslog.com"] start: c6 H0 b. ^ s* H
Oct 20 09:15:11 controller2 systemd: Started System Logging Service.) l8 l! j. n! \9 ]) D
" d* i7 f7 z) D, T2 _4 V- C) }暂未报错:
9 J7 ^1 n' X- v" {& h |
|