Questions tagged [launchd]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
36 views

What is process apfsd?

It shows in Activity Monitor as "preventing sleep." I have occasion to check that list of processes preventing sleep fairly often, and I don't recall seeing that before. I would guess that it might ...
2
votes
0answers
60 views

Invalid property list

I'm trying to set up a UPS solution which should shut down my Mac automatically. I've followed these instructions: Protection from power failures! Mac, UPS, NAS & NUT/video. This requires to ...
1
vote
2answers
47 views

How to make ''sudo launchctl limit' change permanent?

I have a background job that failed due to too many open files error. To fix it, I have to kill the job, then run the following sudo launchctl limit maxfiles 10240 10240 before restarting it. Is ...
0
votes
2answers
34 views

is thre a way to find recent files with locate OR automatically update the database each time a file is created

I am on MacOS Catalina. locate is a great command but unfortunately, I have difficulties to find files which have been created for example one hour ago or ten minutes ago. It seems that I could ...
3
votes
1answer
33 views

How to delete directory content with launchd

I am trying to empty a directory at the end of the day, so I have written the following script: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "...
1
vote
1answer
16 views

launchctl list doesn't show StartInterval

The following is part of my .plist file: <plist version="1.0"> <dict> <key>Label</key> <string>org.myorg.foo</string> <key>ProgramArguments</key> ...
1
vote
1answer
35 views

How to disable xpc items from launchd?

I sometimes encounter various tasks for com.apple.xpc.launchd in the system logs that give errors like Service only ran for 0 seconds. Pushing respawn out by 10 seconds. or Service exited with ...
3
votes
2answers
106 views

Best/most immediate way to disconnect wifi at login or boot

I'm running Catalina, and the OS will always turn wifi on at boot. I've been looking into methods to turn wifi power off when I login, and I've created a .plist: <?xml version="1.0" encoding="UTF-...
0
votes
0answers
14 views

Google Backup and Sync Keeps Exiting

This is a new problem: on both my laptop and desktop, Google Back and Sync keeps exiting. I'm using the current version. This doesn't make sense. How do I debug something like this? Is there a way I ...
0
votes
0answers
36 views

launchd uses UDP port 69. Why? [duplicate]

Why and what for launchd listens on TFTP port 69? How to prevent? $ sudo lsof -nP -i:69 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME launchd 1 root 23u IPv6 ...
0
votes
2answers
80 views

Can't start tftpd because port is already in use by launchd

Enabling tftpd sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist Start: sudo launchctl start com.apple.tftpd See logs syslog -w com.apple.xpc.launchd[1] (com.apple.tftpd[30687]) <...
0
votes
1answer
124 views

How to debug macOS firewall? My application layer firewall (ALF) is not logging or blocking

macOS firewall (alf) socketfilterfw doesn't seem to be running properly on macOS catalina 10.15.2 ... Any ideas on how to troubleshoot / debug the built-in macOS application layer firewall?
1
vote
1answer
45 views

Launchd plist runs everyday instead of only weekends

Scenario: I need to force a reboot as a Launch Daemon at a specific time only on Saturdays and Sundays. Output The reboot command gets launched at the specific time everyday instead only on ...
1
vote
0answers
62 views

Can't record audio from scheduled jobs

I wrote a bash script which records an audio file of a set length from my internal microphone. The script works great, either using ffmpeg or sox to do the recording. I used to be able to ...
0
votes
0answers
11 views

Launch Agent not running when new user logs in for first time

I have a launch agent that runs perfectly fine every time except when a user is logging in for the first time on macOS and has to answer the setup questions. How can I make sure my launch agent runs ...
0
votes
1answer
58 views

Script to run Adobe Update Remote Manager as Launch Daemon at Boot without MDM

Scenario: I need to figure out how to run the /usr/local/bin/RemoteUpdateManager at DeepFreeze maintenance cycle. During this maintenance cycle, the computers will restart to the login screen and ...
1
vote
0answers
108 views

How to get postfix send mail (with Gmail smtp) under macOS Catalina?

I have tried everything (I guess), such as writing my sasl_passwd and editing main.cf in the /etc/postfix folder (as described in 1). I also copied my LaunchDaemon plist with a different name to my /...
3
votes
1answer
553 views

macOS Catalina: execute bash script on boot with launchctl

Before updating to Catalina (10.15.1) my agent based on a bash script was working perfectly. I had set the agent in order to execute the bash script on boot. Here is the plist file: <?xml ...
2
votes
1answer
39 views

macOS methods for applications autostarting

It is known to me that application autostart is based on different methods: Login elements in the System Preferences /Library/LaunchDaemons /Library/LaunchAgents /Users/username/Library/LaunchAgents /...
2
votes
0answers
51 views

How do I stop a user unloading a plist

I want to stop a user in MacOS from unloading a plist using launchctl? Launchctl does not seem to always require a su / sudo. I have a non-admin user that is managing to switch off app restrictions ...
2
votes
1answer
104 views

How to Disable Airport Sniffing?

when I run the command airport, it tells me it is sniffing: Sniffing on channel 1: airport en1 sniff 1 I have noticed that many log files are created in /private/tmp There may be some bad actor ...
0
votes
0answers
28 views

launchd simple recursive program to retrieve email with getmail

I adapted the following plist as <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist ...
1
vote
1answer
73 views

How can I use launchctl getenv over ssh?

In a terminal session I can run launchctl getenv SSH_AUTH_SOCK and it prints the value of that variable. However if I ssh into the same user from another computer, then run the same command, there is ...
1
vote
0answers
14 views

disabling (unloading) a launchd job only after it finishes

I have some job that runs in the background I loaded with: launchctl load -w com.xxx.jobname Whenever I want to disable the job I run: launchctl unload -w com.xxx.jobname I noticed that launchctl ...
1
vote
0answers
13 views

How to ignore changes in sub-folders of monitored folder in Launchd?

I'm using launchd to detect changes of a specific path using "WatchPaths" key and then run some codes, but the content changes of sub-folders are not of interest. For example, in order to monitor ...
0
votes
0answers
28 views

I'm having a kernel panic launchd exited (signal 10, exit status 0). How to solve it?

I recently bought this MacBook Pro 15 mid 2012 with core i7, 8GB RAM, 160 GB HDD and OS X 10.6.8 Snow Leopard. It comes with no battery, 6 vertical blue lines within the screen and a Shift key stuck ...
3
votes
1answer
74 views

How to remove a service from launchd added by mistake?

By mistake I added an invalid (non-existing) service to launchd: sudo launchctl enable system/homebew.mxcl.cntlm The above should be system/homebrew.mxcl.cntlm instead. However, after removing the ...
2
votes
0answers
20 views

Transmission freeze / no way out

Sometimes Transmission.app freezes / hangs. These are known issues and they sure need to be reported to the Transmission project. However, I encountered a situation which is a system-wide bug. macOS ...
1
vote
0answers
32 views

launchd daemon can't connect to remote server

I've developed a launchd daemon that updates my DNS on a remote server. That script used to work perfectly. On September 25th 2019 my logs began showing that there was a connection error with my ...
0
votes
0answers
20 views

Custom LaunchAgent is not loaded after reboot in Mavericks

I created a launchd plist to automatically runs a shell script every day at 2 am. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www....
5
votes
0answers
102 views

How to prevent non-root load of a LaunchDaemon

I want to prevent a LaunchDaemon (/Library/LaunchDaemons/com.mycorp.service.plist) from being loaded by a non-root user. Running sudo launchctl load /Library/LaunchDaemons/com.mycorp.service.plist ...
5
votes
2answers
983 views

“cron” processes spawning and piling up, but no crontab

EDIT: I solved this, so see below for my own answer. While the bounty asks for a fix to the problem, I'd like to award it to someone who can explain why a cron process that ran for 6 years over ...
2
votes
0answers
61 views

How can I cleanly start and stop VirtualBox VMs using launchd?

Does anyone have a working macOS 10.15, Catalina, shell script for cleanly starting/stopping VirtualBox VMs using launchd? It seems macOS 10.15 has broken the standard solutions you find when ...
1
vote
0answers
18 views

Start headless screen sharing session via local command

I have a mac mini with users X and Y. The mac mini auto-logins to user X on startup. I often use that mac mini via screen sharing for user Y. Is it possible to run a command on that mac mini, so that ...
2
votes
1answer
167 views

Execute a script with GUI Access before login

I need to execute a command-line tool to force maximum display brightness before user logs in (so login screen is shown with maximum brightness) My problem is, if I run it from LaunchDaemons, it ...
0
votes
0answers
18 views

Launchctl starting Virtual Machine before USB is intitiated

I have a plist file located in /Library/LaunchDaemons that starts a Virtual Machine headless with Ubuntu on it. The problem is however that USB probably isn't initiated before the VM is started, and ...
5
votes
2answers
105 views

launchd run command every minute of a specific hour

On man launchd.plist it says (emphasis mine) StartCalendarInterval This optional key causes the job to be started every calendar interval as specified. Missing arguments are considered to be ...
0
votes
0answers
19 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
42 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
90 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 ...
2
votes
1answer
350 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
147 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
22 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
32 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
179 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
135 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 ...
3
votes
0answers
60 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
234 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
50 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 ...
4
votes
2answers
1k 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 ...

1 2 3 4 5 11