launchctl is an interface to OS X' launchd system to load or unload daemons or agents.
Questions tagged [launchctl]
76 questions
29
votes
8 answers
Can’t launch daemon with launchctl in Yosemite
I have a launchd daemon placed in ~/Library/LaunchAgents that worked well in Mavericks. But it won’t start in Yosemite public beta. The daemon plist is like this (my username is darksair with UID 501)
MetroWind
- 581
- 1
- 8
- 15
28
votes
5 answers
Setting environment variables in OS X for GUI applications
How does one set up environment variables in Mac OS X such that they are available for GUI applications without using ~/.MacOSX/environment.plist or Login Hooks (since these are deprecated)?
Percival Ulysses
- 621
24
votes
5 answers
How do I start nginx on port 80 at OS X login?
I installed Nginx using homebrew and after completing the installation the following message was displayed:
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your…
Bryson
- 431
12
votes
2 answers
How to start a service using Mac OSX's launchctl
Why does my configuration plist file not load as a service using launchctl?
I am running OSX Yosemite, and I have read this excellent tutorial on using launchctl http://nathangrigg.net/2012/07/schedule-jobs-using-launchd/
I have created a correct…
almel
- 241
12
votes
1 answer
launchctl unload say: Could not find specified service
I'm trying to make a plist file in order to start nginx on boot. When starting nginx with launchctl it starts the service. But it cannot unload it, and print "Could not find specified service".
$ ps aux | grep nginx
me (...) grep nginx
$ sudo…
Benj
- 221
9
votes
1 answer
launchd seems ignore StartCalendarInterval on Yosemite
I tried to update Homebrew on time with launchd. My plist file is presented here:
Minsheng Liu
- 293
9
votes
4 answers
How do I increase the max open files in macOS Big Sur?
I have heard
sudo launchctl limit maxfiles 64000 unlimited
And
conf=/etc/sysctl.conf
if sudo cat $conf | command rg kern.maxfiles ; then
ecerr "kern.maxfiles is already set in $conf"
else
sudo echo…
HappyFace
- 1,389
7
votes
2 answers
OS X: LaunchDaemon not running: Service could not initialize
I used Apple's seemingly straightforward docs to create a LaunchDaemon to run a Node.js script I wrote.
Here's the plist file. It's basically exactly a copy-paste from Apple's docs, set to run every 300 seconds:
nickcoxdotme
- 201
7
votes
1 answer
Mac os x 10.7.4 process limit
I have a 709 max user process. I want to double it, or more.
First: ulimit
> ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory …
Marcel Falliere
- 173
7
votes
2 answers
Launchctl: how can I configure a service to stop restarting automatically until next reboot?
I have several services set up in launchctl and they all start at boot and restart automatically whenever they stop for any reason. That's great so far.
But sometimes I want one of the services to quit and not restart for a while.
Is there a…
Andrew J. Brehm
- 5,342
5
votes
1 answer
Increasing Yosemite maxfile limit for Application
I've been trying to up the maxfile limit and maxfileperproc limit on Yosemite, with no luck. I have created a sysctl.conf file in the etc folder, which has successfully increased the values when displayed via grep.
However, if I look at launchctl…
toadstool333
- 51
4
votes
2 answers
launchctl: Dubious ownership on file (skipping) (Mac OS X)
I installed mysql recently and added its start command in my .bash file. But when I tried running the command, that's when I encountered this error:
launchctl: Dubious ownership on file
(skipping):
…
picardo
- 2,607
4
votes
0 answers
Increase number of open files in mac high sierra
On a mac high sierra 10.13.3 I have 256 open files.
I want to raise it and I open a terminal and enter
sudo launchctl limit maxfiles 1000000 1000000
This doesnt change anything when I enter
ulimit -a
I still get 256
But it does change something,…
Bick
- 519
- 5
- 8
- 19
4
votes
1 answer
unable to load script via launchctl "command not found"
I have a problem loading a script to watch a folder via fswatch in /Library/LaunchAgents
The script runs fine when run from terminal, but via my plist, it gives me "Command not found" for fswatch in the log.
I bet it has to do with where the script…
jan
- 219
3
votes
0 answers
Start Appium server at system boot (MacOS)
I'm trying to setup Appium server to stat automatically after system startup. Also I'd like it to restart after a crash. Appium was installed as a npm package and it launches and works fine when I type "appium" in terminal.
So, what I did is created…
al0
- 31