daemon 이란, 사용자가 직접적으로 제어하지 않고, 백그라운드에서 여러 작업을 하는 프로그램을 말한다.
일반적으로 systemd 와 같이 프로세스 마지막에 d 가 붙는다.
Linux 는 부팅되면서 여러 daemon 들이 실행된다.
이 daemon 들은 service 파일로 설정하여 실행하고 있으며, systemd 라는 프로세스가 관리한다.
systemd 는 1번 PID 를 갖는 프로세스로서, OS 부팅시 가장 먼저 실행되는 프로세스 트리의 가장 상위 프로세스이다.
따라서, Service 는 system daemon 및 사용자 daemon 을 의미하며, systemctl 은 이 service(daemon) 들을 관리하는 명령어이다.
Linux OS가 부팅되었을 때, 생성되면서 종료될 때까지 실행되는 Process및 설정 파일을 service라고 한다.
service 들은 /etc/systemd/system/<serviceName>
경로에 존재한다.
service 파일은
[Unit]
Description=<service 에 대한 설명>
[Service]
Type=simple
ExecStart=<실행파일>
Restart=on-failure
[Install]
WantedBy=multi-user.target
[Service type] https://trstringer.com/simple-vs-oneshot-systemd-service/?ref=linuxhandbook.com#follow-up-units-timing
설치 이후에는
# 서비스 시작
systemctl start <serviceName>
# 서비스 활성화
systemctl enable <serviceName>
[linux service] https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6
[systemctl] https://etloveguitar.tistory.com/57
[systemctl] https://faun.pub/systemctl-command-detailed-explanation-and-use-tutorial-504306cdd4a8