Questions tagged [launchd]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Automatically open an SSH connection when something tries to connect to a port?

I need to tunnel my SMTP-traffic via an SSH connection because the SMTP only accept clients from certain IP-addresses. Currently I have to setup this tunnel manually ssh -L 5870:smtp:587 -l name ...
2
votes
1answer
25 views

Is it possible to prevent launchd running a missing task on wake? [duplicate]

I have a launchd task configured to run once an hour using the StartCalendarInterval key to set specific times at which the task will run. However, the default behaviour of this is that, when an ...
3
votes
0answers
26 views

Append instead of overwrite log file by StandardOutPath and StandardErrorPath

I have a launchd job that periodically runs in the background. Any stdout and stderr output during the job is logged to some files set in the job's plist using the StandardOutPath and ...
1
vote
1answer
62 views

How to increase the max user processes hard limit(Mojave)

How do I increase my max process hard limit. Currently, I can't go more than 2500. I'm on Mojave 10.14.6. Currently what I do is: sudo vim /Library/LaunchDaemons/limit.maxproc.plist // and then ...
1
vote
1answer
49 views

launchd jobs exit status -44

Anyone knows what does the -44 exit statues mean or can lead me to find relevant informations? PID Status Label - 0 com.apple.SafariHistoryServiceAgent - 0 com.google....
0
votes
0answers
14 views

Help understanding 'man launchtl' & using it to set a specific path

It's been years and I'm still stuck, unable to understand how to use launchctl on Macos, beyond the basics. This time I need to set a specific path variable so that a service can access a binary. I ...
1
vote
1answer
27 views

Cron job running (?) and output file is being logged every night at 1:35am, but there is nothing listed in crontab -l

I recall creating a cron job that runs a shell script that deletes files that are 45+ days old. When I was editing crontab -e I set it to also output a log to a date stamped log file to ~/Logs. I ...
1
vote
1answer
49 views

Mac Freezes on Launch

Mac running 10.14.5 is freezing after the login screen each time I reboot. Seeing these stange messages in /var/log/system.log that seems suspect. com.apple.xpc.launchd[1] (com.apple.CloudDocs....
0
votes
1answer
20 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
18 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
48 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
24 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
163 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
29 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 "-//...
1
vote
0answers
15 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
33 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 /...
2
votes
2answers
75 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&...
2
votes
1answer
73 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
37 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
62 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
130 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
67 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
28 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
59 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
227 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
44 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
31 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
47 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
224 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
36 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
117 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
151 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
176 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
43 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
29 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
123 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
240 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
125 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
84 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
175 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
85 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
341 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
34 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
69 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
93 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
199 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....