systemd enable/disable/is-enabled
특정 서비스의 systemd를 설정했더라도 부팅 후에 자동으로 데몬을 띄우지 않기 때문에
부팅 이후에도 잘 동작시키려면 enable/disable을 사용해야 한다.
확인하는 작업은 is-enabled를 사용한다.
$ sudo systemctl is-enabled kafka
disabled
$ sudo systemctl enable kafka
Created symlink from /etc/systemd/system/multi-user.target.wants/kafka.service to /usr/lib/systemd/system/kafka.service.
확인한다.
$ sudo systemctl is-enabled kafka
enabled
부팅 후에 자동으로 데몬을 안 띄우게 하려면 disable를 사용한다.
$ sudo systemctl disable kafka
Removed symlink /etc/systemd/system/multi-user.target.wants/kafka.service.
systemctl --failed를 사용해 부팅안된 서비스를 확인할 수 있다.
만약 kafka.service가 실행 중에 문제가 생겼다면 다음과 같이 보일 것이다.
$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● kafka.service loaded failed failed Postfix Mail Transport Agent
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
1 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.