728x90
Service 등록
서비스를 등록하기 위해 아래 경로에 아래와 같이 설정을 한다.
# vi /etc/systemd/system/testchk.service
// /etc/systemd/system/testchk.service 내용
[Unit]
Description=Systemd Test Daemon
[Service]
Type=simple
ExecStart=/root/test-daemon.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
재부팅 후에도 서비스 시작되도록 등록
# systemctl enable testchk
Service 시작
# systemctl start testchk
Service 재시작
# systemctl restart testchk
Service 종료
# systemctl stop testchk
Service 상태체크
# systemctl status testchk728x90
반응형
'IT > Linux' 카테고리의 다른 글
| Linux 시스템 상태 파악하기 (2) | 2024.07.01 |
|---|---|
| Rocky linux와 우분투 차이점 (0) | 2024.05.31 |
| chmod 파일 권한 변경 명령어 (0) | 2024.02.10 |
| chown 리눅스에서 파일 및 폴더 소유자 변경 (0) | 2024.02.08 |
| 16가지 리눅스 명령어 정리 (4) | 2024.02.06 |