Questions tagged [launchctl]

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

27 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
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
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
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
2 votes
1 answer
895 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
632 views

Start SSH Server without typing a password - Sudoers (NOPASSWD)

I would like to execute the below command line without typing a password sudo -s /bin/launchctl load -w /System/Library/LaunchDaemons/ssh.plist So I tried to add the below lines to my sudoers but ...
David's user avatar
  • 21
1 vote
0 answers
40 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
251 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
1 vote
0 answers
100 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
1 vote
0 answers
544 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
0 answers
180 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
1 vote
0 answers
335 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
1 vote
0 answers
117 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
866 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
1 vote
2 answers
720 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
1 vote
1 answer
775 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
1 vote
2 answers
729 views

launchctl - use rvm instead of system Ruby in executed scripts?

I have a launchctl job I define as such: <key>ProgramArguments</key> <array> <string>/bin/sh</string> <string>-c</string> <...
Stefan Kendall's user avatar
1 vote
0 answers
450 views

Why is launchd (launchctl) on Mac OS X 10.6.8 on a Mac Pro preserving launch time values across reboots?

I've created a .plist with a StartCalendarInterval key for a program that must run once a day. It works, and I'm satisfied. I've also created a python script that reads a config file and will re-run ...
W. R. Wing's user avatar
1 vote
1 answer
1k views

How can I periodically run a shell command using launch agents on Mac OS X?

We have a Kerberos single-sign-on system in our company. This means that I can just type kinit user@DOMAIN in the terminal, and then I can access all IT resources like file servers, internal wiki, svn ...
Jakob Egger's user avatar
0 votes
1 answer
48 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
0 votes
1 answer
198 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
0 votes
1 answer
337 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
0 votes
1 answer
232 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
0 votes
2 answers
519 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
0 votes
0 answers
58 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