Questions tagged [launchd]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
9 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
33 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 ...
0
votes
0answers
19 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 /...
2
votes
1answer
73 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
25 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
41 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
56 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
27 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 ...
0
votes
1answer
28 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
12 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
18 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
51 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
25 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
18 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
95 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 ...
2
votes
2answers
336 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
49 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 ...
1
vote
1answer
111 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
14 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
81 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
17 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
36 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
62 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
214 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
106 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
19 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
28 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
120 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
74 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 ...
2
votes
0answers
39 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
128 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
41 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 ...
3
votes
1answer
697 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
59 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
vote
0answers
15 views

launchctl list shows bundle identifiers of running application, there is a number after that what is it?

command and its output launchctl list | grep Terminal 94502 0 com.apple.Terminal.2000 What is the 2000 number referring to? 94502 is Pid and 0 is exit status What does it mean if pid is ...
2
votes
1answer
38 views

How is my Apache server auto-booting without a LaunchDaemon plist?

A few months ago I setup an Apache server on a Mac Mini running Mac OS 10.14.6. It runs great. Each time I reboot the mac, the Apache service also starts, great. My question is, why? There is no /...
3
votes
2answers
130 views

How can I use $HOME or ~/ in my log paths of launchd plist to run as LaunchAgent

My plist has below keys: <key>StandardOutPath</key> <string>$HOME/launchd.stdout.log</string> <key>StandardErrorPath</key> <string>$HOME/launchd.stderr.log&...
2
votes
1answer
175 views

Use OpenSSH agent instead of the OSX agent

I've installed OpenSSH using homebrew (brew install openssh) and this installation provides it's own ssh-agent. Still, when I login, and see the autostarted ssh-agent, I see that the agent that is ...
2
votes
0answers
43 views

My launchAgent service is launching my application multiple times even if configuration has RunAtLoad true and OnDemand true(default)

My purpose is to launch my application during every login but is being launched multiple times. I copied my below plist file in to /Library/LaunchAgents and gave root ownership and chmod 600 <?...
4
votes
2answers
109 views

Where should a daemon started by launchd store its data?

When I develop UI application for OSX I store user's preferences and application config to ~/Library/Preferences/AppName.plist (using NSUserDefaults). But when I create global background daemon that ...
0
votes
2answers
467 views

How to view status of service (e.g. whether it's running) in a format similar to Linux `systemctl` using macOS `launchctl`?

How to view status of service (e.g. whether it's running) in a format similar to Linux systemctl using macOS launchctl? I want to view the status of a service in macOS using launchctl in a format ...
0
votes
1answer
170 views

How do I use launchctl print?

I made a launchd service file then started it. Now I want to use the launchctl print command but I'm not sure how. I read: What is the difference between a `service-name` and a `service-target`? and ...
0
votes
0answers
40 views

When CleanMyMac X disables or enable a service, what does it actually do to launchd? How to recover?

I disabled a service (com.qiuyuzhou.shadowsocksX-NG.local) with CleanMyMac X by mistake, and the software stopped working, I tried some commands but they failed. launchctl load "$HOME/Library/...
4
votes
1answer
147 views

How to find out which application(s) created core dumps?

I have a friend who has a Mac (Mojave) that recently ran out of space. I found that the space was being used by files in the /cores folder. I deleted them and used to the command sudo launchctl limit ...
2
votes
0answers
449 views

Homebrew dnsmasq “Service exited with abnormal code: 2” (Mac OS X Sierra 10.12.6)

Workaround (update) A quick workaround is to stop the job through brew services stop dnsmasq. Then you should first unload the launchd configuration file and then reload it. $ sudo launchctl unload -...
0
votes
0answers
15 views

MacPorts daemons not loading on restart

I have installed MacPorts 2.5.4. From here, I have installed apache2. When I restart the machine, I need to run sudo apachectl start each time, it won't load automatically. I ran a sudo launchctl ...
2
votes
2answers
52 views

What is the best approach to ejecting disk while in sleep mode, scheduled?

So, I have an external HDD which is being used for Time Machine. After getting to home, I usually connect my MacBook to a HDD via Hub and put it into sleep mode. Because I sometimes get back home ...