728x90
Mac 에서 스크립트 자동 시작하는 방법을 찾으면 Mac - 시스템 환경 설정(설정 아이콘) - 사용자 및 그룹 - 왼쪽 사용자 목록 선택 - "암호 / 로그인 항목" 로그인 항목 선택 - "+" 클릭해서 시작 프로그램 등록으로 많이 나온다.
그 방법 말고 Linux(Unit) 에서 init 스크립트 처럼 등록을 하는 방법을 찾아보니 Mac 에도 launchd 데몬이 존재한다.
- launchd 사용(OS X 10.4 Tiger ~)
plist(property list) 파일을 아래 디렉토리에 작성한다.
: 사용자가 로그인했을 때 실행
$ cd /Users/usre1/Library/LaunchAgents
$ ls
homebrew.mxc1.nginx.plist
: 시스템 부팅 시 실행
$ su -
# cd /Library
# cd /Library/LauchDaemons
# ls
com.microsfot.autoupdate.helper.plist com.microsoft.dlp.install_monitor.plist
Creating Launch Daemons and Agents
Creating Launch Daemons and Agents If you are developing daemons to run on OS X, it is highly recommended that you design your daemons to be launchd compliant. Using launchd provides better performance and flexibility for daemons. It also improves the abil
developer.apple.com
'Engineering > Mac' 카테고리의 다른 글
No suitable application records were found. Verify your bundle identifier is correct 해결 (0) | 2023.12.15 |
---|---|
posix_spawn failed in Mac 해결 (0) | 2023.11.15 |
맥(Mac) OS 에 대한 내용들 정리 (0) | 2014.11.21 |
Mac 요세미티(Yosemite) 업데이트 후, Parallels 윈도우가 느려지는 문제 (8) | 2014.10.22 |
Mac 에서 dropbox 로 파일 백업 (0) | 2014.08.21 |