ssdb-docs icon indicating copy to clipboard operation
ssdb-docs copied to clipboard

mac os怎样配置ssdb开机启动

Open youmisun opened this issue 8 years ago • 1 comments

mac os系统没有/etc/init.d目录,应该如何配置?

youmisun avatar Jun 24 '17 08:06 youmisun

编辑个 plist 文件,内容如下(注意实际路径):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <dict>
      <key>SuccessfulExit</key>
      <false/>
    </dict>
    <key>Label</key>
    <string>ideawu.ssdb</string>
    <key>ProgramArguments</key>
    <array>
      <string>[path-to-ssdb]</string>
      <string>[path-to-configure-file]</string>
      <string>-d</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

然后放到自己的 $HOME/Library/LaunchAgents 下面,然后 launchctl load <plist-file-name> 就可以了。

mingcheng avatar Aug 09 '18 02:08 mingcheng