Questions tagged [launchd]

A system for starting, stopping, and managing automated processes.

Filter by
Sorted by
Tagged with
1
vote
0answers
18 views

launchctl list shows bundle identifiers of running application, there is a number after that what is it?

command and its output launchctl list | grep Terminal 94502 0 com.apple.Terminal.2000 What is the 2000 number referring to? 94502 is Pid and 0 is exit status What does it mean if pid is ...
2
votes
1answer
50 views

How is my Apache server auto-booting without a LaunchDaemon plist?

A few months ago I setup an Apache server on a Mac Mini running Mac OS 10.14.6. It runs great. Each time I reboot the mac, the Apache service also starts, great. My question is, why? There is no /...
3
votes
2answers
528 views

How can I use $HOME or ~/ in my log paths of launchd plist to run as LaunchAgent

My plist has below keys: <key>StandardOutPath</key> <string>$HOME/launchd.stdout.log</string> <key>StandardErrorPath</key> <string>$HOME/launchd.stderr.log&...
3
votes
1answer
1k views

Use OpenSSH agent instead of the OSX agent

I've installed OpenSSH using homebrew (brew install openssh) and this installation provides it's own ssh-agent. Still, when I login, and see the autostarted ssh-agent, I see that the agent that is ...
2
votes
0answers
70 views

My launchAgent service is launching my application multiple times even if configuration has RunAtLoad true and OnDemand true(default)

My purpose is to launch my application during every login but is being launched multiple times. I copied my below plist file in to /Library/LaunchAgents and gave root ownership and chmod 600 <?...
4
votes
2answers
330 views

Where should a daemon started by launchd store its data?

When I develop UI application for OSX I store user's preferences and application config to ~/Library/Preferences/AppName.plist (using NSUserDefaults). But when I create global background daemon that ...
1
vote
2answers
2k views

How to view status of service (e.g. whether it's running) in a format similar to Linux `systemctl` using macOS `launchctl`?

How to view status of service (e.g. whether it's running) in a format similar to Linux systemctl using macOS launchctl? I want to view the status of a service in macOS using launchctl in a format ...
0
votes
1answer
612 views

How do I use launchctl print?

I made a launchd service file then started it. Now I want to use the launchctl print command but I'm not sure how. I read: What is the difference between a `service-name` and a `service-target`? and ...
4
votes
1answer
677 views

How to find out which application(s) created core dumps?

I have a friend who has a Mac (Mojave) that recently ran out of space. I found that the space was being used by files in the /cores folder. I deleted them and used to the command sudo launchctl limit ...
4
votes
0answers
1k views

Homebrew dnsmasq “Service exited with abnormal code: 2” (Mac OS X Sierra 10.12.6)

Workaround (update) A quick workaround is to stop the job through brew services stop dnsmasq. Then you should first unload the launchd configuration file and then reload it. $ sudo launchctl unload -...
2
votes
2answers
100 views

What is the best approach to ejecting disk while in sleep mode, scheduled?

So, I have an external HDD which is being used for Time Machine. After getting to home, I usually connect my MacBook to a HDD via Hub and put it into sleep mode. Because I sometimes get back home ...
0
votes
1answer
75 views

stderr error log from launchd scripts filled with non-errors

I've added versions of the following to each of the launchd plist files for all of the scripts I run on my server: <key>StandardErrorPath</key> <string>/script_logs/server....
3
votes
1answer
1k views

launchd error “Could not find and/or execute program specified by service”

I am trying to get a script to run from launchd at regular intervals. The service loads but does not run the script. The script itself is a very simple test script as follows: echo "Hello World!" &...
0
votes
1answer
43 views

macOS: why only few login elements are in System Preferences

In macOS, under System Preferences / Users / Login Elements there is a list of Login Elements that are started at the startup. Actually only few elements are listed here. There are many other ...
2
votes
1answer
431 views

Launchd process behavior

just wanted to ask a quick question I can't seem to find a straight answer to. What is normal "launchd" process behavior I should be seeing in Activity Monitor? Right now it is writing GB's of data ...
1
vote
2answers
326 views

How to set the python environment for LaunchDaemons

I have installed Python 3 via Homebrew, on my Mojave system, and have it symlinked to /usr/local/bin/python. I have a LaunchDaemon plist as follows: <?xml version="1.0" encoding="UTF-8"?> <!...
1
vote
3answers
445 views

osascript display dialog hangs when screen is off; detect unavailable GUI/display from bash or applescript?

NOTE: If you have this problem, the answer from @abc helps mitigate it--but there are still unknown conditions under which this solution won't keep the osascript from executing and hanging. ...
3
votes
2answers
340 views

What are the various auto launch paths mean in OSX?

I'm trying to track down sneaky apps that launch upon reboot. They are not in System Preferences > Users and Groups > Login items and the in-app preferences for auto starting is disabled too for ...
2
votes
1answer
824 views

launchctl config file location?

I'm trying to configure a NetBoot image so that a script will automatically launch on the target machine after it boots from the image I've been using this article as a reference: https://medium.com/...
3
votes
2answers
146 views

What are the ways in which installed software can negatively impact OSX speed over time?

Applications installed on macOS are not always completely self-contained. Sometimes they write files in multiple locations outside their .app bundle, taking up space that they sometimes occupy even ...
2
votes
1answer
544 views

Monitor Folder Contents with launchd - Including Subfolders?

I want to make a shell script that runs any time the contents of a particular folder on my server are changed. Seems easy enough at first, because launchd has a directive called WatchPaths which ...
1
vote
0answers
531 views

One job plist on Launchctl stop working with error: Service could not initialize: 17G5019: xpcproxy + 11472 [1524]

I've a user plist job working on my iMac for latest month, and work fine. But today stop of work. ~/Library/LaunchAgents/multimedia_search.plist <?xml version="1.0" encoding="UTF-8"?> <!...
4
votes
2answers
3k views

macOS Mojave - locate not working

I got a MacBook from my work and wanted to use the locate command, but I get the message: WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the ...
1
vote
0answers
198 views

How can I take a command line tool and program launchd to run it?

I am trying to get Offlineimap to run every 5 minutes with launchd. I do not know why it doesn't work and the log file is not written on the specified location. I am running MacOS Mojave on a 2018 ...
0
votes
1answer
844 views

Launch daemon not running on boot

I've been following the migration guide for macOS Server and have gotten stuck with the launch .plist for the BIND (named) DNS server. If I name the file the recommended org.isc.named.plist the ...
0
votes
1answer
46 views

Launch homebrew.mxcl.dnsmasq when NIC becomes available?

I am running homebrew dnsmasq on my Mac. Dsmasq is configured to only respond to traffic on one NIC (en7). en7 is a usb-c ethernet adapter. When this adapter is not active (not plugged in, switch ...
1
vote
1answer
136 views

Triggering Launch Agents for path in sandboxed app using WatchPaths does not work

I am trying to create a user LaunchAgents that will trigger a script when a path managed by a sandbox app will change (in my case, when /Library/Containers/com.omnigroup.OmniFocus3/Data/Library/...
1
vote
1answer
675 views

Where does the stderr from launchd go?

launchd items in /Library/LaunchDaemon may redirect stdin/stdout/stderr. E.g. I've got an item that says: <key>StandardOutPath</key> <string>/Library/Logs/rnamanagedocker_out....
0
votes
0answers
238 views

Launch daemon does not run at boot, but will run when loaded by hand

I have a launchd daemon definition /Library/LaunchDaemons/homebrew.mxcl.docker-machine.plist which contains: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD ...
0
votes
1answer
166 views

Running launchd agent not preventing macbook from sleeping

I have an agent/daemon that runs a backup script (I use restic) at 4:05am on a StartCalendarInterval. My understanding is that if a launchd agent is running, that should prevent osx from sleeping. Is ...
1
vote
1answer
121 views

launchd is not passing arguments to my PHP script

I'm having a weird problem. I use launchd to run a bunch of shell scripts that update content on my site. It was working fine when it was just calling scripts normally. But now I made the script a ...
0
votes
1answer
554 views

What is the difference between Interval and ThrottleInterval in launchd.plist

I found Interval key in /System/Library/LaunchDaemons/com.apple.periodic-daily.plist from my MacOS 10.13.6. But I fail to find what Interval is by googling. Even man launchd.plist does not have this ...
1
vote
2answers
941 views

Launchd running an Applescript every two hours

I have written a small applescript that I would like to run automatically every 2 hours. I have thus written the following launchd daemon (probably it is an agent): <?xml version="1.0" encoding="...
1
vote
0answers
54 views

How can I use launchd to auto update brew? [duplicate]

I followed the instructions on the page Creating Launch Daemons and Agents and created (as root) my own plist file named com.personal.brew.plist and located in /Library/LaunchDeamons/: <?xml ...
1
vote
0answers
384 views

macOS Mojave launchd regular interval script - error is always “Found non-key inside <dict> at line 11”

The .plist in question is at the bottom but I can't find a way to run it every 7200 seconds. Checking it produces the same error. I have tried various versions taken from the StackExchange such as: ...
5
votes
2answers
498 views

How to I stop a launchd script from running on wake

I have a simple launchd script that plays a sound every 30 minutes and it runs out of the user library ~/Library . It doesn't run if my machine is asleep, but does run the last event missed when the ...
2
votes
1answer
3k views

How to or Is that possible to stop mDNSResponder without disable System Integrity Protection?

I have tried the following: $ sudo killall -HUP mDNSResponder $ sudo killall -9 mDNSResponderHelper mDNSResponder $ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder....
2
votes
1answer
2k views

Mojave plist error: Path had bad ownership/permissions

I'm trying to mount a fileshare at boot. I copied the plist from a 2012 mini (where it ran fine) to a 2018 mini, both running Mojave. On the new mini I'm getting the error: Path had bad ownership/...
2
votes
0answers
384 views

Auto logout inactive users

My iMac is set up using Parental Controls to limit how long my kids can use it. When their time is up, they are no longer able to use the iMac. However, their accounts are not logged out, and ...
-3
votes
1answer
448 views

How do I resolve a “Executable not found!” error?

I have upgraded from macOS 10.13.4 to macOS 10.14.1 (18B75) on a Mac mini (Late 2012), and now have one orphan file, and the corresponding Executable not found. /System/Library/LaunchDaemons/com....
0
votes
2answers
1k views

Unable to Locate or update LocateDB Mac OS El Capitain, Sierra, High Sierra, Mojave!

Over the past few operating systems I've been noticing a trend, especially after Apple screwed around with the real and fake "root" user in El Capitan. Most especially, using the locate command. ...
8
votes
7answers
4k views

How to run a LaunchAgent that runs a script which causes failures because of System Integrity Protection

After upgrading to Mojave, my rsync based backup script run via a launch agent in ~/Library/LaunchAgents, could no longer read some directories in ~/Library.
5
votes
1answer
5k views

How to prevent the Photos app from launching cloudphotosd, photoanalysisd, etc?

A number of the background services used by the Photos app perform functions I'm not interested in benefitting from (and in some cases, actively do not want). Primarily these are photoanalysisd and ...
1
vote
1answer
113 views

Want to launch dnsmasq ony when Thunderbolt Ethernet is active

dnsmasq is installed using homebrew. Currently dnsmasq is spamming my system.log with messages like this: Sep 26 18:22:46 Laptop com.apple.xpc.launchd[1] (homebrew.mxcl.dnsmasq[14526]): Service ...
1
vote
1answer
634 views

What is the best practice for a daemon application running as root that needs access to the GUI? [closed]

I'm porting over a C++/Qt application from Windows. On Windows, the program runs as a service. It's discouraged from programs running as a service to also interact with the user and display GUI ...
3
votes
1answer
233 views

Can I change launchd program arguments based on calendar interval?

I'm trying to run a script (zfssnap.sh) to automate snapshots, but one of the arguments needs to change based on which time entry triggers the script to start. With cron, I would just add a new line ...
1
vote
2answers
4k views

Cannot kill Bitdefender process after uninstalling it, no launch daemons found

Recently, I installed Bitdefender Antivirus. I wanted to remove it after the trial period. After uninstalling it via CCleaner, moving all stuff from Librar, I found there is still an agent up and ...
7
votes
2answers
462 views

Why can an app create daemons on the fly without sudo permission and how to stop it?

First, I come from Linux so there are many things which confuse me such as daemons. I installed VOX.app and it has some kind of agents and cloud-related processes which can be started automatically. ...
4
votes
2answers
2k views

What does launchctl unload actually do?

When running launchctl unload some.plist, what is this command translated to specifically, in terms of UNIX commands, etc. There is nothing in .plist files that specifies any "command line to run ...
2
votes
1answer
175 views

Cannot load rsync daemon in Sierra. Log shows: “assertion failed: 16G1408: libxpc.dylib”

I'm trying to start rsync --daemon on Sierra (10.12.6), using launchctl. It used to work fine (last time in Mavericks, I think). But now on Sierra, the daemon does not start and grep rsync /var/log/...

1 2
3
4 5
12