Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [launchctl]

launchctl is an interface to OS X' launchd system to load or unload daemons or agents.

Filter by
Sorted by
Tagged with
0 votes
1 answer
69 views

Is there any way to prevent a non-admin user from executing "launchctl unload" on macOS?

I started using a well-known program for self-control on MacOS called Cold Turkey. This program is very powerful, but it's not enough since I can open a Terminal as a non-admin user and execute the ...
Alfred's user avatar
  • 11
1 vote
1 answer
337 views

macOS - Running a plist script before boot up

The left option (alt key) of the MacBook is always pressed - not mechanically, but I guess it is generating the key press event. The on-screen keyboard shows the option key is pressed (has red border)....
Thiyagu's user avatar
  • 171
1 vote
0 answers
42 views

Where are the files generated from a binary launched using launchd?

I am trying to setup a cron job using launchd, seemed quite straight forward with systemd on linux, but on mac, even though I have the process running (it is a local server, and I can confirm the API ...
nsrCodes's user avatar
  • 155
1 vote
0 answers
260 views

How do I link a shell script to the login / logout event on a Mac so that it triggers when a user logs on / off?

I have been trying to get a shell script to fire on login / logout events on a Mac, but the method I used is very old, and it does not work. I followed this StackExchange post and used the sudo ...
Umbrella_Programmer's user avatar
0 votes
1 answer
3k views

Launchctl says my launch agent has already been bootstrapped, but it didn't run when expected and I also can't kickstart it. What's wrong?

So I have a launch agent plist that's supposed to run every Monday and then it runs an executable file named sync-stuff.sh, which in turn dumps a Brewfile with brew bundle dump --force in a very ...
Evert's user avatar
  • 131
1 vote
0 answers
104 views

launchctl print system printed "external activation count = 1" and "in-progress bootstraps =1"

I've been investigating an interesting user account that showed up after installing Red Giant Software called _redgiantservice. I used the following command to investigate the user id: launchctl print ...
h4cksh0t's user avatar
7 votes
4 answers
28k views

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 ...
HappyFace's user avatar
  • 1,231
1 vote
1 answer
2k views

How to find and remove a LaunchAgent which has no .plist

My macOS (v11.2.1) has a number of undesirable LaunchAgents loading with the system, which bloat it. Some of them I was able to successfully remove (just by finding their .plist.) However, for some ...
andrelmsantos's user avatar
0 votes
1 answer
199 views

How to run `say` at a specified time with `at` on macOS?

Running echo "say hello" | at now+1 on macOS should enqueue a task to be executed one minute in the future: saying hello. Issuing say hello works fine, as does echo "touch a-file" |...
Jonathan Ginsburg's user avatar
2 votes
1 answer
511 views

Where is OS X saving launchctl changes

I'm activating my AFP-Server in OSX with: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist It is running now, but I'm wondering because the file contains no ...
Mutti's user avatar
  • 21
0 votes
1 answer
1k views

plist and status - "127 The specified service did not ship with the operating system"

I'm trying to get a script to run via launchd, but I keep getting a status of 127 after I load it. I've checked ownership, permissions and absolute paths etc of both plist and script. I'm running it ...
James's user avatar
  • 1
12 votes
1 answer
13k views

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 ...
Benj's user avatar
  • 221
2 votes
2 answers
1k views

How to schedule a run of “docker-compose,” on MacOS, using launchd

I'm building some software with docker-compose, for which I would like to run on a schedule. So I need to schedule a run of docker-compose up, on MacOS (High Sierra, 10.13.3), using launchd. This is ...
Nutritioustim's user avatar
1 vote
1 answer
5k views

Remove build in Apache httpd on macOS (OSX)

I have a Mac Mini running a private server from home. It is running macos High Sierra (osx) and and previous used "Apple Server" to manage my websites (using the build in apache httpd). But since ...
Ricki Runge's user avatar
2 votes
1 answer
1k views

OS X: Agent/Daemon shows up in launchctl list, but cannot find its .plist

I've been having this issue for quite some time now. It doesn't really hurt my workflow, but every time I want to look for something in the console, it gets in the way, since there's the following ...
thanar's user avatar
  • 21
4 votes
0 answers
5k views

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 ...
Bick's user avatar
  • 519
0 votes
1 answer
285 views

launchctl print system printed "bootcache hack" and "exec hack" results

I used the following command to list launchctl facilities, and at the very end of the print out were some interesting results: command used: launchctl print system end of results: properties = ...
cocanut's user avatar
0 votes
1 answer
339 views

Is it possible to use com.apple.CalendarAgent.plist to open a third-party Calendar app?

From what I understand, MacHD/System/Library/LaunchAgents/com.apple.CalendarAgent.plist handles calendar requests and opens them in the default MacOS calendar (calendar.app). I am wondering if it's ...
spamdawg's user avatar
2 votes
1 answer
1k views

How can I stop a launchd service?

I have a launchd service with label homebrew.mxcl.postgresql: $ launchctl list homebrew.mxcl.postgresql { "LimitLoadToSessionType" = "Aqua"; "StandardErrorPath" = "/usr/local/var/log/postgres....
jameshfisher's user avatar
  • 1,442
1 vote
0 answers
546 views

Using Launchd for an Applescript Application

I created an Applescript Application (called Print Release) that runs without issue (code below): do shell script "rm -R /Users/<account>/release.zip; rm -R /Users/<account>/release; curl ...
krees's user avatar
  • 33
1 vote
1 answer
1k views

Unable to kill process, launchctl unload/remove failed

I have a process running in the background from a trial I once had installed (Bitdefender Antivirus). I tried uninstalling it but there's some parts that I did not manage to get off my computer. Here'...
dschau's user avatar
  • 11
1 vote
0 answers
104 views

Tracking launchtl locate database creation

I'm running the locate command to look for a file on MacOS and I get a warning that locate.database needs to be created with a certain command. I noticed it takes quite a while to build the database ...
DogEatDog's user avatar
  • 113
1 vote
1 answer
1k views

I can't seem to resolve java.io.FileNotFoundException (Too many open files in system)

Disclaimer. First I am NOT a SU. I'm a mid level computer user with a bit of experience. I can write some basic code, have used computers for 20+ years. MSDOS, to Windows through the years now I'm ...
robster's user avatar
  • 111
1 vote
0 answers
184 views

LaunchAgents: Launch App as root

I'm doing a kiosk app for osx. there was a previous version of this app working on OSX 10.8, but the computers got updated and now the app isn't working properly. i need to avoid user can kill the ...
moscoquera's user avatar
0 votes
1 answer
236 views

Redis will not start via bitbar / brew services start

Trying to get redis managed via bitbar's brew services plugin, I cannot; it silently fails, and running brew services start redis also silently fails. Equally, brew services list shows it as started, ...
user208769's user avatar
1 vote
0 answers
345 views

Restart a daemon without root in OSX

On OSX 10.10 I created a plist file in /Library/LaunchDaemons/ to start at launch an OpenVPN connection. However I encountered DNS problems when going from an internet interface to another (as WiFi to ...
PaulCo's user avatar
  • 111
3 votes
1 answer
4k views

launchctl starts program but does not list pid

I have been troubleshooting this issue for a while now. Consulted the web, several stackexchange platforms and discussion forums. Here is my problem description: Usecase: I have naviserver installed ...
Mike F's user avatar
  • 133
1 vote
2 answers
3k views

MongoDB homebrew launchctl not working (OS X El Capitan)

Steps: brew update brew install mongodb ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist mongo Output: MongoDB shell ...
tdc's user avatar
  • 115
4 votes
1 answer
7k views

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 ...
jan's user avatar
  • 203
1 vote
0 answers
118 views

mysqldump via launch daemon on mac osx not working

I'm trying to create a mysqldump of a database via bash script, and automate the process by using Mac's launchd / launchctl process. I can successfully run the bash script manually to backup the db in ...
mheavers's user avatar
  • 237
1 vote
1 answer
874 views

OSX/launchctl: How do I open a specific website in a new instance of chrome in the foreground every morning?

Requirements: Specific website Every morning despite laptop being closed overnight (launchctl can handle this) Foreground - must come to my attention, even if I have multiple spaces/desktops ...
barrrista's user avatar
  • 1,729
2 votes
2 answers
16k views

How to kill mysql with moving pid

I have multiple mysql instances running on OSX 10.10. /usr/local/mysql/bin/mysqld stop spits out a bunch of warnings and errors, I'm not sure if they're worth sharing. Here's the first error 16164 [...
icicleking's user avatar
2 votes
1 answer
898 views

Cannot get docker-machine to start using launchctl on OSX

I am trying to start docker-machine using a launchctl. I have install docker-machine using the docker toolbox. Here is my plist file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist ...
Michael Barton's user avatar
2 votes
1 answer
2k views

Launchctl - submit command instead of executable

I know it's possible to submit the path of a program to launchd via launchctl submit -l label [-p executable] [-o path] [-e path] -- command [args] But is it also possible to pass a command ...
Zocker3333's user avatar
7 votes
2 answers
17k views

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 ...
nickcoxdotme's user avatar
3 votes
0 answers
679 views

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 ...
al0's user avatar
  • 31
12 votes
2 answers
48k views

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/...
almel's user avatar
  • 241
1 vote
1 answer
635 views

Starting Suricata with launchctl on Mac OS X

Using Mac OS X Yosemite 10.10.3. I'm trying to make Suricata start in daemon mode on boot with launchctl. Here is my /Library/LaunchDaemons/org.suricata.Suricata.plist: <?xml version="1.0" ...
drew1kun's user avatar
  • 2,147
0 votes
2 answers
520 views

Unable to remove peruser launchd process

I am constantly getting the following messages in system log: com.apple.launchd.peruser.0 (homebrew.mxcl.memcached[PID]) Exited with code : 64 com.apple.launchd.peruser.0 (homebrew.mxcl.memcached) ...
Ranster's user avatar
1 vote
2 answers
3k views

Killing a launchctl process: Cassandra

I used launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist and it launches Cassandra if not started already. ps aux | grep cassandra tells me Cassandra is running and I kill the ...
Prashant's user avatar
  • 1,433
0 votes
2 answers
2k views

Xquartz stopped working on Maverics. Cannot install a valid X11 forwarding

I'm having trouble with XQuartz on Mavericks. After I went to apple genius support to change my battery (in which the genius guy forced power off when I had an X11 connection opened), I am having the ...
Werner's user avatar
  • 225
5 votes
1 answer
6k views

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 ...
toadstool333's user avatar
1 vote
2 answers
723 views

OS X: Run script at Login screen with FileVault on

How to run a script at Login screen (BEFORE user types password to log in)? I have tried launchctl and place the script under both: /Library/LaunchDaemons/ /Library/LaunchAgents/ Still the script ...
An Phung's user avatar
  • 363
9 votes
1 answer
2k views

launchd seems ignore StartCalendarInterval on Yosemite

I tried to update Homebrew on time with launchd. My plist file is presented here: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www....
Minsheng Liu's user avatar
0 votes
1 answer
3k views

OS X: Unload process from launchctl

I need to stop collectd for a while. I can see it's running: ps axuw | grep collectd user 73543 0.0 0.0 2540860 1900 ?? S 4:15PM 0:00.26 /usr/local/Cellar/collectd/5.4.0/sbin/...
hdf's user avatar
  • 245
29 votes
8 answers
65k views

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 ...
MetroWind's user avatar
  • 561
0 votes
0 answers
59 views

com.user.loginscript[ ]): Exited with code: 1

Whenever we restart our server it changes our DNS and apache settings. I haven't been able to figure out why, so I wrote a quick script to restore these to safe settings on login to fix Mac OS X ...
glenstorey's user avatar
1 vote
1 answer
787 views

terminal-notifier fails silently when called from launchd

I've created a script to update my package manager and post a notification via terminal-notifier. When run manually, it works fine, but when called via launchd (local to the user, in ~/Library/...
user3145309's user avatar
0 votes
1 answer
1k views

How to start a plist agent running as root at boot

I have installed nginx via homebrew, by default it provides a plist which is symlinked from ~/Library/LaunchAgents and running launchctl load ~/Library/LaunchAgents/nginx.plist starts nginx as my user ...
Jonny Barnes's user avatar
0 votes
1 answer
278 views

Using ruby application in launchctl scripts

In OS X, I am trying to create a script invoked automatically by launchctl. This script will invoke ruby application (jabber-tee and terminal-notifier) installed with gem. Her is my python script. #...
plcstpierre's user avatar