인디노트

OS X 서비스 등록 (Openvpn) 본문

개발 플랫폼 및 언어

OS X 서비스 등록 (Openvpn)

인디개발자 2018. 5. 18. 19:57

서비스 설정파일


cat /Library/LaunchDaemons/homebrew.mxcl.openvpn.plist

<?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>Label</key>

  <string>homebrew.mxcl.openvpn</string>

  <key>ProgramArguments</key>

  <array>

    <string>/usr/local/opt/openvpn/sbin/openvpn</string>

    <string>--config</string>

    <string>/usr/local/etc/openvpn/server.conf</string>

  </array>

  <key>OnDemand</key>

  <false/>

  <key>RunAtLoad</key>

  <true/>

  <key>TimeOut</key>

  <integer>90</integer>

  <key>WatchPaths</key>

  <array>

    <string>/usr/local/etc/openvpn</string>

  </array>

  <key>WorkingDirectory</key>

  <string>/usr/local/etc/openvpn</string>

</dict>

</plist>


서비스 등록

launchctl load ~/Library/LaunchDaemons/homebrew.mxcl.openvpn.plist



서비스 시작

launchctl start homebrew.mxcl.openvpn


서비스 재시작

launchctl restart homebrew.mxcl.openvpn



서비스 중지

launchctl stop homebrew.mxcl.openvpn



반응형
Comments