1

我试图在 /Library/LaunchDaemons 创建 .plist 但它没有运行。

如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>org.verdaccio</string>
    <key>Program</key>
    <string>/usr/local/bin/verdaccio</string>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
  </dict>
</plist>

提前致谢。

4

1 回答 1

2

让它工作的正确答案如下:

<?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>EnvironmentVariables</key>
    <dict>
      <key>PATH</key>
      <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>org.verdaccio</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/bin/verdaccio</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>igor</string>
    <key>SessionCreate</key>
    <true/>
  </dict>
</plist>
于 2018-03-16T13:55:25.520 回答