명령어/Linux

[RHEL] chkconfig 레거시 SysV 서비스 관리

jykim23 2026. 7. 18. 19:03
반응형

부제: systemd 이전 SysV init 스크립트의 부팅 활성화를 관리하던 명령

chkconfig --list           # SysV 서비스의 런레벨별 on/off 나열
chkconfig --add myservice  # SysV 스크립트를 관리 대상에 등록
chkconfig myservice on     # 부팅 시 자동 시작 설정(레거시)
$ chkconfig --list
Note: This output shows SysV services only and does not include native
      systemd services.

      If you want to list systemd services use 'systemctl list-unit-files'.

$ chkconfig --help
usage:   chkconfig [--list] [--type <type>] [name]
         chkconfig --add <name>
         chkconfig --del <name>
         chkconfig [--level <levels>] <name> <on|off|reset>

chkconfig는 systemd 이전 SysV init 시절, /etc/init.d 스크립트를 런레벨별로 켜고 끄던 명령이다. 데비안의 update-rc.d에 해당한다. 지금 Rocky·RHEL은 systemd를 쓰므로 대부분 systemctl enable/disable로 대체됐고, chkconfig는 남아 있는 SysV 스크립트만 다룬다. 실제 서버에선 --list 출력이 비어 있는 경우가 많다. 신규 작업은 systemctl로 하는 것이 표준이다.

이렇게도 쓴다

SysV 서비스만 런레벨별 상태로 나열한다.

chkconfig --list

 

systemd 유닛까지 포함한 전체 목록은 systemctl로 본다(대체 명령).

systemctl list-unit-files --type=service

 

특정 SysV 서비스 하나의 상태만 조회한다.

chkconfig --list sshd

 

새 SysV 스크립트를 관리 대상에 등록한다.

chkconfig --add myservice

 

레거시 명령을 지금 표준으로 옮긴다(systemctl 조합).

chkconfig --list && systemctl list-unit-files --state=enabled
반응형