services - mysql homebrew config

brew services: where to edit configuration? (2)

  1. Copy /Users/mh/Library/LaunchAgents/homebrew.mxcl.mysql56.plist somewhere
  2. make changes to copy of plist
  3. run brew services start mysql56 {path to modified copy of plist file}

Brew services has installed this plist file for mysql.

~ $ brew services list
Name    Status  User      Plist
mysql56 started mh /Users/mh/Library/LaunchAgents/homebrew.mxcl.mysql56.plist

Is this file safe to edit (i.e. will brew ever overwrite changes made here)? Is there another method I should use to modify the file?

All .plist files that come with Formulas can be found in Cellar dir. For instance homebrew.mxcl.mysql.plist is in /usr/local/Cellar/mysql/5.7.14. You can modify it and  brew services will use it.

Alternatively you can modify /Library/LaunchDaemons/homebrew.mxcl.mysql.plist and make it immutable with sudo chflags uchg /Library/LaunchDaemons/homebrew.mxcl.mysql.plist. This won't allow brew to rewrite or modify .plist file.