|
|
系统message日志无故报 systemd: Started Session :
9 X1 p | `1 Z7 ~% {- ?- B) kOct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
; U; C- E( k9 EOct 20 09:10:01 controller2 systemd: Started Session 110 of user root.6 W2 C2 n& m& s, m: u% E7 Q
Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.0 _' S* W; _- x
Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
8 ?8 I! O' f: E4 d" r6 t^C
. y" p1 f# S* S, w$ f5 O: k8 g[root@controller2 ~]#
, c& }! z& X) n" u" C& t
- x* i( S2 G* J9 ?3 V) s! F解决办法:添加syslog配置
I1 R% A% C# c0 S- b) z[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
* r, k: G3 D# j; D! P( u! `$ F, ^% {[root@controller2 ~]# 9 a. O+ x/ m$ ?; k
[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( @0 R% X6 x; |) {! Y. n# t V
2 Z) \1 |: D% }; G. }& k8 L' y
6 i: x6 v1 A3 g8 z' X+ E# P" C
[root@controller2 ~]# tail -f /var/log/messages! m$ q& a! L1 X# z
Oct 20 08:10:01 controller2 systemd: Started Session 102 of user root.; `! C& o! C! L: s: {/ s0 {
Oct 20 08:20:01 controller2 systemd: Started Session 103 of user root. K* _6 C T9 k- W' v
Oct 20 08:30:01 controller2 systemd: Started Session 104 of user root.
% o6 J0 w/ r! @) b' MOct 20 08:40:01 controller2 systemd: Started Session 105 of user root.' G3 Z4 C3 K' v$ X7 ^! W1 C
Oct 20 08:50:01 controller2 systemd: Started Session 106 of user root.
) h4 Y' L E3 V$ d2 C7 X, Y8 JOct 20 09:00:01 controller2 systemd: Started Session 107 of user root.
5 L5 V# F& z3 w4 R, e& pOct 20 09:01:19 controller2 systemd: Started Session 108 of user root.% E7 }& `9 ]* v. q+ ?
Oct 20 09:10:01 controller2 systemd: Started Session 110 of user root.
3 A9 T9 A7 \4 [, h% COct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.2 b, W6 I- @ k; J# k# }0 u6 e- \
Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
' L8 h& y |- g1 h
5 ~1 }0 u3 }" @) s3 k# ]9 W
* R# P+ D8 I5 o8 _2 V重启syslog3 P `) ~$ G! p8 j
^C
2 p9 o0 _. Z# t. C[root@controller2 ~]# systemctl restart rsyslog0 n# z- N! X5 Z4 a
@8 G+ ?) g* [4 o' m. ^9 B
+ v: F/ m. ~. c
[root@controller2 ~]# tail -f /var/log/messages j* S; l& l% H7 U- t* K6 s
Oct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
) n% j' W+ X+ d2 COct 20 09:10:01 controller2 systemd: Started Session 110 of user root.
* o6 E- n$ W2 s- Z y% I# }$ K7 jOct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.( I! O4 j }5 x" `
Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.
% Y# g" Y1 X* D, l" b7 pOct 20 09:15:11 controller2 systemd: Stopping System Logging Service...; }1 }; S; B6 c' S M5 k" u
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.% u* f: R' g/ M. ?" x# C3 v0 S1 r
Oct 20 09:15:11 controller2 systemd: Stopped System Logging Service.
' s, V, d. A5 @# U# TOct 20 09:15:11 controller2 systemd: Starting System Logging Service...
$ T: \/ G7 S' q# dOct 20 09:15:11 controller2 rsyslogd: [origin software="rsyslogd" swVersion="8.24.0-55.el7" x-pid="221370" x-info="http://www.rsyslog.com"] start7 z: }9 w, J. k1 j- ~& t( l0 t
Oct 20 09:15:11 controller2 systemd: Started System Logging Service.
+ U; }1 s! s' q( ~
! H- _! z9 w$ z5 u' s" P/ l& T7 s$ @3 V- B暂未报错:
1 O$ ?( P) `2 t# c. ]% {1 n2 } |
|