Questions tagged [launchd]

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

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

Permissions issue automating a shell script in /usr/local/bin using launchd?

Goal: use a launchdaemon to periodically run a shell script Environment: macOS Catalina 10.15.3, macOS Server 5.9 I have a shell script to back up Open Directory in macOS Server: #!/bin/bash dst="...
2
votes
1answer
105 views

Catalina - find: .: Operation not permitted from launchAgent

I've created a launch agent that uses the find command to look in the downloads folder of a user files_to_remove=(`cd ~/Downloads/ && find . \( -name "*.csv" -or -name "*.pdf" -or -name "*....
1
vote
0answers
464 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
84 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
123 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
103 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
51 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
21 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
107 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 ...
4
votes
2answers
253 views

Earliest way to disable 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
20 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
37 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
332 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
552 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
64 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
115 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
93 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
1answer
342 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 /...
4
votes
2answers
3k 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
93 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
74 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
362 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
29 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
103 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
18 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
17 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
65 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
378 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
70 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
45 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
29 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
108 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 ...
8
votes
3answers
2k 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
90 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
29 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
450 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
19 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
217 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 ...
2
votes
1answer
57 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
216 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
604 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
233 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....
1
vote
1answer
34 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
309 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
273 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
92 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
760 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 ...
5
votes
2answers
4k 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
144 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
2
3 4 5
12