Linux 명령어 완벽 정리: systemd 서비스 관리 관련 명령어 핵심 10선
2025. 7. 28. 11:07ㆍ리눅스
728x90
🐧 리눅스 필수 systemd 서비스 관리 명령어 정리
리눅스를 처음 배우는 분들을 위해 꼭 알아야 할 systemd 서비스 관리 관련 명령어를 설명과 예제 중심으로 정리했습니다.
🛠️ systemd 서비스 관리 명령어 요약표
| 명령어 | 설명 | 예시 |
|---|---|---|
systemctl start [서비스명] |
서비스 시작 | systemctl start nginx |
systemctl stop [서비스명] |
서비스 중지 | systemctl stop nginx |
systemctl restart [서비스명] |
서비스 재시작 | systemctl restart nginx |
systemctl reload [서비스명] |
설정만 다시 불러오기 (중단 없이) | systemctl reload nginx |
systemctl status [서비스명] |
서비스 상태 확인 | systemctl status nginx |
systemctl enable [서비스명] |
부팅 시 자동 시작 설정 | systemctl enable nginx |
systemctl disable [서비스명] |
부팅 시 자동 시작 해제 | systemctl disable nginx |
systemctl is-active [서비스명] |
서비스 실행 중 여부 확인 | systemctl is-active nginx |
journalctl -u [서비스명] |
서비스 로그 확인 | journalctl -u nginx |
systemctl list-units --type=service |
실행 중인 서비스 목록 출력 | systemctl list-units --type=service |
▶️ 전체 실습 순서
# nginx 서비스 실습 예제
# 1. nginx 시작
sudo systemctl start nginx
# 2. 서비스 상태 확인
sudo systemctl status nginx
# 3. 서비스 재시작
sudo systemctl restart nginx
# 4. 설정만 재적용 (중단 없이)
sudo systemctl reload nginx
# 5. 부팅 시 자동 시작 설정
sudo systemctl enable nginx
# 6. 로그 확인
sudo journalctl -u nginx
# 7. 자동 시작 해제
sudo systemctl disable nginx
# 8. 서비스가 실행 중인지 확인
systemctl is-active nginx
# 9. 실행 중인 서비스 목록 보기
systemctl list-units --type=service
# 10. 서비스 중지
sudo systemctl stop nginx
📌 참고: systemctl은 systemd 기반 시스템(Ubuntu 16.04+, CentOS 7+, Debian 8+)에서 사용됩니다.
👍 도움이 되셨다면 댓글이나 공감 부탁드립니다!
728x90
'리눅스' 카테고리의 다른 글
| Linux 명령어 완벽 정리: 사용자 및 퍼미션 관리 관련 명령어 핵심 13선 (1) | 2025.07.28 |
|---|---|
| Linux 명령어 완벽 정리: 패키지 설치 관련 명령어 핵심 5선 (1) | 2025.07.28 |
| Linux 명령어 완벽 정리: 네트워크 관련 명령어 핵심 8선 (0) | 2025.07.27 |
| Linux 명령어 완벽 정리: 시스템 모니터링 핵심 6선 (2) | 2025.07.25 |
| Linux 명령어 완벽 정리: 파일 및 디렉토리 관리 핵심 9선 (3) | 2025.07.25 |