Questions tagged [launchd]

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

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

Allow Shell Script to Access Protected Library Folders (launchd)

I'm trying a bash script that works fine when run from the command line (Terminal). Apart from the shebang, it just has: ls -alt /Users/<username>/Libary/Mail/V6/.../Lists.mbox (Using ls as a ...
2
votes
0answers
16 views

rsync denied to access directory when run with launchctl

I have mounted samba share in "/Volumes/Samba" with full read/write access right to it. I created simple script to rsync files from smb share to folder on my disk, when I lunch script from terminal ...
3
votes
1answer
28 views

launchd: Confusion on semantics of bootstrap and bootout etc. after reading manual pages

I've read the following manual pages on launchd: launchctl, launchd, and launchd.plist. However, nothing is really said in these manual pages regarding what the launchctl boostrap and launchctl ...
0
votes
0answers
22 views

How to list all domains for launchctl on macOS?

I've noticed that launchctl refers to domains, which is a relatively new topic to me, haivng a Windows background. How can I list all user/system domains, so that I've an idea of what to provide to ...
2
votes
1answer
59 views

Why does setting the hard-limit for maxfiles to “unlimited” using `launchctl limit` result in a hard-limit slightly above the soft-limit?

Why does setting the hard-limit for maxfiles to "unlimited" using launchctl limit result in a hard-limit slightly above the soft-limit? By setting the maxfiles limit using launchctl to launchctl ...
0
votes
0answers
19 views

Adding and Deleting LSHandlerURLScheme from com.apple.launchservices.secure.plist is not immediately reflecting in Launch Services database

I am exposing an Mac OSX application by adding its bundle identifier and urlscheme in com.apple.launchservices.secure.plist. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//...
0
votes
0answers
12 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
26 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 /...
1
vote
2answers
59 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&...
1
vote
0answers
26 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
36 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
52 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 ...
0
votes
2answers
79 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
46 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 ...
0
votes
0answers
25 views

When CleanMyMac X disables or enable a service, what does it actually do to launchd? How to recover?

I disabled a service (com.qiuyuzhou.shadowsocksX-NG.local) with CleanMyMac X by mistake, and the software stopped working, I tried some commands but they failed. launchctl load "$HOME/Library/...
0
votes
0answers
32 views

Distribute bash script 'silently' to multiple macos machines

We want to deploy a script 'silently' across all mac machines in organization. We have created a bash script that will run using launchd agent. We need to deploy the launchd agent and script on all ...
4
votes
1answer
56 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 ...
2
votes
0answers
158 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 -...
0
votes
0answers
13 views

MacPorts daemons not loading on restart

I have installed MacPorts 2.5.4. From here, I have installed apache2. When I restart the machine, I need to run sudo apachectl start each time, it won't load automatically. I ran a sudo launchctl ...
2
votes
2answers
40 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
0answers
29 views

Running System calls from Launchd Daemon

In Mojave, I'm running a script as a daemon to call a program I've written - located in /Library/Daemons - and which runs every 7 mins. The program "my app" accesses local files does system calls to ...
0
votes
0answers
26 views

StartInterval of 3 seconds in a launchd plist no working as intended

I want to run a script every 3 seconds to grab a webcam image (updated every second) with curl. I created a plist for launchd as: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist ...
0
votes
1answer
40 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
177 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
34 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
100 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
142 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
150 views

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

background I've been working on a backup script that runs occasionally via launchd. When it runs, it prompts me with something like: osascript -e "display dialog \"Is now a good time to back up?\"" ...
0
votes
0answers
37 views

How to kill the routined service (temporarily or permanently)?

As per this question, routined is an Apple daemon that introduces some problems in High Sierra onwards: routined wants to use the "Local Items" keychain alert Experiments with killall over ...
0
votes
0answers
26 views

Where installer pulls environment variables from?

While looking over /var/logs/install.log, I've noticed that whenever I install a pkg, the installer first outputs a bunch of detected environment variables. However the env vars it outputs doesn't ...
2
votes
2answers
104 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 ...
1
vote
1answer
187 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
122 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 ...
1
vote
1answer
61 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 ...
0
votes
0answers
156 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"?> <!...
3
votes
2answers
1k 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
74 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
303 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
30 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
58 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/...
0
votes
0answers
77 views

Verify and load mDNSResponder plist file

As mentioned here, in my macbook only chrome is able to resolve any given host but any other application is not able to do it. As mentioned in the answer, I tried to edit the file and unload/load the ...
1
vote
1answer
140 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
83 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
0answers
78 views

“Error: 0xFFFEFA0A -67062 code object is not signed at all” when trying to launch docker-machine by LaunchDaemon

I am trying to get Docker installed on macOS High Sierra. I've installed Docker via brew, I can start the docker-machine when logged in as root (sudo -i -u root). But when I use LaunchDaemon the ...
0
votes
1answer
48 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
70 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
145 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
370 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
29 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
163 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: ...