Homebrew / homebrew-services

🚀 Manage background services using the daemon manager launchctl on macOS or systemctl on Linux.
BSD 2-Clause "Simplified" License
2k stars 205 forks source link

Running `brew services restart mysql` logs me out of my Mac #134

Closed mejibyte closed 6 years ago

mejibyte commented 7 years ago

When I run brew services restart mysql, I am logged out of my Mac (it looks the same as if I had selected "Apple menu > Log Out ...")

Is this intended? It kills all my current windows (including the one where I ran the command from). I would expect the command to do a "soft" restart without logging me out.

Running on El Capitan. Versions:

$ brew -v
Homebrew 1.3.2
Homebrew/homebrew-core (git revision 70f4; last commit 2017-09-10)

$ brew list --versions | grep mysql
mysql 5.7.19
MikeMcQuaid commented 7 years ago

This is not intended but I can't reproduce it here, I'm afraid. Is this just the case with MySQL or any other services? Has this always happened or has it started happened recently? Does this happen for anyone else you know on El Capitan?

willywang commented 7 years ago

I have the same problem, Not only mysql but also mongo. And it happened everytime when I execute brew services restart|stop mysql|mongodb. PS: my os version is also El Capitan, home brew 1.3.1

MikeMcQuaid commented 7 years ago

This may be an El Capitan-specific bug.

hyperhtml commented 7 years ago

I've had the same issue with mysql and nginx.

I too am on El Capitan.

MikeMcQuaid commented 7 years ago

@andmej @willywang @hyperhtml can you all post your brew config and brew doctor output.

ilovezfs commented 7 years ago

I cannot reproduce this issue:

iMac-TMP:~ joe$ brew -v
Homebrew 1.3.6-40-g9bc8797-dirty
Homebrew/homebrew-core (git revision ce2e1; last commit 2017-10-24)
iMac-TMP:~ joe$ mysql --version
mysql  Ver 14.14 Distrib 5.7.20, for osx10.11 (x86_64) using  EditLine wrapper
iMac-TMP:~ joe$ brew services stop mysql
Error: Service `mysql` is not started.
iMac-TMP:~ joe$ brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
iMac-TMP:~ joe$ ps aux |grep sql
joe              33304   0.0  0.0  2444056    820 s012  S+    2:14AM   0:00.00 grep sql
joe              33302   0.0  0.5  2856120 172952   ??  S     2:14AM   0:00.40 /usr/local/opt/mysql/bin/mysqld --basedir=/usr/local/opt/mysql --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/opt/mysql/lib/plugin --log-error=iMac-TMP.local.err --pid-file=iMac-TMP.local.pid
joe              33213   0.0  0.0  2448748   1268   ??  S     2:14AM   0:00.01 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --datadir=/usr/local/var/mysql
iMac-TMP:~ joe$ brew services stop mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)
iMac-TMP:~ joe$ ps aux |grep sql
joe              33352   0.0  0.0  2444056    820 s012  S+    2:15AM   0:00.00 grep sql
iMac-TMP:~ joe$ brew services start mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
iMac-TMP:~ joe$ ps aux |grep sql
joe              33483   2.1  0.5  2846904 172632   ??  S     2:15AM   0:00.70 /usr/local/opt/mysql/bin/mysqld --basedir=/usr/local/opt/mysql --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/opt/mysql/lib/plugin --log-error=iMac-TMP.local.err --pid-file=iMac-TMP.local.pid
joe              33485   0.0  0.0  2444056    820 s012  S+    2:15AM   0:00.00 grep sql
joe              33394   0.0  0.0  2447724   1248   ??  S     2:15AM   0:00.01 /bin/sh /usr/local/opt/mysql/bin/mysqld_safe --datadir=/usr/local/var/mysql
iMac-TMP:~ joe$ brew services restart mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)
iMac-TMP:~ joe$ ps aux |grep sql
joe              33615   0.0  0.0  2450200    876 s012  S+    2:15AM   0:00.00 grep sql
iMac-TMP:~ joe$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.6
BuildVersion:   15G1510
iMac-TMP:~ joe$

No logout triggered.

hyperhtml commented 7 years ago

brew config

HOMEBREW_VERSION: 1.3.3
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 05bb3532fc3f0d723a8e8af1605c3f8080051e78
Last commit: 5 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 4e129d0d1774e8b04341334534990424f51ab994
Core tap last commit: 4 weeks ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 7.3 build 703
Git: 2.14.1 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.7.0_60
macOS: 10.11.4-x86_64
Xcode: 7.3.1
CLT: 8.2.0.0.1.1480973914
X11: 2.7.10 => /opt/X11

brew doctor

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
  /Users/<USERNAME>/.pyenv/shims/python-config
  /Users/<USERNAME>/.pyenv/shims/python3-config
  /Users/<USERNAME>/.pyenv/shims/python3.6-config
  /Users/<USERNAME>/.pyenv/shims/python3.6m-config

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libtcl8.6.dylib
  /usr/local/lib/libtk8.6.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/fakemysql.h
  /usr/local/include/fakepq.h
  /usr/local/include/fakesql.h
  /usr/local/include/itcl.h
  /usr/local/include/itcl2TclOO.h
  /usr/local/include/itclDecls.h
  /usr/local/include/itclInt.h
  /usr/local/include/itclIntDecls.h
  /usr/local/include/itclMigrate2TclCore.h
  /usr/local/include/itclTclIntStubsFcn.h
  /usr/local/include/mysqlStubs.h
  /usr/local/include/node/android-ifaddrs.h
  /usr/local/include/node/ares.h
  /usr/local/include/node/ares_build.h
  /usr/local/include/node/ares_rules.h
  /usr/local/include/node/ares_version.h
  /usr/local/include/node/libplatform/libplatform.h
  /usr/local/include/node/nameser.h
  /usr/local/include/node/node.h
  /usr/local/include/node/node_buffer.h
  /usr/local/include/node/node_internals.h
  /usr/local/include/node/node_object_wrap.h
  /usr/local/include/node/node_version.h
  /usr/local/include/node/openssl/aes.h
  /usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h
  /usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h
  /usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h
  /usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h
  /usr/local/include/node/openssl/archs/darwin-i386-cc/opensslconf.h
  /usr/local/include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-aarch64/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-armv4/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-elf/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-ppc/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-ppc64/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-x32/opensslconf.h
  /usr/local/include/node/openssl/archs/linux-x86_64/opensslconf.h
  /usr/local/include/node/openssl/archs/solaris-x86-gcc/opensslconf.h
  /usr/local/include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.h
  /usr/local/include/node/openssl/archs/VC-WIN32/opensslconf.h
  /usr/local/include/node/openssl/archs/VC-WIN64A/opensslconf.h
  /usr/local/include/node/openssl/asn1.h
  /usr/local/include/node/openssl/asn1_mac.h
  /usr/local/include/node/openssl/asn1t.h
  /usr/local/include/node/openssl/bio.h
  /usr/local/include/node/openssl/blowfish.h
  /usr/local/include/node/openssl/bn.h
  /usr/local/include/node/openssl/buffer.h
  /usr/local/include/node/openssl/camellia.h
  /usr/local/include/node/openssl/cast.h
  /usr/local/include/node/openssl/cmac.h
  /usr/local/include/node/openssl/cms.h
  /usr/local/include/node/openssl/comp.h
  /usr/local/include/node/openssl/conf.h
  /usr/local/include/node/openssl/conf_api.h
  /usr/local/include/node/openssl/crypto.h
  /usr/local/include/node/openssl/des.h
  /usr/local/include/node/openssl/des_old.h
  /usr/local/include/node/openssl/dh.h
  /usr/local/include/node/openssl/dsa.h
  /usr/local/include/node/openssl/dso.h
  /usr/local/include/node/openssl/dtls1.h
  /usr/local/include/node/openssl/e_os2.h
  /usr/local/include/node/openssl/ebcdic.h
  /usr/local/include/node/openssl/ec.h
  /usr/local/include/node/openssl/ecdh.h
  /usr/local/include/node/openssl/ecdsa.h
  /usr/local/include/node/openssl/engine.h
  /usr/local/include/node/openssl/err.h
  /usr/local/include/node/openssl/evp.h
  /usr/local/include/node/openssl/hmac.h
  /usr/local/include/node/openssl/idea.h
  /usr/local/include/node/openssl/krb5_asn.h
  /usr/local/include/node/openssl/kssl.h
  /usr/local/include/node/openssl/lhash.h
  /usr/local/include/node/openssl/md4.h
  /usr/local/include/node/openssl/md5.h
  /usr/local/include/node/openssl/mdc2.h
  /usr/local/include/node/openssl/modes.h
  /usr/local/include/node/openssl/obj_mac.h
  /usr/local/include/node/openssl/objects.h
  /usr/local/include/node/openssl/ocsp.h
  /usr/local/include/node/openssl/opensslconf.h
  /usr/local/include/node/openssl/opensslv.h
  /usr/local/include/node/openssl/ossl_typ.h
  /usr/local/include/node/openssl/pem.h
  /usr/local/include/node/openssl/pem2.h
  /usr/local/include/node/openssl/pkcs12.h
  /usr/local/include/node/openssl/pkcs7.h
  /usr/local/include/node/openssl/pqueue.h
  /usr/local/include/node/openssl/rand.h
  /usr/local/include/node/openssl/rc2.h
  /usr/local/include/node/openssl/rc4.h
  /usr/local/include/node/openssl/ripemd.h
  /usr/local/include/node/openssl/rsa.h
  /usr/local/include/node/openssl/safestack.h
  /usr/local/include/node/openssl/seed.h
  /usr/local/include/node/openssl/sha.h
  /usr/local/include/node/openssl/srp.h
  /usr/local/include/node/openssl/srtp.h
  /usr/local/include/node/openssl/ssl.h
  /usr/local/include/node/openssl/ssl2.h
  /usr/local/include/node/openssl/ssl23.h
  /usr/local/include/node/openssl/ssl3.h
  /usr/local/include/node/openssl/stack.h
  /usr/local/include/node/openssl/symhacks.h
  /usr/local/include/node/openssl/tls1.h
  /usr/local/include/node/openssl/ts.h
  /usr/local/include/node/openssl/txt_db.h
  /usr/local/include/node/openssl/ui.h
  /usr/local/include/node/openssl/ui_compat.h
  /usr/local/include/node/openssl/whrlpool.h
  /usr/local/include/node/openssl/x509.h
  /usr/local/include/node/openssl/x509_vfy.h
  /usr/local/include/node/openssl/x509v3.h
  /usr/local/include/node/pthread-fixes.h
  /usr/local/include/node/stdint-msvc2008.h
  /usr/local/include/node/tree.h
  /usr/local/include/node/uv-aix.h
  /usr/local/include/node/uv-bsd.h
  /usr/local/include/node/uv-darwin.h
  /usr/local/include/node/uv-errno.h
  /usr/local/include/node/uv-linux.h
  /usr/local/include/node/uv-sunos.h
  /usr/local/include/node/uv-threadpool.h
  /usr/local/include/node/uv-unix.h
  /usr/local/include/node/uv-version.h
  /usr/local/include/node/uv-win.h
  /usr/local/include/node/uv.h
  /usr/local/include/node/v8-debug.h
  /usr/local/include/node/v8-platform.h
  /usr/local/include/node/v8-profiler.h
  /usr/local/include/node/v8-testing.h
  /usr/local/include/node/v8-util.h
  /usr/local/include/node/v8-version.h
  /usr/local/include/node/v8.h
  /usr/local/include/node/v8config.h
  /usr/local/include/node/zconf.h
  /usr/local/include/node/zlib.h
  /usr/local/include/odbcStubs.h
  /usr/local/include/pqStubs.h
  /usr/local/include/tcl.h
  /usr/local/include/tclDecls.h
  /usr/local/include/tclOO.h
  /usr/local/include/tclOODecls.h
  /usr/local/include/tclPlatDecls.h
  /usr/local/include/tclThread.h
  /usr/local/include/tclTomMath.h
  /usr/local/include/tclTomMathDecls.h
  /usr/local/include/tdbc.h
  /usr/local/include/tdbcDecls.h
  /usr/local/include/tdbcInt.h
  /usr/local/include/tk.h
  /usr/local/include/tkDecls.h
  /usr/local/include/tkPlatDecls.h

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
  /usr/local/lib/pkgconfig/tcl.pc
  /usr/local/lib/pkgconfig/tk.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libtclstub8.6.a
  /usr/local/lib/libtkstub8.6.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  docker
  docker-machine
  node

Warning: Your Xcode (7.3.1) is outdated.
Please update to Xcode 8.2.1 (or delete it).
Xcode can be updated from the App Store.

Warning: Broken symlinks were found. Remove them with `brew prune`:
  /usr/local/bin/brunch
  /usr/local/bin/cake
  /usr/local/bin/coffee
  /usr/local/bin/github
  /usr/local/bin/gitx
  /usr/local/bin/jsdoc
  /usr/local/bin/jshint
  /usr/local/bin/json
  /usr/local/bin/lessc
  /usr/local/bin/node-debug
  /usr/local/bin/node-inspector
  /usr/local/bin/sm
  /usr/local/bin/spine
  /usr/local/bin/vue
  /usr/local/bin/webpack
  /usr/local/bin/webpack-dev-server
  /usr/local/share/man/man1/git-lost-found.1
  /usr/local/share/man/man1/git-peek-remote.1
  /usr/local/share/man/man1/git-relink.1
  /usr/local/share/man/man1/git-repo-config.1
  /usr/local/share/man/man1/git-tar-tree.1
MikeMcQuaid commented 7 years ago

@hyperhtml Can you brew update and update your Xcode and try again?

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

DeadZen commented 6 years ago

brew services stop grafana logs me out and doesn't stop grafana...

MikeMcQuaid commented 6 years ago

We do not have enough information to work on this issue.

MikeMcQuaid commented 6 years ago

I'd suggest someone affected create a pull request.

alisajidcs commented 6 years ago

I am facing the same issue. brew services reload and brew services stop is logging me out, and there is no way that i can stop any of my brew services. I am using OS X El Capitan.

MikeMcQuaid commented 6 years ago

Yes, multiple people are facing the same issue: it is not helpful to add that you are also experiencing it. If people have additional information as to what the problem is or e.g. what line of brew services is causing this and ideally can work on a PR to fix it that's useful information. Otherwise: please don't add additional comments here.

DeadZen commented 6 years ago

Ideally you'd ask for more input. I would as I am sure others would respond with more information if you specified what it was you wanted to gather. This is the proper place for comments regarding an improper software function. Let me make it clear this is a major defect. No one should of added services that function in this manner, now the cats out of the bag crapping on everyones computer and probably causing lost work. I would appreciate demonstrating responsibility not demonstrating that you simply hope someone comes along and fixes it. I would try but not until I also have additional information as to what the problem is.

On Thu, Nov 30, 2017 at 4:52 AM Mike McQuaid notifications@github.com wrote:

Yes, multiple people are facing the same issue: it is not helpful to add that you are also experiencing it. If people have additional information as to what the problem is or e.g. what line of brew services is causing this and ideally can work on a PR to fix it that's useful information. Otherwise: please don't add additional comments here.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Homebrew/homebrew-services/issues/134#issuecomment-348137664, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5TbbxIOCuQAcdSET_n04HZe4Oy-dW5ks5s7nrzgaJpZM4PSO22 .

MikeMcQuaid commented 6 years ago

Ideally you'd ask for more input

I do not know what to ask for as we cannot reproduce this issue.

This is the proper place for comments regarding an improper software function.

It's up to the Homebrew maintainers to decide what comments we want and don't want here, sorry.

crapping on everyones computer

No, this is simply not the case. It's not even happening to all El Capitan users let alone all brew services users.

I would appreciate demonstrating responsibility not demonstrating that you simply hope someone comes along and fixes it.

This not is not how open source works. The license for this software states it's available "as is" i.e. with any bugs it will contain. If you don't like that: that's fine and you can use other software instead. I would try to fix this if I knew anything that you all shared in common. As I do not and have no way of figuring that out myself: someone who experiences this problem will have to do some work to help themselves (and, maybe, give me enough information so I can help them).

DeadZen commented 6 years ago

Lol so we're a select group of unlucky users.

I know how Open Source works Sir. I am on El Capitan and not Sierra, which just recently exposed a huge secuity issue with the login prompt. Open Source is where that kind of b.s doesn't happen as badly. The license excludes being litigated as to the perfect function but the Software is checked more, quality is higher, people have more integrity. That is what it is, not a complaint fest and I am sorry if this has become that.

I am willing to help considering I am one of the afflicted and also a programmer. Although I guess I need to go through some onboarding like you would any additional programmer. I can assist in information gathering from other users as well.

On Thu, Nov 30, 2017 at 10:22 AM Mike McQuaid notifications@github.com wrote:

Ideally you'd ask for more input

I do not know what to ask for as we cannot reproduce this issue.

This is the proper place for comments regarding an improper software function.

It's up to the Homebrew maintainers to decide what comments we want and don't want here, sorry.

crapping on everyones computer

No, this is simply not the case. It's not even happening to all El Capitan users let alone all brew services users.

I would appreciate demonstrating responsibility not demonstrating that you simply hope someone comes along and fixes it.

This not is not how open source works. The license for this software states it's available "as is" i.e. with any bugs it will contain. If you don't like that: that's fine and you can use other software instead. I would try to fix this if I knew anything that you all shared in common. As I do not and have no way of figuring that out myself: someone who experiences this problem will have to do some work to help themselves (and, maybe, give me enough information so I can help them).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Homebrew/homebrew-services/issues/134#issuecomment-348219974, or mute the thread https://github.com/notifications/unsubscribe-auth/AA5TbWkGuggzJn4IhDO0fqUUQv_pN4LSks5s7sgLgaJpZM4PSO22 .

-- / Sincerely -------------------------------------------------------------- / Pedram N. - CTO

It is a mistake to look too far ahead. Only one link of the chain of destiny can be handled at a time. - Winston Churchill

MikeMcQuaid commented 6 years ago

Lol so we're a select group of unlucky users.

Yes.

I know how Open Source works Sir.

You do not seem to know how the Homebrew project works.

Sierra, which just recently exposed a huge secuity issue with the login prompt.

That was High Sierra not Sierra.

I am willing to help considering I am one of the afflicted and also a programmer.

Please do.

ghost commented 6 years ago

I have the same problem, Not only mysql but also nginx. PS: my os version is also El Capitan, home brew 1.6

MikeMcQuaid commented 6 years ago

Don't comment on this thread saying you have the same problem. We get that people have the same problem but we don't know how to fix this.

DeadWisdom commented 6 years ago

I was on El Captain 10.11.2 and had this error. Upgraded to 10.11.6, and it is gone. Looks like an deep OS error that Homebrew has little chance to fix or debug.

markoglasgow commented 6 years ago

Hi guys,

Just wanted to report that I had this issue on El Capitan 10.11.1. Upgrading to 10.11.6 fixed the issue. Looks like it's an OS issue and not an issue with Homebrew.

Also wanted to thank MikeMcQuaid for keeping his cool and replying in spite of the hostile reception. Appreciate all the hard work you guys do!