특정 서비스의 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'.
'unix and linux' 카테고리의 다른 글
ssh-keyscan, ssh-keygen 예시 (0) | 2019.02.25 |
---|---|
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) 에러 (0) | 2019.01.09 |
[sh] System.currentTimeMillis()와 동일한 쉘 커맨드 date (0) | 2018.05.10 |
[shell] awk를 이용한 특정 범위의 랜덤 값 얻기 (0) | 2018.05.10 |
cpu 튀게 하는 간단한 명령어 (0) | 2018.05.08 |