1. systemctl 이란?
- systemctl은 시스템 관련 서비스를 제어하는 명령어
- 서비스 관리: 서비스 시작, 중지, 재시작, 상태 확인
- 타이머 관리: 예약 작업 및 실행 주기 관리
- 부팅 프로세스 관리: 부팅 시 실행할 서비스 설정
- 유닛 파일 관리: 유닛 파일 활성화/비활성화
- 전원 관리: 시스템 종료, 재부팅, 절전 모드 등
2. 유닛(Unit)
- systemctl이 관리하는 모든 항목
- 유닛은 특정 작업이나 서비스를 나타내며, 종류에 따라 파일 확장자가 다름
Service | .service | 서비스 유닛 (예: 웹 서버, 데이터베이스 등) |
Socket | .socket | 네트워크 소켓 유닛 |
Timer | .timer | 타이머 유닛 (예약 작업) |
Target | .target | 부팅 및 런레벨 설정 유닛 |
Device | .device | 디바이스 유닛 |
Mount | .mount | 파일 시스템 마운트 유닛 |
Swap | .swap | 스왑 공간 관리 유닛 |
Path | .path | 파일 또는 디렉토리 상태 감시 유닛 |
3. systemctl 명령어 사용법
서비스 관리 명령어
systemctl start <service> | 지정한 서비스 시작 |
systemctl stop <service> | 지정한 서비스 중지 |
systemctl restart <service> | 지정한 서비스 재시작 |
systemctl reload <service> | 구성 파일을 다시 로드 (서비스 중단 없음) |
systemctl status <service> | 서비스 상태 확인 |
systemctl enable <service> | 부팅 시 서비스가 자동 시작되도록 설정 |
systemctl disable <service> | 부팅 시 서비스가 시작되지 않도록 설정 |
systemctl is-enabled <service> | 서비스의 자동 시작 설정 여부 확인 |
systemctl mask <service> | 서비스를 비활성화(실행 불가) |
systemctl unmask <service> | 비활성화된 서비스를 다시 활성화 |
전체 시스템 관련 명령어
systemctl reboot | 시스템 재부팅 |
systemctl poweroff | 시스템 종료 |
systemctl suspend | 시스템 절전 모드로 전환 |
systemctl hibernate | 시스템 최대 절전 모드로 전환 |
systemctl halt | 시스템의 모든 작업 중단 |
systemctl isolate <target> | 특정 target으로 전환 (예: multi-user.target) |
유닛(Unit) 상태 관리 명령어
systemctl list-units | 활성화된 모든 유닛 나열 |
systemctl list-units --type=service | 활성화된 서비스 유닛 나열 |
systemctl list-timers | 활성화된 타이머 유닛 나열 |
systemctl show <unit> | 지정한 유닛의 상세 정보 표시 |
systemctl cat <unit> | 유닛 파일의 내용 확인 |
유닛 파일 관리
systemctl edit <unit> | 유닛 파일을 수정하거나 덮어쓰기 |
systemctl daemon-reload | 유닛 파일 변경 후 systemd 다시 로드 |
systemctl reset-failed | 실패한 유닛 상태 초기화 |
'Linux > centOS' 카테고리의 다른 글
[CENTOS] top Command (0) | 2024.12.23 |
---|---|
[CENTOS] ps Command (0) | 2024.12.23 |
[CENTOS] Task (0) | 2024.12.23 |
[CENTOS] Vim (0) | 2024.12.21 |
[CENTOS] Command, Pipes (0) | 2024.12.19 |