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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [launchd]

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

0
votes
0answers
5 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 clouds which can be started at boot time. There is no option ...
2
votes
2answers
252 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
29 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
31 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
39 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
50 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
14 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
27 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
24 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
16 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
53 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
181 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
141 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
36 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
26 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
838 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
34 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
54 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
43 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
53 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
140 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
74 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"?> <...
2
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
56 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
35 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
937 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
307 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
444 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 ...
2
votes
0answers
38 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
92 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
232 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
113 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
256 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
40 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 ...
3
votes
1answer
169 views

SockPathMode - what is it?

I have a plist installed on my system with the following in it: <dict> <key>SockPathMode</key> <integer>438</integer> man launchd.plist tells me: SockPathMode <...
3
votes
0answers
556 views

com.apple.pc.launchd keeps respawning every 10 seconds — problem with MRT, MRTd?

I am running OS X El Capitan, on an iMac (27-inch, Mid 2010). Using "top," I noticed that my systems was always running "ReportCrash"; I looked into the logs, and found: 1/25/18 12:32:51.464 PM com....
1
vote
0answers
72 views

Sockets in *.plist [closed]

My app needs to create a system-wide socket (unique independently of the number of users on the Mac). I'm using a *.plist to this end: <key>Sockets</key> <dict> <key>...
1
vote
0answers
91 views

Local User LaunchAgent via SSH: Operation not permitted

I have a launch agent on a remote machine which runs Yosemite. The LaunchAgent is saved to ~/Library/LaunchAgents/ and I am the owner: $ ls -l ~/Library/LaunchAgents -rw-r--r--@ 1 me staff 803 Jan ...
1
vote
0answers
190 views

Troubles with com.apple.cmio.AppleCameraAssistant

I've got a problem with the Daemon com.apple.cmio.AppleCameraAssistant. After some researches on my side, I've finally found the problem on why UserEventAgent took so much of my CPU. Because of this:...
0
votes
1answer
186 views

How to start with launchd a bash script that calls fswatch with `&`

Manually it works I have a bash script called git-watch.sh (gist link) that calls fswatch in a loop like this: while read -r line; do { fswatch -r "$line" | grep --line-buffered -v '.git' | ...
1
vote
0answers
35 views

Need help troubleshooting a shell script that won't launch (yes, permissions are 755)

It could be the lateness of the hour, but I can't understand why the following script isn't working. It's directly from the CommuniGate Pro documentation http://www.communigate.com/CGPSophos/#Update, ...
3
votes
0answers
79 views

How to tell which Launch Agent is running

I'm a script kiddie noob so sorry if I get some of the jargon wrong or if this is a dumb question but... I have written a launch agent that runs an application I also wrote at specified times to ...
6
votes
1answer
417 views

Why does iStat Menus disable S.M.A.R.T. on my Mac?

I have set up a launchd job which checks my S.M.A.R.T. status. After I installed iStat Menus my launchd job immediately threw me a popup saying me to backup all my files. I checked with Disk Utility ...
1
vote
0answers
52 views

Launchd runs once per boot instead of on every login

I would like Launchd to run a login script every time a user logs in. The script is configuring the users finder favorites and it works when running it manually. I have setup the Launchd plist as ...
1
vote
1answer
163 views

LaunchDaemon loading but not starting

I created a LaunchDaemon to automatically start a mining client when the computer boots. Here is the .plist file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD ...
3
votes
2answers
151 views

How to launch pf at startup?

I am looking for a pretty elegant way to launch the pf - a.k.a. Packet Filtering - process at startup. Using the launchctl or the pfctl commands, root privileges are required and so it is useless to ...
2
votes
0answers
133 views

Disable Launchd based daemon sudden termination upon shutdown

I'm running my own daemon under macOS Sierra and High-Sierra, and get unexpected behavior upon shutdown. according to the manual of daemon life cycle, it says that ... If the system is being shut ...
5
votes
2answers
2k views

clipboard not working after Security Update

EDIT: The update had the Security and Privacy icon (steel home with vault lock), while the last installed update (2017-001) has the High Sierra icon. So may not be 2017-001. Yet this is the last ...
1
vote
0answers
47 views

How to unload com.epson.eventmanager.agent

I have installed a few programs from Epson to make my printer work and some of them run as background processes on my system, which are spawned by launchd, one of them is com.epson.eventmanager.agent. ...
1
vote
0answers
32 views

How can I force a refresh of services menus from the command line?

Is it possible to restart/refresh services menus from the command line? Ideally with some logging enabled? I have some funny behaviour on a service (it shows up in finder, but not in other apps) and ...