Skip to content

Instantly share code, notes, and snippets.

@geunho
Created March 13, 2019 03:57
Show Gist options
  • Select an option

  • Save geunho/0c93d074526d2ffd2e77b47240f8c365 to your computer and use it in GitHub Desktop.

Select an option

Save geunho/0c93d074526d2ffd2e77b47240f8c365 to your computer and use it in GitHub Desktop.
register_windows_service
윈도우 서비스 등록 방법
1. ServiceMain을 구현한 바이너리인 경우
# 생성
> sc create "%SERVICE_NAME%" binpath= "%ABSOLUTE_BIN_PATH%" start= "auto"
# 삭제
> sc delete "%SERVICE_NAME%"
2. 그 외 백그라운드에서 실행되는 모든 바이너리
http://nssm.cc/
- 스크립트, 실행파일 등 가리지 않고 서비스로 등록해준다.
- stdout, stderr를 파일로 기록할 수 있고, log rotation도 지원한다. (stdin 지정도 가능)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment