이번에 서비스 등록할때 “/etc/init.d, /usr/lib/systemd/system 디렉토리 밑에 모두 서비스 스크립트를 생성해야하나?” 라는 의문점이 생겨 두개의 차이를 찾아보게 되었다.
결론은 systemd 로만 등록하였다.
# init
$ chkconfig [service명] on|off
# systemd
$ systemctl enable|disable [service명]# init
$ chkconfig [service명] --list
# systemd
$ systemctl is-enabled [service명]# init
$ /etc/init.d/[service명] start/stop/status
# systemd
$ systemctl start|stop|status [service명]# init
$ /etc/init.d/[service명] status (pid 확인 후)
$ kill [PID]
# systemd
$ systemctl kill [service명]# 유효화 되어 있는 Unit 표시
$ systemctl list-units
# 설치되어 있는 Unit 표시
# enable : 자동 시작 설정 활성화
# disable : 자동 시작 설정 비활성화
# static : 단독으로 자동 기동 할 수 없음
$ systemctl list-unit-files