>  기사  >  운영 및 유지보수  >  Linux의 systemctl 명령에 대한 자세한 소개

Linux의 systemctl 명령에 대한 자세한 소개

小云云
小云云원래의
2018-03-05 09:52:382850검색

Linux Systemctl은 System V, service 및 chkconfig 명령을 대체하는 데 사용되는 시스템 관리 데몬, 도구 및 라이브러리 모음입니다. 초기 프로세스는 주로 systemd 시스템 및 서비스 관리자를 제어하는 ​​역할을 합니다. Systemctl –help를 보면 명령이 크게 systemd 서비스에 대한 제어 명령 쿼리 또는 전송, 관리 단위 서비스에 대한 명령, 서비스 파일 관련 명령, 작업, 환경, 스냅샷 관련 명령, 구성 재로드로 나누어져 있음을 알 수 있다. 시스템 서비스 및 전원 켜기 및 끄기와 관련된 시스템 명령.

1. 사용 가능한 모든 장치 나열


# systemctl list-unit-files

2. 실행 중인 모든 장치 나열


# systemctl list-units

3.
rreee

4. 특정 단위(예: crond.service)가 활성화되어 있는지 확인하세요


# systemctl –failed

5. 모든 서비스를 나열하세요


# systemctl is-enabled crond.service

6. 서비스를 확인하고 서비스(예: httpd.service) 상태를 확인하세요


# systemctl list-unit-files –type=service

참고: systemctl의 시작, 다시 시작, 중지 및 다시 로드 명령을 사용하면 터미널은 아무 것도 출력하지 않고 상태 명령만 인쇄할 수 있습니다.


7. 부팅 시 서비스를 활성화 또는 비활성화하는 방법(예: 시스템 시작 시 자동으로 mysql.service 서비스 시작)


# systemctl start httpd.service
# systemctl restart httpd.service
# systemctl stop httpd.service
# systemctl reload httpd.service
# systemctl status httpd.service

8. 시작) 또는 서비스(예: ntpdate.service)를 표시합니다.

# systemctl is-active mysql.service
# systemctl enable mysql.service
# systemctl disable mysql.service

11. 시스템 마운트 지점을 마운트, 마운트 해제, 다시 마운트하고 다시 로드하고 시스템에서 마운트 지점 상태를 확인하세요



# systemctl mask ntpdate.service
ln -s ‘/dev/null”/etc/systemd/system/ntpdate.service'
# systemctl unmask ntpdate.service
rm ‘/etc/systemd/system/ntpdate.service'

12. 시작 시 마운트 지점을 활성화, 활성화 또는 비활성화합니다. (시스템 시작


# systemctl kill crond

13. Linux


# systemctl list-unit-files –type=mount

14에서 차단(활성화할 수 없도록 설정) 또는 표시되는 마운트 지점. 사용 가능한 모든 시스템 소켓 나열


# systemctl start tmp.mount
# systemctl stop tmp.mount
# systemctl restart tmp.mount
# systemctl reload tmp.mount
# systemctl status tmp.mount

15. 서비스의 모든 구성 세부정보를 확인하세요


# systemctl is-active tmp.mount
# systemctl enable tmp.mount
# systemctl disable tmp.mount

16. 서비스의 종속성 목록을 가져옵니다(httpd)


# systemctl mask tmp.mount
ln -s ‘/dev/null”/etc/systemd/system/tmp.mount'
# systemctl unmask tmp.mount
rm ‘/etc/systemd/system/tmp.mount'

17.

# systemctl list-unit-files –type=socket

18. 비상 모드로 들어갑니다


# systemctl show mysql

19. 현재 사용되는 런레벨


# systemctl list-dependencies httpd.service

20. 레벨 5, 즉 그래픽 모드


# systemctl rescue

또는


# systemctl emergency

21, 즉 다중 사용자 모드(명령줄) 실행을 시작합니다.


# systemctl get-default


# systemctl isolate runlevel5.target

22. 다중 사용자 모드 또는 그래픽 모드를 기본 실행 수준으로 설정하세요



# systemctl isolate graphical.target

23. 시스템을 다시 시작, 중지, 일시 중단하거나 최대 절전 모드로 설정하거나 시스템을 하이브리드 절전 모드로 설정하세요


# systemctl isolate runlevel3.target

런레벨이 무엇인지 모르시는 분들을 위해 설명을 드립니다.

Runlevel 0: 시스템 종료
Runlevel 1: Rescue, 유지 관리 모드

Runlevel 3: 다중 사용자, 그래픽 시스템 없음

Runlevel 4: 다중 사용자, 그래픽 시스템 없음
Runlevel 5: 다중 사용자, 그래픽 시스템

Runlevel 6: 기계를 종료하고 다시 시작


위 내용은 Linux의 systemctl 명령에 대한 자세한 소개의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.