Questions tagged [launchd]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
107 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 ...
2
votes
1answer
2k 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 ...
1
vote
1answer
221 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
1answer
43 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
901 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
2answers
3k 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
874 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
891 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 ...
4
votes
1answer
202 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
8k 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
312 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 ...
4
votes
2answers
198 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/...
2
votes
2answers
170 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
481 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
331 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
2k 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
1answer
271 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
58 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 ...
3
votes
1answer
11k 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[...
2
votes
0answers
902 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 ...
2
votes
3answers
3k 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
1answer
121 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
881 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
819 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
377 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 ...
2
votes
0answers
1k 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
110 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
231 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
1k 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
415 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>...
4
votes
1answer
889 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 ...
3
votes
0answers
1k 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
604 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
46 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
164 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
1k 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
1answer
642 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 ...
7
votes
4answers
2k 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
325 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 ...
0
votes
1answer
259 views

ssh_config changes not taking effect

My ultimate goal is to disable password login, as seen here: Disable password authentication on SSH server on OS X Server 10.8 But I suspect the changes I'm making to /etc/ssh/ssh_config aren't ...
2
votes
1answer
348 views

Muting system volume upon logout using launch agent

I'm attempting to create a script for muting the system volume which gets triggered upon logging out or shutting down. This is to avoid hearing the startup chime really loudly the next time I start ...
2
votes
1answer
665 views

Apache won't start on reboot

I have an issue where Apache will not start on a restart. I have tried commands like sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist to allow Apache to start, but it ...
1
vote
1answer
142 views

Why is my launchctl program not accepting external connections?

I am trying to set up the Check_MK agent with launchd on a Mac server, to return data over port 6556 when another machine connects to it. (The agent itself is essentially just a shell script that ...
2
votes
2answers
862 views

How do I run an app using launchd at regular intervals?

I have an app which is written in AppleScripting language which checks if the S.M.A.R.T. status is 'Verified' if it is not then it will automatically show me a dialog alert. But I need it to run every ...
1
vote
1answer
280 views

launchd socket input

I am trying to run a network server that is supposed to receive very short newline-terminated udp messages. The service plist looks like this <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ...
1
vote
1answer
67 views

Stopping Dovecot using launchctl

I have Dovecot running as a daemon via a launchd plist. It runs fine but doesn't stop if I run launchctl stop nor if I unload the plist so I end up using doveadm stop. Is there a key or command I add ...
1
vote
1answer
321 views

All my devices lose Internet connection

I'm from Switzerland with a FTTH connection. The ISP gave me an Icotera IGW3000 router. The problem is: all my Macs and iOS devices lose internet connection every x minutes. On my Macs, I have to ...
1
vote
1answer
303 views

Is it normal for LaunchD to write over 600 megs of data to /private/var/db/dyld/dyld_shared_cache_x86_64?

My hard drive began writing a lot and I was having to wait a lot to launch apps. The Activity Monitor told me that launchd had written over 600 megs to the drive. So I ran this: sudo lsof -p $(ps -...
3
votes
1answer
3k views

Will deleting/removing some system processes/ .plist files screw up my Mac?

I am thinking of deleting some contents from /usr/libexec/ , I don't use AirPlay nor AirPort so if I delete these two processes will it again screw up my mac the processes are AirPlayXPCHelper and ...

1 2 3
4
5
12