"systemctl status" 출력에서 ​​"log" 섹션 숨기기

"systemctl status" 출력에서 ​​"log" 섹션 숨기기

데모의 경우 이를 사용하여 systemctl status인간 친화적인 형식으로 서비스 상태를 표시하고 로그 부분을 숨기고 싶습니다.

### I Want that ####################################

root@bulbizarre:/home/sylvain# systemctl status ssh.service
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enab
   Active: active (running) since Tue 2018-10-09 10:51:59 CEST; 3 days ago
  Process: 1735 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCES
  Process: 1729 ExecReload=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
  Process: 1194 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 1240 (sshd)
    Tasks: 1 (limit: 4915)
   Memory: 1.9M
      CPU: 80ms
   CGroup: /system.slice/ssh.service
           └─1240 /usr/sbin/sshd -D

### But not that ####################################

Oct 09 10:52:26 bulbizarre systemd[1]: Reloaded OpenBSD Secure Shell server.
Oct 09 10:52:26 bulbizarre sshd[1240]: Server listening on 0.0.0.0 port 22.
Oct 09 10:52:26 bulbizarre sshd[1240]: Server listening on :: port 22.
Oct 09 13:57:52 bulbizarre sshd[6966]: pam_unix(sshd:auth): authentication failu
Oct 09 13:57:52 bulbizarre sshd[6966]: pam_ldap(sshd:auth): Authentication failu
Oct 09 13:57:54 bulbizarre sshd[6966]: Failed password for sylvain from 10.129.3
Oct 09 13:57:57 bulbizarre sshd[6966]: pam_ldap(sshd:auth): Authentication failu
Oct 09 13:58:00 bulbizarre sshd[6966]: Failed password for sylvain from 10.129.3
Oct 09 13:58:02 bulbizarre sshd[6966]: Accepted password for sylvain from 10.129
Oct 09 13:58:02 bulbizarre sshd[6966]: pam_unix(sshd:session): session opened fo

숨겨진 옵션이 있나요? 나는 이 -o옵션을 알고 있지만, 내가 아는 한 "빈" 형식은 없습니다.

답변1

내가 얼마나 어리석었나! 이 질문을 던진 후 영감을 받아 다음과 같이 시도해 보았습니다.

systemctl --lines 0 status ssh.service
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-10-09 10:51:59 CEST; 3 days ago
  Process: 1735 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
  Process: 1729 ExecReload=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
  Process: 1194 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 1240 (sshd)
    Tasks: 1 (limit: 4915)
   Memory: 1.9M
      CPU: 80ms
   CGroup: /system.slice/ssh.service
           └─1240 /usr/sbin/sshd -D
   -n, --lines=
       When used with status, controls the number of journal lines to show, counting from the
       most recent ones. Takes a positive integer argument. Defaults to 10.

이것이 이런 식으로 작동해야 하는지 여부 man(n은긍정적인, 포함 여부는 확실하지 않습니다.), --lines=0설정에 관계없이 로그(빈 구분선 포함)를 완전히 삭제합니다.

관련 정보