{"action":"opened","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/27945","repository_url":"https://api.github.com/repos/Homebrew/homebrew-core","labels_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/27945/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/27945/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew-core/issues/27945/events","html_url":"https://github.com/Homebrew/homebrew-core/issues/27945","id":323786032,"number":27945,"title":"Formula mysql fails to work with Installing Service Starting on Boot","user":{"login":"jonmchan","id":1827190,"avatar_url":"https://avatars0.githubusercontent.com/u/1827190?v=4","gravatar_id":"","url":"https://api.github.com/users/jonmchan","html_url":"https://github.com/jonmchan","followers_url":"https://api.github.com/users/jonmchan/followers","following_url":"https://api.github.com/users/jonmchan/following{/other_user}","gists_url":"https://api.github.com/users/jonmchan/gists{/gist_id}","starred_url":"https://api.github.com/users/jonmchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonmchan/subscriptions","organizations_url":"https://api.github.com/users/jonmchan/orgs","repos_url":"https://api.github.com/users/jonmchan/repos","events_url":"https://api.github.com/users/jonmchan/events{/privacy}","received_events_url":"https://api.github.com/users/jonmchan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-16T21:03:51Z","updated_at":"2018-05-16T21:03:51Z","closed_at":null,"author_association":"NONE","body":"**Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.**\r\n\r\n- [x] are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh\r\n- [x] have a problem with `brew install` (or `upgrade`, `reinstall`) a single, official formula (not cask)? If it's a general `brew` problem please file this issue at Homebrew/brew: https://github.com/Homebrew/brew/issues/new/choose. If it's a `brew cask` problem please file this issue at https://github.com/caskroom/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.\r\n- [x] ran `brew update` and can still reproduce the problem?\r\n- [x] ran `brew doctor`, fixed all issues and can still reproduce the problem?\r\n- [ ] ran `brew gist-logs <formula>` (where `<formula>` is the name of the formula that failed) and included the output link? **N/A**\r\n- [ ] if `brew gist-logs` didn't work: ran `brew config` and `brew doctor` and included their output with your issue? **N/A**\r\n\r\nTo help us debug your issue please explain:\r\n- What you were trying to do (and why)\r\n\r\nbrew services allow you to install a service to start at bootup, instead of after login.\r\n\r\nFrom ```brew services```:\r\n```If sudo is passed, operate on /Library/LaunchDaemons (started at boot).```\r\n\r\n- What happened (include command output)\r\n\r\nThe service is installed successfully on boot, but mysql refuses to run as root. It constantly shuts itself down with the error message:\r\n\r\n```[ERROR] Fatal error: Please read \"Security\" section of the manual to find out how to run mysqld as root!```\r\n\r\nMySQL is not designed to run as root.\r\n\r\nThis is confirmed the ```system.log``` \r\n\r\n```\r\nMay 16 14:09:33 jonmchan-mbp15 com.apple.xpc.launchd[1] (homebrew.mxcl.mysql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.\r\n```\r\n\r\n- What you expected to happen\r\n- Step-by-step reproduction instructions (by running `brew install` commands)\r\n\r\n```\r\nbrew install mysql\r\nsudo brew services start mysql\r\n```\r\n\r\n- Fix\r\n\r\nEditing the plist such that the local user is specified should address the issue. This will allow mysql to be run on boot up and work even when other users are logged in rather than having to be dependent on the user that installed mysql and the service to log in for mysql to be running.\r\n\r\nI made my plist the following:\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\r\n<plist version=\"1.0\">\r\n<dict>\r\n  <key>KeepAlive</key>\r\n  <true/>\r\n  <key>Label</key>\r\n  <string>homebrew.mxcl.mysql</string>\r\n  <key>ProgramArguments</key>\r\n  <array>\r\n    <string>su</string>\r\n    <string>jchan</string>\r\n    <string>-c</string>\r\n    <string>/usr/local/opt/mysql/bin/mysqld_safe</string>\r\n    <string>--datadir=/usr/local/var/mysql</string>\r\n  </array>\r\n  <key>RunAtLoad</key>\r\n  <true/>\r\n  <key>WorkingDirectory</key>\r\n  <string>/usr/local/var/mysql</string>\r\n\r\n  <key>StandardErrorPath</key>\r\n  <string>/tmp/mysql-service-error.log</string>\r\n  <key>StandardOutPath</key>\r\n  <string>/tmp/mysql-service-out.log</string>\r\n</dict>\r\n</plist>\r\n```\r\n\r\nThis however would not work for users installing this as a standard \"started at login\" (~/Library/LaunchAgents) service. Support might have to be added in https://github.com/Homebrew/homebrew-services to utilize a different plist based off of whether it was being installed as a LaunchAgent or LaunchDaemon?"}}
{"actor":{"display_login":"jonmchan"}}