- 积分
- 16843
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
系统message日志无故报 systemd: Started Session :+ a: f9 ]3 ^/ }- v8 r4 M
Oct 20 09:01:19 controller2 systemd: Started Session 108 of user root.; c; d. _# |: U, k9 e9 f% `! P
Oct 20 09:10:01 controller2 systemd: Started Session 110 of user root.
, ^# k0 Z( L/ v) _3 \ ^% AOct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.
3 D: R3 s& M5 }1 \( rOct 20 09:12:29 controller2 systemd: Started Session 111 of user root.1 O5 z, |/ c& _: a k
^C
) ~) b' x$ B( @5 |$ L! p6 N[root@controller2 ~]#
; w( n2 h7 W3 ]
5 W; O8 z! ~3 M! y) b解决办法:添加syslog配置 7 x$ s9 M7 m8 c& {6 ?/ X3 c3 Q/ W
[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
( M k' g7 E% N0 \1 _2 ]2 e- |9 z[root@controller2 ~]# 0 x& o6 }, Q, R( f! ] N
[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
9 n/ S0 O8 e t, Z. ]1 |
& K2 e2 H' J5 d5 w1 M. g3 e5 R' i4 y% X* n
[root@controller2 ~]# tail -f /var/log/messages
& ?6 m& c* M& i9 ?Oct 20 08:10:01 controller2 systemd: Started Session 102 of user root. f% J$ b K- o. ?) ~1 H5 s( D
Oct 20 08:20:01 controller2 systemd: Started Session 103 of user root.
# R9 k. d" ^: ]) F# I$ G& |* K( U4 qOct 20 08:30:01 controller2 systemd: Started Session 104 of user root.
" B0 {8 h0 K! S1 f2 o+ f& oOct 20 08:40:01 controller2 systemd: Started Session 105 of user root.
& s. b& v) s- y0 cOct 20 08:50:01 controller2 systemd: Started Session 106 of user root.
: X6 P& [; X6 @* OOct 20 09:00:01 controller2 systemd: Started Session 107 of user root.
4 j9 s) _; C5 @# x& {5 r; a' cOct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
n5 K* |5 o' _# C4 {9 OOct 20 09:10:01 controller2 systemd: Started Session 110 of user root.& `. \9 t( U! ~4 D3 T3 B0 y
Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.$ R: W8 K8 c3 j2 U
Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.7 j$ }+ Z C E: [
8 j+ U8 r! S0 |& A& [
7 Q5 }6 k4 U% [% w& s
重启syslog% O% Y, p3 p( k6 h1 k6 x
^C, v+ L9 l+ C+ v4 H) y% @
[root@controller2 ~]# systemctl restart rsyslog
' C: x, S( G& C# q. Q; h
; L) M2 M1 d+ V9 L5 Z/ t" P4 p0 I7 S0 x5 B. U5 _) h1 T
[root@controller2 ~]# tail -f /var/log/messages
) a1 W1 y2 i. _1 J9 xOct 20 09:01:19 controller2 systemd: Started Session 108 of user root.
2 o, H' l) s1 G5 FOct 20 09:10:01 controller2 systemd: Started Session 110 of user root.1 f! x" ]* U3 A
Oct 20 09:12:29 controller2 systemd-logind: New session 111 of user root.
1 u0 P, A* f# x' N6 }Oct 20 09:12:29 controller2 systemd: Started Session 111 of user root.* p: | w2 U, e4 I8 S
Oct 20 09:15:11 controller2 systemd: Stopping System Logging Service...
7 Z' R# G/ K3 L/ F a/ gOct 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.0 D3 ?6 |5 h, T$ e j/ o* E
Oct 20 09:15:11 controller2 systemd: Stopped System Logging Service.+ V+ o, K: p2 y4 l) H; p* H
Oct 20 09:15:11 controller2 systemd: Starting System Logging Service...) C8 Q# H& [' `0 z* Z% i& Z) _ Q
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
Q+ F- l; |' E. \4 d# zOct 20 09:15:11 controller2 systemd: Started System Logging Service.
& ]3 [9 k6 O- g% X* P% k3 H; q) w
q3 {+ f1 F l! ~$ v0 p1 K8 s! U暂未报错:
* F0 y! ?; g) P1 A# j8 g |
|