This repository was deprecated and split into two repositories:
- Homebrew formulae/packages: Homebrew/homebrew-core (former contents of
Library/Formula
) - Homebrew package manager: Homebrew/brew
π Manage background services using the daemon manager launchctl on macOS or systemctl on Linux.
License: BSD 2-Clause "Simplified" License
This repository was deprecated and split into two repositories:
Library/Formula
)I'm not sure what's happening internally here, but when I restart MySQL, any changes I make to the launchagent are overwritten. What's the best way to make changes to the plist file that persist between restarts?
Would you be happy to move this repository to the official Homebrew organisation and continue maintaining it there? I've spoken to enough people who want this tool back that I'd love to make it an official tool despite not including it in Homebrew/homebrew.
Description: Ubuntu 14.04.3 LTS
Homebrew 0.9.5 (git revision dc1c2; last commit 2016-04-15)
source code: https://github.com/Linuxbrew/linuxbrew
brew tap homebrew/services
brew info postgresql
command, got the install info:postgresql: stable 9.5.2
Object-relational database system
https://www.postgresql.org/
Conflicts with: postgres-xc
/home/snow/.linuxbrew/Cellar/postgresql/9.5.2 (3,109 files, 36.3M) *
Built from source with: --without-perl
From: https://github.com/Homebrew/linuxbrew/blob/master/Library/Formula/postgresql.rb
==> Dependencies
Required: openssl β, readline β, libxml2 β, libxslt β, util-linux β
==> Options
--32-bit
Build 32-bit only
--with-dtrace
Build with DTrace support
--with-python
Build with python support
--with-tcl
Build with Tcl support
--without-perl
Build without Perl support
==> Caveats
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
Homebrew/legacy-homebrew#2510
To migrate existing data from a previous major version (pre-9.0) of PostgreSQL, see:
http://www.postgresql.org/docs/9.5/static/upgrading.html
To migrate existing data from a previous minor version (9.0-9.4) of PosgresSQL, see:
http://www.postgresql.org/docs/9.5/static/pgupgrade.html
You will need your previous PostgreSQL installation from brew to perform pg_upgrade
.
Do not run brew cleanup postgresql
until you have performed the migration.
brew services list
command, it works:Name Status User Plist
postgresql stopped
brew services start postgresql
command, it failed:sh: 1: list: not found
Error: Could not read the plist for postgresql
!
custom_plist
or something?I love the ease of service management brew services
provided, so Iβm still using the version available at homebrew-boneyard.
Do you plan to maintain this project or should we use version available at core project group?
When doing a brew services stop x
it stops x and removes it from starting on the next boot. Is there a way I can stop a services for my current session only? When rebooting, it starts the services back again?
Systemctl does that already, looking for the same behavior.
From the launchctl(1) man page,
FILES
~/Library/LaunchAgents Per-user agents provided by the user.
/Library/LaunchAgents Per-user agents provided by the administrator.
/Library/LaunchDaemons System wide daemons provided by the administrator.
/System/Library/LaunchAgents OS X Per-user agents.
/System/Library/LaunchDaemons OS X System wide daemons.
Is /Library/LaunchAgents just not a common use case?
β rebyn β brew tap gapple/services
Cloning into '/usr/local/Library/Taps/gapple/homebrew-services'...
remote: Counting objects: 40, done.
remote: Total 40 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (40/40), done.
Checking connectivity... done.
Tapped 0 formulae
β rebyn β brew services start redis
Error: Formula `redis` not installed, #startup_plist not implemented or no plist file found
β rebyn β brew install redis
Error: redis-2.8.13 already installed
To install this version, first `brew unlink redis'
Can I have a lead here :)? -b
or --trace
isn't available as well :(.
Is there a package with bash autocompletion for this package?
Currently only shows the services that are running and available services to run.
plist files written to /Library/LaunchDaemons are empty when opened in an editor.
Services start correctly when using sudo brew services start <service>
but plist files are empty, so daemons are not started on reboot.
OSX 10.11.16
Please provide instructions on how to make an existing formula working together with brew services. I have some formulas which register a plist file in /Library/LaunchDaemons, but these are not listed when I execute brew services list
. What do I need to do?
In a tmux session, when running brew services list
, I get Error: brew services cannot run under tmux!
on OSX Sierra.
This is not the case in El Capitan.
Current behavior: brew services does not work while in a tmux session under OSX Sierra.
Desired behavior: brew services should work while in a tmux session.
I'm having some trouble getting brew services start redis
to work. It seems to have generated a valid LaunchAgents plist, and I'm able to run redis manually by pointing redis-server
at /usr/local/etc/redis.conf
. But running brew services start redis
reports a success without starting redis.
jackwink: dev $ brew services start redis
==> Successfully started `redis` (label: homebrew.mxcl.redis)
jackwink: dev $ brew services list
Name Status User Plist
postgresql started jackwink /Users/jackwink/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
redis started jackwink /Users/jackwink/Library/LaunchAgents/homebrew.mxcl.redis.plist
jackwink: dev $ ps aux | grep redis
jackwink 18306 0.0 0.0 2434840 784 s001 S+ 2:22PM 0:00.00 grep redis
jackwink: dev $
The generated Plist looks as follows:
<?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>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>homebrew.mxcl.redis</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/redis/bin/redis-server</string>
<string>/usr/local/etc/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/redis.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/redis.log</string>
</dict>
</plist>
AFAIK, running a service as root is against best practices because of the security implications. While 99% of brew's use cases are on developers machines, it still feels wrong to run services as root because it is a vector when you forget to stop said services and are on a public wifi, for instance.
Why run as root? Is there an alternative? Unless I'm mistaken, postgres runs under the postgres user when installed from brew and used with lunchy, will it start running as root if I use homebrew-services?
When running as root, you need to add the UserName key to the plist, however, the key is being added when running as local user, and not when running as root, causing almost (if not all) services to fail.
Most of my services are databases or key-value storages, sometimes it is important to easy start all services (for example when I am starting work on project) or stop all services. It it possible out of box?
I just got this message while updating brew:
Warning: Calling Formula.factory is deprecated!
Use Formulary.factory instead.
/usr/local/Library/Taps/gapple/homebrew-services/cmd/brew-services.rb:374:in `from'
Please report this to the gapple/services tap!
So I decided to report it π
In the latest brew info postgresql
, it tells me to use brew services
to start postgresql, does this mean brew services
is maintained by someone now? Thanks!
I use brew-services
and love it but recently I noticed my nginx
server is no longer serving files from localhost:8080
It will serve from 127.0.0.1:8080
Any ideas if this has something to do with running everything from brew-services
?
I've installed all my software with brew
PHP56, mysql, redis, memcached etc and things were working like expected until a couple of brew upgrade
ago.
When I type the command brew services list
,the result of mariadb is :
mariadb error mofeng /Users/mofeng/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
But when I type mysql -uroot
,It can login the mariadb server and work very well.
So why the service show error
,and how to see details about the error message.Thanks!
brew services list
works as expected. brew services
just hangs. When I kill it with Ctrl+C it produces two screens of empty lines.
Since upgrading to OS X 10.11.5 I can no longer start services like httpd22.
brew services start httpd22
results in ==> Successfully started``httpd22``(label: homebrew.mxcl.httpd22)
which is perfectly fine.
However, when inspecting the logs using syslog -k Sender com.apple.xpc.launchd
I noticed the following entries:
May 27 09:48:22 name com.apple.xpc.launchd[1] (homebrew.mxcl.httpd22) <Error>: The UserName key is not supported for non-System services.
May 27 09:48:22 name com.apple.xpc.launchd[1] (homebrew.mxcl.httpd22[22553]) <Warning>: Service exited with abnormal code: 1
The .plist
-file contains the section in question which was perfectly fine prior the update. Anyone experienced anything like that before?
Is it supposed to stop working with the new El Captain security directives?
Should I use sudo to start/stop/restart my services from now on?
$ brew services start redis
Error: Permission denied - /Users/falmp/Library/LaunchAgents/homebrew.mxcl.redis.plist
This error message was added in commit 68c176a.
brew services
can run under tmux, provided reattach-to-user-namespace is run.
Ideally we should either check for an attached namespace, and instruct the user to install the reattach-to-user-namespace
formula if it's not, rather than just exiting the script.
When attached to the namespace brew services
commands work absolutely fine under tmux (I've been using them this way for > 6 months), so we should not disable this working functionality.
Happy to try and submit a pull request myself if no one else is interested.
Hi, is it a good idea to have some kind of command like brew services status $SERVICENAME
? An enhancement to make brew services a bit more like other init-daemons.
I was a bit tired and tried to see the status of a service, so I type brew services status $SERVICENAME
. Unknown command.
Expected behavior would be to return something even as simple as brew services list|grep $SERVICENAME
.
Am I missing something, or could this be a useful enhancement for the future? Thanks!
Preamble:
Have taken to starting all brew related processes with 'sudo brew services' rather than directly with launchctl.
Current output from brew services list
bind started root /Library/LaunchDaemons/homebrew.mxcl.bind.plist
httpd24 started root /Library/LaunchDaemons/homebrew.mxcl.httpd24.plist
mariadb started root /Library/LaunchDaemons/homebrew.mxcl.mariadb.plist
nginx stopped
php70 stopped
proftpd stopped
Issue:
Upon login to system apache fails to start - always.
sudo brew services restart httpd24 fixes this - each time - but is a bit of a pain as all other processes behave as expected.
No error messages, brew doctor is clear etc. No obvious clues!
Only difference I can see is in the preferences of the relevant .plst file itself.
All are -rw-r--r--
httpd24 is -rw-------
Is this correct?
Is this startup behaviour of httpd24 actually an issue or am I just missing something.
Many thank in advance for any help given.
Oh yes - have disabled default OSX (Sierra) apache service (lanuchctl -w etc)
Regards.
FC
Example:
(dev) ilarionov@1078-ilarionov:~$ brew services list
chromedriv started 40792 /Users/ilarionov/Library/LaunchAgents/homebrew.mxcl.chromedriver.plist
postgresql started 40661 /Users/ilarionov/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
redis started 40627 /Users/ilarionov/Library/LaunchAgents/homebrew.mxcl.redis.plist
where chromedriv
is actually chromedriver
.
If I'm not completely off it seems like all the commands complete successfully even if the target service isn't installed, as long as it is a valid brew service.
Example (I don't have RabbitMQ installed):
brew services start
successfully creates the plist
, but it doesn't seem like it checks that the target program actually starts.
how can i make my nintendo 3ds a compatible version?
I have a huge error report while running brew services starting with "Error: ERROR: Failed to build gem native extension." could you help me? I attached the file
log.txt
Error:
$ brew services start osquery
/Users/simonweil/Library/LaunchAgents/homebrew.mxcl.osquery.plist: Invalid property list
==> Successfully started `osquery` (label: homebrew.mxcl.osquery)
$ brew services list
Warning: No user-space services controlled by `brew services` running...
$
Hi,
I'd like to view logs for a service running under brew services. Where do STDOUT and STDERR end up?
In particular;
start Start service(s)
stop Stop service(s)
seem to imply you can supply them a list of services, which is not the case, the only plural case is --all
, but that is only really made clear in the more man
-style help text in the source code.
It seems like either the start and stop commands should accept a list (probably unlikely, given the "custom plist" functionality already present there!) or the help text should not imply plurality, or include the more helpful command signature from the header of the file.
I'd be happy to supply a PR if desired!
Would it be possible to use brew services for Caddy?
There are unresolved issues against brew services
that were logged in the main homebrew repository, and even some pull requests.
Several issues are available through references in Homebrew/legacy-homebrew#28657
I installed mysql via brew and I saw that it was working yesterday by list command;
brew services list
But today I see that mysql service has the "error" state even though it looks like it works without a problem.
Now how can we see why brew list says there is an error and how do we see the details of this "error" state?
how can i make my nintendo 3ds a compatible version?
I am running homebrew (Homebrew 0.9.9, git revision 898cb; last commit 2016-05-25) on 10.11.5 (15F34).
Starting yesterday the call to brew services list
throws an error:
Error: / is not inside a keg
I removed all homebrew-related *.plist files and retried, but the error persists.
Do you have any insight or idea what this error points to?
sudo brew services start
incorrectly adds UserName to the services' launchd plist. This breaks services such as dnsmasq
, which need to run as root in order to bind ports, etc.
See also earlier PR, which includes a proposed fix: Homebrew/legacy-homebrew#26214
I'm having trouble with starting services via brew services start
command.
Tried this on 2 clean OSs: Yosemite and El Captain with the same result.
So I have fresh install of given services:
$ brew services list
Name Status User Plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
elasticsearch17 stopped
mongodb stopped
mysql56 stopped
php56 stopped
redis stopped
Every time I try to start any of it I get:
$ brew services start redis -vvv
==> Generated plist for redis:
<?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>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>homebrew.mxcl.redis</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/redis/bin/redis-server</string>
<string>/usr/local/etc/redis.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/var</string>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/redis.log</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/redis.log</string>
</dict>
</plist>
/bin/launchctl load -w /Volumes/Users/kuba/Library/LaunchAgents/homebrew.mxcl.redis.plist
/Volumes/Users/kuba/Library/LaunchAgents/homebrew.mxcl.redis.plist: Path had bad ownership/permissions
==> Successfully started `redis` (label: homebrew.mxcl.redis)
Problem is that permissions and ownership looks good to me...
$ ls -al /Volumes/Users/kuba/Library/LaunchAgents/
total 16
drwxr-xr-x 2 kuba staff 136 Jul 13 01:57 .
drwx------@ 29 kuba staff 986 Jul 13 00:56 ..
-rw------- 1 kuba staff 785 Jul 13 01:57 homebrew.mxcl.redis.plist
-rw-r--r--@ 1 kuba staff 677 Jul 13 01:02 org.virtualbox.vboxwebsrv.plist
According to brew doctor
- I'm ready to brew...
On other machine I have, everything is working fine with same permissions and ownership...
Problem is this is a clean install... and I've tried this on two different OSs (first on El Captain then on Yosemite) with exact same results...
Any ideas what's wrong ?
Not 100% this is a services issue, but I have stripped down and reinstalled brew, ruby and more and it's still doing it.
When I run brew services start (mysql|httpd22)
I get the following error:
Error: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-apple-darwin14.3.0/ports/libxml2/2.8.0... OK
Running 'compile' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-apple-darwin14.3.0/ports/libxml2/2.8.0/compile.log' to see what happened.
/Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:265:in `block in execute': Failed to complete compile task (RuntimeError)
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `chdir'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:257:in `execute'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:69:in `compile'
from /Library/Ruby/Gems/2.0.0/gems/mini_portile-0.5.2/lib/mini_portile.rb:109:in `cook'
from extconf.rb:101:in `block in <main>'
from extconf.rb:119:in `call'
from extconf.rb:119:in `block in <main>'
from extconf.rb:109:in `tap'
from extconf.rb:109:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.1/gem_make.out
I am not using system Ruby or the system gempath, yet this keeps referencing gems in the system gem path. It mentions nokogiri but I don't use that nor have it installed.
My $PATH, which you can see sets the correct ruby path:
/Users/scott/.rvm/gems/ruby-2.2.2/bin:/Users/scott/.rvm/gems/ruby-2.2.2@global/bin:/Users/scott/.rvm/rubies/ruby-2.2.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/scott/.rvm/bin:/Users/scott/.npm-packages/bin:/usr/local/sbin:/Users/scott/.rvm/bin
I found every time I use the brew service start/restart the file(~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist) will be covered by the original file(/usr/local/Cellar/jenkins/homebrew.mxcl.jenkins.plist), so I can not change the ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist.
See previously written completions at ohmyzsh/ohmyzsh#4313
This requires a core change, which is tracked at Homebrew/brew#1184
If you do sudo brew services start ...
it creates a plist in the "/Library/LaunchDaemons/" directory, but that plist doesn't have the UserName specified. If you manually add the UserName setting to that plist, restarting the service erases your changes.
I want an option to specify a user to run a global launch daemon with. In particular, I want to run elasticsearch at startup, but it doesn't run properly if you run it as root.
Hi,
I've just installed artifactory and tried to start it but i'm getting the following error:
brew services start artifactory
~/Library/LaunchAgents/homebrew.mxcl.artifactory.plist: Invalid or missing Program/ProgramArguments
<?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>Label</key>
<string>homebrew.mxcl.artifactory</string>
<key>WorkingDirectory</key>
<string>/usr/local/Cellar/artifactory/4.7.7/libexec</string>
<key>Program</key>
<string>bin/artifactory.sh</string>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>nick</string>
</dict>
</plist>
-rw------- 1 nick staff 510B 22 May 15:01 homebrew.mxcl.artifactory.plist
Everything looks fine, not sure why this is happening. I've tried starting it manually:
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.artifactory.plist
~/Library/LaunchAgents/homebrew.mxcl.artifactory.plist: Path had bad ownership/permissions
no luck there either. I even tried to change ownership to root and change permissions to 600 with difference.
Copied from Homebrew/legacy-homebrew#27024
I was able to see this in action by installing PHP 5.5.19 a little while ago and brew update
had an available formula for 5.5.20 that I did not install. brew services
attempts to load the service.plist
from Formula.factory(@formula)
(here)[https://github.com/gapple/homebrew-services/blob/master/cmd/brew-services.rb#L126]. When this happens, the older installed version's plist_path is never shown, instead, the not-installed version's plist_path is shown.
The end result is that if you ever run brew update
and formula that have services-managed plists are updated but you don't upgrade, brew services
will cease to work.
I spent some time looking at this but was stuck- instead of looking at the most recent formula, which may not even be installed, can we look for the plist of the most-recently installed version on disk?
I am trying to restart nginx using brew services restart nginx
running that command gives the following result:
Warning: Calling Formula.factory is deprecated!
Use Formulary.factory instead.
/usr/local/Library/Taps/homebrew/homebrew-services/cmd/brew-services.rb:169:in `run!'
Please report this to the homebrew/services tap!
Stopping `nginx`... (might take a while)
==> Successfully stopped `nginx` (label: homebrew.mxcl.nginx)
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
which broke something,
and then when I try to access those url configured in nginx config file. I get
This site canβt be reached
localhost refused to connect.
Search Google for localhost 4200
also then when I ran this command brew services list
to see the services which are running
it display a list of this warning:
Warning: Calling Formula#startup_plist is deprecated!
Use Formula#plist instead.
/usr/local/Library/Taps/homebrew/homebrew-services/cmd/brew-services.rb:374:in `plist?'
Please report this to the homebrew/services tap!
and shows that nginx is running.
But if nginx is running why I can't access the url ?
Please look at this issue, I was able to access the url before and it stopped suddenly when I tried to restart nginx
I've noticed that if you start a service and that service fails, that brew services
does not report this. This is confusing to users who think that it has succeeded.
The status appears to be available via launchctl list
:
$ launchctl list | grep home
805 0 homebrew.mxcl.elasticsearch
810 0 homebrew.mxcl.kibana
817 0 homebrew.mxcl.kafka
824 0 homebrew.mxcl.zookeeper
- 78 homebrew.mxcl.postgresql
807 0 homebrew.mxcl.redis
Here, postgres has failed to start, but this is not reported.
As result of Homebrew/brew#233, brew services list
now outputs many warnings (dependent on the number of installed brews).
I'm confident these warnings are intentional so that deprecated #startup_plist
usage is rooted out.
Call to #startup_plist
that causes the warning via #opoo
Remove the forth term, !formula.startup_plist.nil?
, from the expression in the causing line.
Apologies for not also submitting a PR for this simple issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.