What is the meaning yellow service “started” status on Homebrew?

前端 未结 6 2001
抹茶落季
抹茶落季 2020-12-29 00:46

When I tried brew services list command, dnsmasq, nginx status started but yellow. php71 and mysql is started and green.

Previously when my Mysql statu

相关标签:
6条回答
  • 2020-12-29 01:23

    Unfortunately the yellow color means status unknown. Wonder why it says started though.

    I just found out because the status for apache 2.2 on OS X 10.11.6 is yellow as well. Don't know if it's actually working properly.

    Here's what the homebrew-services ServicesCli code says

    # For backwards-compatability showing unknown state as started in yellow colour

    https://github.com/Homebrew/homebrew-services/blob/6e7ea0cff515df8b5d53a6e3066e16cf5e94d03a/lib/services_cli.rb#L147:L159

    EDITS: Update code reference. Thanks @SidOfc

    0 讨论(0)
  • 2020-12-29 01:24

    I had this just now for mariadb, and solved it by running brew reinstall mariadb.

    I had just installed a new version of MAMP and I suspect something of MAMP had overwritten something related to mariadb.

    0 讨论(0)
  • 2020-12-29 01:26

    One cause for the yellow, indiciating an error, is that the Postgres version updated when you ran brew upgrade.

    To see if this is the case, run tail /usr/local/var/log/postgres.log and check if you have an error like The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.3

    In this case, our data files are v11, but postgres is now v12, so to use the old version:

    mv /usr/local/var/postgres /usr/local/var/postgresql@11
    brew services stop postgres
    brew install postgresql@11
    brew link --force postgresl@11
    brew services start postgresql@11
    
    0 讨论(0)
  • 2020-12-29 01:28

    The following steps worked to solve this for me:

    1. Remove the postmaster.pid file for your service (i.e. rm /usr/local/var/postgres/postmaster.pid).

    2. Restart your service on homebrew (i.e. brew services restart postgresql).

    0 讨论(0)
  • 2020-12-29 01:28

    I think its yellow for the apps that are started by the root user. If you type sudo brew services list you get every app that's started by root as green, and the ones that are started by other users as yellow.

    0 讨论(0)
  • 2020-12-29 01:45

    If your configuration can make the service run as either daemon or non-daemon, do not make it daemon.

    I found the yellow status when I configured daemon in haproxy.cfg. After I removed daemon in the configuration and restarted it (including killing the process, as brew does not really know which process to stop in the daemon mode of haproxy), HAProxy showed the bright green ‘started’ status. And I can now really stop it with brew services stop. :-)

    0 讨论(0)
提交回复
热议问题