|
|
系统message日志无故报 systemd: Started Session :
8 D: j7 T8 N- o" \Oct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
8 ?+ r R& p2 R% p4 D3 K% hOct 20 09:10:01 controller2 systemd: Started Session 110 of user root.
9 m) r$ h9 T# m% P/ r3 g' JOct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.
6 ^$ F% x- Y8 M% N; ]9 x7 JOct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
; s5 J# C2 u2 R. z6 [' D8 W. ~^C
9 }, m& h" z( {! T[root@controller2 ~]#& P( F9 z! O$ G) O5 z: z7 Q
& G% Z4 B6 E: v: ^
解决办法:添加syslog配置 $ `" Y3 ?0 O: ~) |8 S( S, f
[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 q+ p: o$ x4 M! g1 j& r
[root@controller2 ~]# 5 j5 D2 U9 J% V/ y! E6 G
[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
+ y. V; O7 ]+ H* b- T: [5 R
" p4 Y& y5 i/ M ^5 C9 H! d7 _
- r$ y1 b4 N! \( w8 C5 A[root@controller2 ~]# tail -f /var/log/messages
; B8 c% \0 L8 ^Oct 20 08:10:01 controller2 systemd: Started Session 102 of user root.' J j. d! }+ \
Oct 20 08:20:01 controller2 systemd: Started Session 103 of user root.+ [7 M, k( E! ?: D& }
Oct 20 08:30:01 controller2 systemd: Started Session 104 of user root.
; I! @8 C# @$ SOct 20 08:40:01 controller2 systemd: Started Session 105 of user root.8 o6 U8 u" Z6 M
Oct 20 08:50:01 controller2 systemd: Started Session 106 of user root.+ ^: Q8 n' |$ t1 G
Oct 20 09:00:01 controller2 systemd: Started Session 107 of user root.
. m' d, G1 `2 |4 J1 b, vOct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
- u) P0 |' x1 k& i7 Y- z: |- rOct 20 09:10:01 controller2 systemd: Started Session 110 of user root.
! f: \2 K5 G4 ]+ W2 s0 j; \" oOct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.
& q _1 r6 b) D5 XOct 20 09:12:29 controller2 systemd: Started Session 111 of user root." x' k8 b1 N* O4 l, I4 o% Z3 v, O* }
" E. x! }, l: a0 A; }, T( L$ s! C' T' A
重启syslog
: r9 a" [" U: ?^C2 M* n0 e7 F0 i5 A5 x7 u2 m/ V
[root@controller2 ~]# systemctl restart rsyslog: w+ n5 r3 W' Y7 } B' F
- q8 ^4 _1 Z' }: m* j9 A0 E) Y8 y* Y1 @. t! ~/ T
[root@controller2 ~]# tail -f /var/log/messages
! r! `1 i Z% U' q0 Y# N4 i: dOct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
5 ?* v# F' W" y0 F+ @! B( gOct 20 09:10:01 controller2 systemd: Started Session 110 of user root.) K8 {5 V6 W7 u8 u
Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.# z3 { i7 J- `; L5 N9 w9 _+ j' ~
Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
" e s5 u* F: T/ L3 q+ V$ o2 `Oct 20 09:15:11 controller2 systemd: Stopping System Logging Service...
0 Y; A- V/ g* H8 @- D7 \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.
1 K$ v7 a4 Q5 \# c3 n! FOct 20 09:15:11 controller2 systemd: Stopped System Logging Service.7 ^( k v% R$ J: e7 s
Oct 20 09:15:11 controller2 systemd: Starting System Logging Service...6 ^9 c J7 c! s, _
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"] start4 r- I8 f" J. w
Oct 20 09:15:11 controller2 systemd: Started System Logging Service.
. m3 B# e0 U% G4 _% p
5 h! q/ ^9 H; W% N% L1 i. `6 k暂未报错:
/ T; ] M, W6 b+ E% b* i |
|