SlideShare a Scribd company logo
1 of 13
리눅스 Systemd
2021.01.15
클라우드 지원팀
박주형 사원
1. Systemd 소개
2. Systemd 유닛
3. Systemd 사용
4. Q & A
목차
리눅스 Systemd
Systemd 소개
리눅스 Systemd
1
init 프로세스를 대체하여 도입된 PID 1번 프로세스
2010년도에 발표하여 2015년도 부터 본격적으로 도입됐다.
시스템 관리, 로그 관리, 서비스 관리, 초기화 스크립트 관리 등의 역할을 하고 있다.
Systemd의 d는 Daemon을 의미한다.
init프로세스 : 유닉스 기반 컴퓨터 운영 체제에서 부팅 과정 중 최초로 실행되는 프로
세스
Daemon : 리눅스가 처음 가동될때 실행되는 백그라운드 프로세스로 요청이 생기면
반응하는 리스너 같은 역할을 한다.
PID : 프로세스를 구분하기 위한 식별자.
Systemd 소개
리눅스 Systemd
1
 Init프로세스에 대한 호환성 제공 init 스크립트 런레벨과 타겟
 의존성 기반의 서비스 제어 로직 제공
 Systemd 유닛을 통한 시스템 관리
 부팅시 서비스를 병렬로 시작
 시스템 상태 스냅샷 지원
 Cgroup관리
 통합로그 관리
주요 기능과 특징
Systemd 유닛
리눅스 Systemd
2
유닛 파일 종류
유닛 명 확장자 특징
서비스 유닛 .service 다른 시스템에게 제공되는 서비스를 나타낸다.
장치 유닛 .device 하드웨어가 추가되거나 마운트 됐을 때 생성된다.
마운트 유닛 .mount 생성된 장치를 마운트 포인트에 연결하면 생성된다.
자동마운트 유닛
.automoun
t
자동마운트 포인트를 관리한다.
스왑 유닛 .swap 스왑영역에 생성되며 스왑 영역을 관리한다.
타겟 유닛 .target 부팅정보를 담고있는 유닛이다
경로 유닛 .path 특정 파일시스템이나 디렉토리를 모니터링하는 정보
타이머 유닛 .timer 일정 간격으로 유닛을 실행 할 때 사용한다.
스냅샷 유닛 .snapshot 특정 시점의 모든 유닛의 상태를 저장한다.
소켓 유닛 .socket 서로다른 서비스, 시스템간의 데이터를 주고 받는다.
범위 유닛 .scope 시스템 프로세스 집합을 관리한다.
슬라이스 유닛 .slice 프로세스 그룹의 자원을 계층적으로 관리한다.
Systemd 유닛
리눅스 Systemd
2
유닛 파일의 위치
패키지 설치
/usr/lib/system/system
수동생성, 관리
/etc/systemd/system
임시유닛
/run/system/system
systemctl start systemctl enable
부팅시
Systemd 유닛
리눅스 Systemd
2
유닛 파일 구성
1 [Unit]
2 Description=The Apache HTTP Server
3 After=network.target remote-fs.target nss-lookup.t
arget
4 Documentation=man:httpd(8)
5 Documentation=man:apachectl(8)
6
7 [Service]
8 Type=notify
9 EnvironmentFile=/etc/sysconfig/httpd
10 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGRO
UND
11 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
12 ExecStop=/bin/kill -WINCH ${MAINPID}
~
18 KillSignal=SIGCONT
19 PrivateTmp=true
20
일반적정보
유닛 설명
의존성 순서
참고문서
서비스에 대한 옵션
유닛의 유형
시작될 때 실행
재구성 됐을 때 실행
중지됐을 때
Enable 됐을 경우
링크파일이 생성되는
Systemd 사용
리눅스 Systemd
3
동작 명령 동작 명령
시작
/ 확인
systemctl start 서비스 재시작
systemctl restart 서비
스
systemctl is-active 서비
스 활성화
/ 확인
systemctl enable 서비
스
상태확인 systemctl status 서비스
systemctl is-enabled 서
비스
중지 systemctl stop 서비스 비활성화
Systemctl disable 서비
스
동작 명령
유닛 정보 systemctl list-units
유닛 목록 systemctl list-unit-files
의존관계 systemctl list-dependencies (유닛명)
유닛 제어 명령
일괄 제어가 가능한 명령
Systemd 사용
리눅스 Systemd
3
start 및 확인
[centos@test ~]$ sudo systemctl start httpd
[centos@test ~]$ sudo systemctl is-active httpd
active
enable 및 확인
[centos@test ~]$ sudo systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd
.service to /usr/lib/systemd/system/httpd.service.
[centos@test ~]$ sudo systemctl is-enabled httpd
enabled
Systemd 사용
리눅스 Systemd
3
status 확인
[centos@test ~]$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset
: disabled)
Active: active (running) since 목 2021-01-14 16:54:39 KST; 41min ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 4383 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─4383 /usr/sbin/httpd -DFOREGROUND
├─4384 /usr/sbin/httpd -DFOREGROUND
├─4385 /usr/sbin/httpd -DFOREGROUND
├─4386 /usr/sbin/httpd -DFOREGROUND
├─4387 /usr/sbin/httpd -DFOREGROUND
└─4388 /usr/sbin/httpd -DFOREGROUND
1월 14 16:54:39 test.novalocal systemd[1]: Starting The Apache HTTP Server...
1월 14 16:54:39 test.novalocal systemd[1]: Started The Apache HTTP Server.
Systemd 사용
리눅스 Systemd
3
disable 및 stop
[centos@test ~]$ sudo systemctl disable httpd
Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.ser
vice.
[centos@test ~]$ sudo systemctl stop httpd
[centos@test ~]$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vend
or preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8)
Systemd 사용
리눅스 Systemd
3
로그 확인
[centos@test ~]$ sudo systemctl start httpd
Job for httpd.service failed because the control process exited with error c
ode. See "systemctl status httpd.service" and "journalctl -xe" for details.
[centos@test ~]$ sudo journalctl –xe
Q & A
리눅스 Systemd
4
Q & A

More Related Content

Similar to Systemd

Enterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingEnterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingsuk kim
 
uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계
uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계
uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계flowcontrol
 
Free rtos seminar
Free rtos seminarFree rtos seminar
Free rtos seminarCho Daniel
 
[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdfHeeJung Chae
 
Linux 강의자료 ed10
Linux 강의자료 ed10Linux 강의자료 ed10
Linux 강의자료 ed10hungrok
 
[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱NAVER D2
 
윈도우 커널 익스플로잇
윈도우 커널 익스플로잇윈도우 커널 익스플로잇
윈도우 커널 익스플로잇Seungyong Lee
 
3. windows system과 rootkit
3. windows system과 rootkit3. windows system과 rootkit
3. windows system과 rootkitYoungjun Chang
 
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmondDocker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmondDaegwon Kim
 
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편Ji-Woong Choi
 
노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)
노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)
노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)Ubuntu Korea Community
 
[오픈소스컨설팅] SELinux : Stop Disabling SELinux
[오픈소스컨설팅] SELinux : Stop Disabling SELinux[오픈소스컨설팅] SELinux : Stop Disabling SELinux
[오픈소스컨설팅] SELinux : Stop Disabling SELinuxOpen Source Consulting
 
171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계우진 신
 
Fluentd with MySQL
Fluentd with MySQLFluentd with MySQL
Fluentd with MySQLI Goo Lee
 
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOSConfd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS충섭 김
 
Mirantis open stack deployment automation
Mirantis open stack deployment automationMirantis open stack deployment automation
Mirantis open stack deployment automationWooKyun Jeon
 
Hyperledger farbric build your first network install and analysis
Hyperledger farbric   build your first network install and analysisHyperledger farbric   build your first network install and analysis
Hyperledger farbric build your first network install and analysis병준 김
 
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211Ji-Woong Choi
 
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415sprdd
 
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함Ji-Woong Choi
 

Similar to Systemd (20)

Enterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_bootingEnterprise Linux 7 new feature_systemd_booting
Enterprise Linux 7 new feature_systemd_booting
 
uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계
uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계
uEnginebpm 개발자교육 8 액티비티필터를 이용한 시스템연계
 
Free rtos seminar
Free rtos seminarFree rtos seminar
Free rtos seminar
 
[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf[Ansible] Solution Guide V0.4_20181204.pdf
[Ansible] Solution Guide V0.4_20181204.pdf
 
Linux 강의자료 ed10
Linux 강의자료 ed10Linux 강의자료 ed10
Linux 강의자료 ed10
 
[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱[231]나는서버를썰터이니너는개발만하여라 양지욱
[231]나는서버를썰터이니너는개발만하여라 양지욱
 
윈도우 커널 익스플로잇
윈도우 커널 익스플로잇윈도우 커널 익스플로잇
윈도우 커널 익스플로잇
 
3. windows system과 rootkit
3. windows system과 rootkit3. windows system과 rootkit
3. windows system과 rootkit
 
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmondDocker Casual Talk #2 - Dockerizing newrelic-sysmond
Docker Casual Talk #2 - Dockerizing newrelic-sysmond
 
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
[오픈소스컨설팅]레드햇계열리눅스7 운영자가이드 - 기초편
 
노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)
노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)
노태상 - 리눅스 커널 개요 및 이슈 아이엠 (2010Y01M30D)
 
[오픈소스컨설팅] SELinux : Stop Disabling SELinux
[오픈소스컨설팅] SELinux : Stop Disabling SELinux[오픈소스컨설팅] SELinux : Stop Disabling SELinux
[오픈소스컨설팅] SELinux : Stop Disabling SELinux
 
171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계171220 웹프로그래밍 web app 토렌트 관리체계
171220 웹프로그래밍 web app 토렌트 관리체계
 
Fluentd with MySQL
Fluentd with MySQLFluentd with MySQL
Fluentd with MySQL
 
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOSConfd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
 
Mirantis open stack deployment automation
Mirantis open stack deployment automationMirantis open stack deployment automation
Mirantis open stack deployment automation
 
Hyperledger farbric build your first network install and analysis
Hyperledger farbric   build your first network install and analysisHyperledger farbric   build your first network install and analysis
Hyperledger farbric build your first network install and analysis
 
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
[오픈소스컨설팅]애플리케이션 빌드 및_배포가이드_v1.0_20140211
 
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
Zinst 패키지 기반의-리눅스_중앙관리시스템_20140415
 
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
 

More from DataUs

220302 사내세미나_오정민 REST API와 크롤링
220302 사내세미나_오정민 REST API와 크롤링220302 사내세미나_오정민 REST API와 크롤링
220302 사내세미나_오정민 REST API와 크롤링DataUs
 
0222 사내세미나_오정민 스프링인액션
0222 사내세미나_오정민 스프링인액션0222 사내세미나_오정민 스프링인액션
0222 사내세미나_오정민 스프링인액션DataUs
 
0222 사내세미나 이연권_추천시스템
0222 사내세미나 이연권_추천시스템0222 사내세미나 이연권_추천시스템
0222 사내세미나 이연권_추천시스템DataUs
 
모듈시스템과 webpack
모듈시스템과 webpack모듈시스템과 webpack
모듈시스템과 webpackDataUs
 
Chrome Devtools
Chrome DevtoolsChrome Devtools
Chrome DevtoolsDataUs
 
Spring Security
Spring SecuritySpring Security
Spring SecurityDataUs
 
프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음DataUs
 
데이터 모델링
데이터 모델링데이터 모델링
데이터 모델링DataUs
 
Vue guide v0.1
Vue guide v0.1Vue guide v0.1
Vue guide v0.1DataUs
 
Vue guide예제(vue todo-list)-v0.1
Vue guide예제(vue todo-list)-v0.1Vue guide예제(vue todo-list)-v0.1
Vue guide예제(vue todo-list)-v0.1DataUs
 
GitHub 활용하기
GitHub 활용하기GitHub 활용하기
GitHub 활용하기DataUs
 
해커 그들은 누구인가?
해커 그들은 누구인가?해커 그들은 누구인가?
해커 그들은 누구인가?DataUs
 
모던 자바스크립트 Deep Dive Review
모던 자바스크립트 Deep Dive Review모던 자바스크립트 Deep Dive Review
모던 자바스크립트 Deep Dive ReviewDataUs
 
데이터 모델이론 개념모델링
데이터 모델이론 개념모델링데이터 모델이론 개념모델링
데이터 모델이론 개념모델링DataUs
 
[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드DataUs
 
NHN Cloud 1차 교육자료
NHN Cloud 1차 교육자료NHN Cloud 1차 교육자료
NHN Cloud 1차 교육자료DataUs
 
html / css
html / csshtml / css
html / cssDataUs
 
네트워킹과 웹 성능 최적화
네트워킹과 웹 성능 최적화네트워킹과 웹 성능 최적화
네트워킹과 웹 성능 최적화DataUs
 

More from DataUs (18)

220302 사내세미나_오정민 REST API와 크롤링
220302 사내세미나_오정민 REST API와 크롤링220302 사내세미나_오정민 REST API와 크롤링
220302 사내세미나_오정민 REST API와 크롤링
 
0222 사내세미나_오정민 스프링인액션
0222 사내세미나_오정민 스프링인액션0222 사내세미나_오정민 스프링인액션
0222 사내세미나_오정민 스프링인액션
 
0222 사내세미나 이연권_추천시스템
0222 사내세미나 이연권_추천시스템0222 사내세미나 이연권_추천시스템
0222 사내세미나 이연권_추천시스템
 
모듈시스템과 webpack
모듈시스템과 webpack모듈시스템과 webpack
모듈시스템과 webpack
 
Chrome Devtools
Chrome DevtoolsChrome Devtools
Chrome Devtools
 
Spring Security
Spring SecuritySpring Security
Spring Security
 
프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음프론트엔드 개발 첫걸음
프론트엔드 개발 첫걸음
 
데이터 모델링
데이터 모델링데이터 모델링
데이터 모델링
 
Vue guide v0.1
Vue guide v0.1Vue guide v0.1
Vue guide v0.1
 
Vue guide예제(vue todo-list)-v0.1
Vue guide예제(vue todo-list)-v0.1Vue guide예제(vue todo-list)-v0.1
Vue guide예제(vue todo-list)-v0.1
 
GitHub 활용하기
GitHub 활용하기GitHub 활용하기
GitHub 활용하기
 
해커 그들은 누구인가?
해커 그들은 누구인가?해커 그들은 누구인가?
해커 그들은 누구인가?
 
모던 자바스크립트 Deep Dive Review
모던 자바스크립트 Deep Dive Review모던 자바스크립트 Deep Dive Review
모던 자바스크립트 Deep Dive Review
 
데이터 모델이론 개념모델링
데이터 모델이론 개념모델링데이터 모델이론 개념모델링
데이터 모델이론 개념모델링
 
[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드
 
NHN Cloud 1차 교육자료
NHN Cloud 1차 교육자료NHN Cloud 1차 교육자료
NHN Cloud 1차 교육자료
 
html / css
html / csshtml / css
html / css
 
네트워킹과 웹 성능 최적화
네트워킹과 웹 성능 최적화네트워킹과 웹 성능 최적화
네트워킹과 웹 성능 최적화
 

Recently uploaded

Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Wonjun Hwang
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionKim Daeun
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)Tae Young Lee
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Kim Daeun
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Wonjun Hwang
 

Recently uploaded (6)

Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)Merge (Kitworks Team Study 이성수 발표자료 240426)
Merge (Kitworks Team Study 이성수 발표자료 240426)
 
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution DetectionMOODv2 : Masked Image Modeling for Out-of-Distribution Detection
MOODv2 : Masked Image Modeling for Out-of-Distribution Detection
 
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
 
캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차캐드앤그래픽스 2024년 5월호 목차
캐드앤그래픽스 2024년 5월호 목차
 
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
Continual Active Learning for Efficient Adaptation of Machine LearningModels ...
 
Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)Console API (Kitworks Team Study 백혜인 발표자료)
Console API (Kitworks Team Study 백혜인 발표자료)
 

Systemd

  • 2. 1. Systemd 소개 2. Systemd 유닛 3. Systemd 사용 4. Q & A 목차 리눅스 Systemd
  • 3. Systemd 소개 리눅스 Systemd 1 init 프로세스를 대체하여 도입된 PID 1번 프로세스 2010년도에 발표하여 2015년도 부터 본격적으로 도입됐다. 시스템 관리, 로그 관리, 서비스 관리, 초기화 스크립트 관리 등의 역할을 하고 있다. Systemd의 d는 Daemon을 의미한다. init프로세스 : 유닉스 기반 컴퓨터 운영 체제에서 부팅 과정 중 최초로 실행되는 프로 세스 Daemon : 리눅스가 처음 가동될때 실행되는 백그라운드 프로세스로 요청이 생기면 반응하는 리스너 같은 역할을 한다. PID : 프로세스를 구분하기 위한 식별자.
  • 4. Systemd 소개 리눅스 Systemd 1  Init프로세스에 대한 호환성 제공 init 스크립트 런레벨과 타겟  의존성 기반의 서비스 제어 로직 제공  Systemd 유닛을 통한 시스템 관리  부팅시 서비스를 병렬로 시작  시스템 상태 스냅샷 지원  Cgroup관리  통합로그 관리 주요 기능과 특징
  • 5. Systemd 유닛 리눅스 Systemd 2 유닛 파일 종류 유닛 명 확장자 특징 서비스 유닛 .service 다른 시스템에게 제공되는 서비스를 나타낸다. 장치 유닛 .device 하드웨어가 추가되거나 마운트 됐을 때 생성된다. 마운트 유닛 .mount 생성된 장치를 마운트 포인트에 연결하면 생성된다. 자동마운트 유닛 .automoun t 자동마운트 포인트를 관리한다. 스왑 유닛 .swap 스왑영역에 생성되며 스왑 영역을 관리한다. 타겟 유닛 .target 부팅정보를 담고있는 유닛이다 경로 유닛 .path 특정 파일시스템이나 디렉토리를 모니터링하는 정보 타이머 유닛 .timer 일정 간격으로 유닛을 실행 할 때 사용한다. 스냅샷 유닛 .snapshot 특정 시점의 모든 유닛의 상태를 저장한다. 소켓 유닛 .socket 서로다른 서비스, 시스템간의 데이터를 주고 받는다. 범위 유닛 .scope 시스템 프로세스 집합을 관리한다. 슬라이스 유닛 .slice 프로세스 그룹의 자원을 계층적으로 관리한다.
  • 6. Systemd 유닛 리눅스 Systemd 2 유닛 파일의 위치 패키지 설치 /usr/lib/system/system 수동생성, 관리 /etc/systemd/system 임시유닛 /run/system/system systemctl start systemctl enable 부팅시
  • 7. Systemd 유닛 리눅스 Systemd 2 유닛 파일 구성 1 [Unit] 2 Description=The Apache HTTP Server 3 After=network.target remote-fs.target nss-lookup.t arget 4 Documentation=man:httpd(8) 5 Documentation=man:apachectl(8) 6 7 [Service] 8 Type=notify 9 EnvironmentFile=/etc/sysconfig/httpd 10 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGRO UND 11 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful 12 ExecStop=/bin/kill -WINCH ${MAINPID} ~ 18 KillSignal=SIGCONT 19 PrivateTmp=true 20 일반적정보 유닛 설명 의존성 순서 참고문서 서비스에 대한 옵션 유닛의 유형 시작될 때 실행 재구성 됐을 때 실행 중지됐을 때 Enable 됐을 경우 링크파일이 생성되는
  • 8. Systemd 사용 리눅스 Systemd 3 동작 명령 동작 명령 시작 / 확인 systemctl start 서비스 재시작 systemctl restart 서비 스 systemctl is-active 서비 스 활성화 / 확인 systemctl enable 서비 스 상태확인 systemctl status 서비스 systemctl is-enabled 서 비스 중지 systemctl stop 서비스 비활성화 Systemctl disable 서비 스 동작 명령 유닛 정보 systemctl list-units 유닛 목록 systemctl list-unit-files 의존관계 systemctl list-dependencies (유닛명) 유닛 제어 명령 일괄 제어가 가능한 명령
  • 9. Systemd 사용 리눅스 Systemd 3 start 및 확인 [centos@test ~]$ sudo systemctl start httpd [centos@test ~]$ sudo systemctl is-active httpd active enable 및 확인 [centos@test ~]$ sudo systemctl enable httpd Created symlink from /etc/systemd/system/multi-user.target.wants/httpd .service to /usr/lib/systemd/system/httpd.service. [centos@test ~]$ sudo systemctl is-enabled httpd enabled
  • 10. Systemd 사용 리눅스 Systemd 3 status 확인 [centos@test ~]$ sudo systemctl status httpd ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset : disabled) Active: active (running) since 목 2021-01-14 16:54:39 KST; 41min ago Docs: man:httpd(8) man:apachectl(8) Main PID: 4383 (httpd) Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec" CGroup: /system.slice/httpd.service ├─4383 /usr/sbin/httpd -DFOREGROUND ├─4384 /usr/sbin/httpd -DFOREGROUND ├─4385 /usr/sbin/httpd -DFOREGROUND ├─4386 /usr/sbin/httpd -DFOREGROUND ├─4387 /usr/sbin/httpd -DFOREGROUND └─4388 /usr/sbin/httpd -DFOREGROUND 1월 14 16:54:39 test.novalocal systemd[1]: Starting The Apache HTTP Server... 1월 14 16:54:39 test.novalocal systemd[1]: Started The Apache HTTP Server.
  • 11. Systemd 사용 리눅스 Systemd 3 disable 및 stop [centos@test ~]$ sudo systemctl disable httpd Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.ser vice. [centos@test ~]$ sudo systemctl stop httpd [centos@test ~]$ sudo systemctl status httpd ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vend or preset: disabled) Active: inactive (dead) Docs: man:httpd(8) man:apachectl(8)
  • 12. Systemd 사용 리눅스 Systemd 3 로그 확인 [centos@test ~]$ sudo systemctl start httpd Job for httpd.service failed because the control process exited with error c ode. See "systemctl status httpd.service" and "journalctl -xe" for details. [centos@test ~]$ sudo journalctl –xe
  • 13. Q & A 리눅스 Systemd 4 Q & A

Editor's Notes

  1. 데몬 : 사용자의 요청이 있을때까지 메모리에서 대기중인 프로세스