Questions tagged [launchd]
A system for starting, stopping, and managing automated processes.
760
questions
1
vote
1
answer
50
views
How to register some program "at login" for all users on macOS
I know I can use "Service Management" (SMAppManager) for the current user [or do the equivalent action via setup], but it only registers at login for the current user, but I need my app to ...
1
vote
1
answer
82
views
Cannot ssh into machine?
I have a Mac that for some reason I cannot manage to ssh into anymore. I'm completely stumped and am looking for ideas of what to try next (short of reinstalling the whole system). I've tried the ...
6
votes
1
answer
945
views
Trying to kill a malicious launchd process
I've got a malicious process which I'm trying to remove. I've tried the following but each time it gets regenerated/restarted:
kill -9
deleting the plist file
launchctl disable
launchctl unload
Is ...
0
votes
0
answers
63
views
How to mount external SSD with encrypte APFS volume very early during boot?
I have an external SSD connected to my MacBook Pro (2021, M1, macOS Vetura). On the external drive is an encrypted APFS partition. I installed some huge applications to that external drive to save ...
0
votes
0
answers
13
views
LaunchCtl Access script in library folder
I have this launchctl item which runs every day to backup some config files. The script is located in my Dropbox folder. It use to work. However, since Dropbox is now located at ~/Library/...
0
votes
0
answers
124
views
Disable Siri fully via terminal Ventura
What is the latest way to disable Siri via Terminal on Ventura? I'm ok to do SIP disable and re-enable later.
I have tried
sudo plutil -replace Disabled -bool true /System/Library/LaunchAgents/com....
0
votes
0
answers
63
views
On Ventura, running rsync from launchd gives permissions error
This problem is similar to questions at the following:
rsync errors, but only when run in launchd
rsync "Operation not permitted (1)" error only when run in launchd
Permissions errors when ...
9
votes
3
answers
1k
views
How to increase global max opened files limit on OSX 13.5 Ventura
I already had configured max opened files limit and it worked fine until I updated to Ventura 13.5. The limit is reset to default value now.
I tried to follow answer from this question: How to ...
0
votes
0
answers
53
views
launchctl agent not starting jobs that involve external volumes
I am new to lanuchctl. On my Mac running macos-ventura, I have created several plists that all load fine but will not run (neither by launchctl start nor by specifying RunAtLoad in the plist.
(Thanks ...
0
votes
1
answer
28
views
Script can access SQLite database in ~/Library when run from Terminal, but not when run from launchd
I have a script that processes my screen time data using the SQLite database /Users/USERNAME/Library/Application Support/Knowledge/knowledgeC.db. The script runs fine when I launch it manually via ...
0
votes
0
answers
195
views
Possible method to mount a Linux SMB share on macOS Ventura before user login
I am trying to mount a Linux SMB share onto a macOS machine running Ventura 13.4. I must have the share mounted after the macOS machine bootup is completed, but before any possible user has logged ...
3
votes
2
answers
101
views
Can I use the output of a shell script to set env vars from launchd?
I'm using launchd to set an env var at startup using launchctl setenv.
The script works fine when the variable is hardcoded in it, but unfortunately I need to get this variable dynamically at startup ...
3
votes
1
answer
717
views
"financed" process in Activity Monitor
I noticed a process in Activity Monitor called financed. If I turn on the Kind column it shows "Apple" but so do all the other processes. If I use the hierarchical view no parent or children ...
1
vote
1
answer
127
views
How can I prevent SubmitDiagInfo from using high CPU?
I have a problem where the process SubmitDiagInfo uses high CPU on an regular basis (see screenshot). Killing the process and restarting the computer has no effect.
I tried unloading the service ...
0
votes
1
answer
83
views
launchd exit status "-9"
I have a couple of launchd jobs starting a rsync wrapper script. They have been running fine for at least 3 years, but now most of them fail with exit status -9. All jobs are configured like this (...
0
votes
0
answers
226
views
How to suspend/kill ptpcamerad?
The ptpcamerad process is preventing a python script from accessing a connected DSLR by not allowing use of the usb ports. I would like to know how to suspend or kill the process without it ...
0
votes
1
answer
51
views
My launchd daemon wasn't in launchctl list when I checked! [duplicate]
The "sweep" daemon job that I developed in Is there an easy way to automatically schedule a move of files matching a certain pattern from a user directory to a USB drive? and What went wrong ...
0
votes
0
answers
53
views
Can't change system limit with launchctl anymore [duplicate]
I have a launchctl service
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/...
0
votes
1
answer
123
views
What went wrong with my launchd plist?
I set up a launchd plist to run a shell script every morning at 8 AM
(see Is there an easy way to automatically schedule a move of files matching a certain pattern from a user directory to a USB drive?...
1
vote
0
answers
16
views
How to run a cron job using launchd? [duplicate]
I have a simple cron job:
MAILTO=“”
0 9 * * * /path/to/job
My issue with this job being that it won’t run if my Mac isn’t up and running (sleep mode). I read launchd/launchctl may be what I’m looking ...
2
votes
0
answers
61
views
Setting global/system variable visible from JVM in console and Eclipse
How to define global/system variable in OSX latest versions (Monterey/Ventura) that should be visible from console (JVM) and IDE (preferable Eclipse, IntelliJ has special knowledge how to handle this ...
0
votes
0
answers
231
views
Run sshd from Homebrew instead of Ventura's
The ssh from Ventura 13.3.1 is rather old (OpenSSH_9.0p1); the version I installed from Homebrew is OpenSSH_9.3p1.
The problem is: How can I achieve that sshd from Homebrew is run on startup instead ...
1
vote
0
answers
75
views
Where are the logs for Homebrew service `dnscrypt-proxy`?
Where are the logs for the dnscrypt-proxy Homebrew service?
There are no logs in these directories, or the directories don't even exist:
/usr/local/var/log/
/opt/homebrew/var/log
$(find /opt/homebrew ...
1
vote
0
answers
210
views
How can I restart the services that power Sidecar on my MacBook?
When I try to connect my MacBook Pro (2023, M2, running macOS 13.2) to my iPad Pro (running iPadOS 16.1.1) using Sidecar via Control Center, the little screen icon turns blue without ever showing a ...
2
votes
0
answers
52
views
Moving to trash takes too long - emptying trash takes more than 10 minutes (even for a single item)
OSX Ventura 13.2.1
How to recreate:
Drag folder to the trash; right click on trash and choose empty trash. Will take at least 10 minutes to empty the trash with just a single .png file.
Things I've ...
2
votes
1
answer
50
views
Making launchd agent uninstall itself
I have a launchd agent which is a companion to another tool. When it runs, it checks if the tool is ready before proceeding. I want to add an extra case in which the launchd will also remove itself if ...
2
votes
2
answers
75
views
Is there a way to detect power state change from the command line?
I would like to disable some power hungry services once I disconnect the power cord. Was thinking of creating a launchd agent that can monitor a file and run a script.
If there are other ways of ...
1
vote
0
answers
292
views
How to disable PasswordBreachAgent
I use macOS Big Sur 11.7.2.
I first tried this in the Terminal (Bash, not zsh):
launchctl disable PasswordBreachAgent
Which generates this:
Unrecognized target specifier. takes a form of /.
Please ...
0
votes
0
answers
136
views
Excessive logging after getpwuid failure
Upgraded to Ventura 13.2 and noticed that I was getting a good deal of logging in the launchd.log. It appears that there is a process attempting to set off a service with a bad UID.
Here is an example:...
0
votes
1
answer
891
views
Set environment variable for the whole GUI session (Aka without using `~/.zshenv`)
(EDIT OF 06/02/2023 : Previous title was
Variables set using launchctl setenv aren't part of environment in Mac OS 12 )
I'm a daily Linux user and decided to try Mac recently.
I have a Macbook pro 13&...
0
votes
0
answers
304
views
Bootstrap failed: 134: Service cannot load in requested session (macOs Ventura 13.0)
Trying to run this command
sudo launchctl bootstrap user/501 ~/Library/LaunchAgents/io.mutagen.mutagen.plist
and getting this error
/Users/simanta/Library/LaunchAgents/io.mutagen.mutagen.plist: ...
2
votes
1
answer
1k
views
Why do I see “ln” listed in the login items? [duplicate]
I'm currently using macOS Ventura 13.1 on my i5 Macbook Pro 2020. After updating to this version, some unexpected behavior has arose, such as "Steam" added items that can run in the ...
1
vote
0
answers
106
views
How to disable the default Apache installation
I am trying to disable the default Apache installation on my M1 MBP, however I am hitting problems.
Checking Apache configuration suggests the default is still configured.
apachectl -S
AH00558: httpd: ...
7
votes
2
answers
4k
views
How to increase global maxfiles ulimit on OSX 13.1 Ventura
This is an old problem, but again, none of the old solutions work anymore.
Default ulimit is far too low and I need to increase it to basically unlimited (like let's say a million).
And I need to ...
1
vote
1
answer
313
views
Launchctl load -w generate Service cannot load in requested session
I ran the following command:
launchctl load -w /Library/LaunchAgents/...plist
The plist file has the following values:
<key>KeepAlive</key>
<true/>
<key>...
2
votes
0
answers
262
views
Google Keystone agent failing
Whenever I check out my launchd agents in LaunchControl I notice that has exited with Error 1. The agent is sent to run the following command every 3,623 seconds (!):
/Users/kuzzooroo/Library/Google/...
0
votes
0
answers
466
views
My personal launchagents have stopped working in MacOS Ventura. Any ideas?
I have a number of launch agents I've written over the years to automate some simple tasks, like rsyncing my music and photos from my laptop to my NAS. Recently I've noticed that they have stopped ...
0
votes
0
answers
686
views
Cron job running while macbook lid is closed?
I have been using cron to run a script every morning at 5am daily (the script sends me an email with some data).
In the past, I have always had to keep my laptop lid open and awake for the cron job to ...
2
votes
1
answer
406
views
macOS 13.1 launchd job fails with OS_REASON_CODESIGNING
I have mongod running in the background, installed through homebrew. I've updated to macOS 13.1 yesterday and now mongod fails to start. The launchd sys log shows the following error:
2022-12-14 09:50:...
0
votes
0
answers
30
views
Can we use launchd or some other boot-time process to bypass SIP?
Anything that bypasses SIP is obviously a security problem, so I'm guessing the simple answer is "hell, no!" However …
Is there any time at the beginning of the boot process when SIP is not ...
1
vote
0
answers
118
views
create RAM disk as early in boot process as possible
I am attempting to to create a RAM disk as early as possible in the boot process so that my copy of Stata can use it to store temporary files. According to the instructions from Stata one can set the ...
0
votes
0
answers
28
views
macOS, call uninstall script when drag-and-drop app to trash icon
I'm working on some app that has LaunchDaemon running on the background, and thus it requires some operations to be removed, prior to deleting the data/exe files.
Is there an option to call an ...
0
votes
0
answers
19
views
Launchd script that edits its own schedule not working
I have 2 launchd plists that are basically entirely identical, save for the <StartInterval> settings. Both plists simply launch a shell script and redirects both stdout and stderr to files for ...
2
votes
0
answers
347
views
Cannot get launchctl to run python script
I wrote a basic python web scraping program and am trying to get it to run automatically at 4 am every day but am having no luck. The .plist file and python code are as follows:
.plist:
<?xml ...
0
votes
0
answers
295
views
Why is bluetoothd logging to bluetoothd-hci-latest.pklg endlessly, and is there any way to stop it?
I was playing around with the new eslogger binary that shipped with macOS 13 (Ventura). It's an amazing tool that exposes an easy interface to the Endpoint Security subsystem via Terminal. This ...
1
vote
0
answers
604
views
How to increase open file and max processes limit for Solr
I'm trying to run Apache Solr 8.8.1 on Ventura 13.0 and I get this warning:
$ ./solr-8.8.1/bin/solr start
*** [WARN] *** Your open file limit is currently 256.
It should be set to 65000 to avoid ...
10
votes
1
answer
7k
views
Charlie Stigler and other random items running in the background?
I have a MacBook Pro with macOS Ventura 13.0.
In System Settings -> General -> Login Items, I discovered that a random Charlie Stigler item was running in the background. I have no idea what ...
1
vote
1
answer
178
views
Port 3031 is being opened by launchd
I want to use the port 3031 for our application but it is in use by something with PID 1. It is being opened with launchd and I just reset my laptop so it must be an apple process.
0
votes
0
answers
160
views
How to install user Agent (launchchd) in Mac and Run for all users on login
On MacOs I want to create a application that runs in the background (hidden)and on user login , so I have created a user agent and .plist configuration added in /Library/LaunchAgents
It is running ok ...
2
votes
1
answer
597
views
macOS `launchctl load` problem with <ProgramArguments>
I have little misunderstandng why my ~/Library/LaunchAgents/com.user.loginscript.plist doesn't work.
Here is NOT working code inside my plist:
<key>ProgramArguments</key>
<array>
<...