ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • MAC 에서 svnserve launchctl 등록
    개발/MAC 2021. 3. 20. 16:04
    728x90

    관련 명령어

    tail -f [파일명]

    파일명을 실시간으로 계속 추적

    로그를 보면서 디버깅 할때 사용

    launchctl 로그는 /var/log/system.log 를 tail 로 보면됨 (warning 같은거나 에러가 표시될것임)

     

     

    laucnhctl load [파일명]

    launchctl unload [파일명]

     

     

    시스템 전체 LaunchDaemon 과 사용자 LaunchDaemon 관리가 따로 있으니 주의

    시스템 전체는 /Library/LaunchDaemon 안에 있음

    유저꺼는 ~/Library/LaunchAgents 안에 있음

     

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
        <dict>
            <key>UserName</key>
            <string>vateran</string>
            <key>Label</key>
            <string>org.tigris.subversion.svnserve</string>
            <key>ProgramArguments</key>
            <array>
                <string>/opt/homebrew/bin/svnserve</string>
                <string>--inetd</string>
                <string>--root=/Volumes/Storage/dev/svnrepo</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
    
            <key>Sockets</key>
            <dict>
                <key>Listeners</key>
                <array>
                    <dict>
                        <key>SockFamily</key>
                        <string>IPv4</string>
                        <key>SockServiceName</key>
                        <string>svn</string>
                        <key>SockType</key>
                        <string>stream</string>
                    </dict>
                    <dict>
                        <key>SockFamily</key>
                        <string>IPv6</string>
                        <key>SockServiceName</key>
                        <string>svn</string>
                        <key>SockType</key>
                        <string>stream</string>
                    </dict>
                </array>
            </dict>
            <key>inetdCompatibility</key>
            <dict>
                <key>Wait</key>
                <false/>
            </dict>
        </dict>
    </plist>

    반드시 실행파일 경로는 절대 경로

    UserName 을 비워두면 안됨

    --root 경로도 절대 경로

    --inetd 로 설정해둬야함

     

     

    chown 으로 소유권을 바꿔줄 필요가 있음

    /Library/LaunchDaemons 파일들은 sudo chown root [파일명] 으로 소유권을 root 로 바꿔줘야 launchctl load 가 가능

     

     

     

     

     

    728x90

    댓글

Designed by Tistory.