본문 바로가기
컴퓨터 활용(한글, 오피스 등)/50_2.운영체제_리눅스

CentOS systemctl에서 disabled 서비스 enable 처리

by 3604 2022. 12. 23.
728x90

[Linux] CentOS systemctl에서 disabled 서비스 enable 처리

출처: https://pncode.tistory.com/79

CentOS에서 서비스를 시작하거나 스탑할 때 다음의 명령어를 이용한다.

httpd.service를 예로 들겠다.

 

원래는 다음의 형태로 시작하거나 정지했는데.. 명령어가 변경되었다.

service httpd start
service httpd stop

아래와 같이 변경 됨. 

위의 명령어를 실행하더라도 redirect 되므로 문제 없다.

systemctl start httpd.service
systemctl stop httpd.service

 

아래의 명령어를 입력하면 현재 상태를 볼 수 있다.

systemctl status httpd.service

 

예를 들어, 서비스가 실행되지 않는경우 disabled 되어있는 경우가 있다.

이것을 enable로 변경해주어야 한다.

다음을 입력하여 리스트를 확인하자.

systemctl list-unit-files

 

 

확인 후, disable을 enable로 변경한다.

아래의 코드를 입력한다.

systemctl enable httpd.service
728x90