Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [launchd]

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

1
vote
0answers
20 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: ...
3
votes
1answer
106 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
43 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....
0
votes
0answers
16 views

How to increase `ulimit -u` on High Sierra?

I'd like to increase ulimit -u. My current limit is. $ ulimit -u 709 sysctl gives me this. $ sysctl -a |grep ^kern.maxproc kern.maxproc: 1064 kern.maxprocperuid: 709 Running the following commands,...
1
vote
1answer
69 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
25 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 ...
0
votes
0answers
39 views

freshclam Service could not initialize, Service exited with abnormal code: 78

I've spent a couple of days on this already. On first loading the freshclam.plist file, it works fine. If I just run sudo freshclam from the command line, it works fine But it's set to re-run every ...
-3
votes
1answer
102 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....
-1
votes
1answer
48 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. ...
3
votes
4answers
352 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.
2
votes
1answer
493 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
0answers
14 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
26 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
50 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
1answer
189 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 ...
0
votes
0answers
49 views

Disable all logging [duplicate]

How can I do to completely disable system and applications logs in macOS High Sierra? (Ass seen using Console.app) I don't see any value in having all the subsystems logging endless useless stuff all ...
5
votes
2answers
195 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
567 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
57 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
vote
2answers
79 views

Difference between System and Global Daemons

According to the Launchd Tutorial, there are two places where a daemon can be. A global daemon located at /Library/LaunchDaemons A system daemon located at /System/Library/LaunchDaemons What is the ...
2
votes
1answer
62 views

Run backup script at any time every weekend (using launchd?)

I recently lost configuration of one of my IDEs (deleted it myself, I am very smart). I had a backup but it was a few months old. I have a script to backup all my config and push it to GitHub. I was ...
0
votes
1answer
231 views

Run an AppleScript daily with launchd

I'm trying to run an AppleScript which ejects all drives (from the excellent answer by Monomeeth here) daily at 8 am using launchd. After some searching, I decided the best way to do this was by using ...
0
votes
0answers
16 views

I want to start and stop a network service based on whether the host is receiving udp packets on a particular port

I'm vaguely familiar with launchd and plist files. I've used these (in the distant past) similarly to cron scripts to run stuff periodically. But I understand they can also do "on demand" things. I ...
0
votes
0answers
54 views

`launchctl export` command not working?

According to the man page of launchctl, there is an export command: export Export all of the environment variables of launchd for use in a shell eval statement. However, when I try to use ...
0
votes
0answers
30 views

Can a password for an API be secured on a Mac but usable through a script?

I enjoy using launchd, JSON Helper and AppleScript to run hourly pulls for API information I need but I'm required to manually enter an username and password. I don't mind the username as text in the ...
0
votes
1answer
22 views

LaunchAgent loads app but clicking app icon doesn't

I have an issue where I installed an app, the installer completed with no apparent errors, the app launched immediately after installing, but afterward if I click the app icon in /Applications the ...
2
votes
1answer
126 views

How to run a one-liner shell command using launchd?

Below is an example of what I'm trying to do: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0....
2
votes
1answer
636 views

How do I enable ntpd to serve ntp clients (using High Sierra)?

I have some raspberry pi computers on a private network which do not have real time clocks and thus cannot keep time accurately after they are shut off. Because they are disconnected from the internet,...
6
votes
2answers
240 views

launchd listening on port 4444

the lsof command tells me launchd is listening on port 4444: $ sudo lsof -i tcp:4444 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME launchd 1 root 32u IPv4 0xfe4e7e9bb5c1a5 ...
1
vote
1answer
58 views

Why won't launchctl automatically load my plist entries?

I have put several plist entries in /Library/LaunchDaemons all configured to run at load. However, after booting, none of them load up automatically. Every other script in this directory loads ...
3
votes
0answers
35 views

Why is an application running so slowly when started with launchctl?

I've written an application in C++, using OpenGL and Cinder. When I launch the app file from the Finder, it runs nice and smoothly at 60FPS. However, when I launch it using launchctl load the ...
1
vote
2answers
3k views

Make sysctl changes at startup

I'd like to change the default smb settings at startup to remove timeouts. I have the following script; #!/bin/sh sysctl net.smb.fs.kern_deadtimer=0 sysctl net.smb.fs.kern_hard_deadtimer=0 sysctl ...
2
votes
1answer
80 views

launchd startInterval shorter than time taken for the script to complete

I'm using launchctl to load/start my python script and it works to a certain degree. It launches ever 120s, but some times my script takes 500s to run and my theory is that is I have a process running ...
3
votes
2answers
74 views

error code 4960 when saving a .plist

I'm trying to create a .plist file in textwrangler, something I've never done before. I'm using these instructions which tells me to: Save code as com.rTask.plist file under path ~/Library/...
1
vote
0answers
55 views

Junk log files filling HD

Sometime last night, the directory /private/var/db/uuitext/dsc on my Macbook Pro started filling up with junk files until the HD was completely full. Each one is 40.9MB and has a name of the pattern ...
2
votes
2answers
81 views

launchd process using aerender exits early

I'm trying to run aerender (After Effects' command-line renderer) via launchd to render a video on a timed interval. The command works fine in Terminal. In launchd - even when I use screen -d -m ... ...
1
vote
1answer
201 views

Launch agent invoking python script returns permission error

I'm trying to use the following .plist to invoke a python script. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs ...
2
votes
1answer
151 views

Invalid plist error

I'me getting Invalid property list when trying launchctl load -w /Users/open/Library/LaunchAgents/com.apple.inMemTask14.plist for this .plist: <?xml version="1.0" encoding="UTF-8"?> <...
3
votes
0answers
1k views

How can I mount Google Drive File Stream before launchd user agents start?

I have a simple backup bash script that dumps the output of pg_dump for a PostgreSQL database into a Google Drive File Stream directory. This bash script is referenced by a launchd user agent. The ...
1
vote
0answers
87 views

KeepAlive with NetworkState not working for agent

I'm trying to automatically execute a Python script every day, but it requires an Internet connection (to send emails, etc.). So I fixed the date and hour at which it needs to be executed, but if ...
0
votes
0answers
41 views

RAM Disk Creation Script (Run at Load) [duplicate]

Note on this question having a duplicate: My question happens to be an answer to the question linked-to as being a duplicate. However the answers on that question to NOT answer my question here. I'm ...
0
votes
1answer
2k views

What does “Service exited with abnormal code: 1” mean?

I'm looking to see if a LaunchDaemon script is running at its assigned time. Looking at that time in the Console produces this result: "mac-hostname com.apple.xpc.launchd[1] (com.user.delprofiles[...
1
vote
0answers
468 views

How to disable core services safely without screwing up the OS?

There are certain core services in macOS which takes up a significant amount of your CPU and RAM. I don't use iCloud so nothing synchronises but, still Safari needs to run Bookmarks Sync Agent for no ...
1
vote
2answers
1k views

Open an application periodically in Mac OSX

I want to open a GUI application (most likely Electron based) periodically on a Mac Book. The period will be configured (daily, hourly etc..) within the application. How would I go about achieving ...
3
votes
1answer
62 views

Why does telling an app to quit sometimes leave a zombie, and how can I kill it?

I have two scripts that open and close an app; let's say it's the builtin Calculator.app. The "start" script uses /usr/bin/open to launch the app, then a one-line AppleScript to set the app's ...
2
votes
1answer
177 views

How to revert launchctl PATH to defaults?

There are many questions and commentary about using launchctl setenv PATH /path/to/include in order to have GUI apps inherit user-specified paths. I did this about four years ago, and the changes I ...
0
votes
1answer
374 views

How to run httpd on macOS without Apache [closed]

I'm trying to build a BCHS application. I do have a remote server running OpenBSD, but the network latency is killing me, so I decided to develop on my MacBook Air and deploy to the OpenBSD server ...
1
vote
1answer
154 views

Is there a hook for triggering scripts when a particular notification is displayed?

I'm trying to set up some system behaviors to occur when particular iCal or GCal events begin and end. Is there a way to hook into the notifications system (e.g., via a LaunchAgent) to make the Mac ...
1
vote
0answers
462 views

Got a Java process with about 4 GB memory consumption after just starting up macOS

I recently found there is a Java process with more than 4 GB memory in my MBP, and it respawned after I force quit it. After restarting the computer and entering safe mode, the process does not ...
4
votes
0answers
47 views

macOS LaunchAgent service runs duplicate processes [closed]

While running my UI application as LaunchAgent I sometimes get dual running processes on the same user instead of one (which is reflected on the screen by duplicated identical windows). I guess this ...