Questions tagged [launchd]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
16 views

Unable to run Bash 5 from launchd

I have the following launchd agent: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/...
16
votes
1answer
20k views

launchtl: any way to disable a daemon after removing the plist file?

I was trying to permanently disable a 3rd party daemon, so I deleted its plist file from /Library/LaunchDaemons-- and then I realized that I hadn't done a launchctl unload on it first; trying after ...
2
votes
0answers
20 views

Cleaning up LaunchDaemons and LaunchAgents

Trying to debug a slow-down of a Mac after a system upgrade, i would like to clean up LaunchDaemons and LaunchAgents, especially third-party ones. What it the proper way to do so?
2
votes
2answers
78 views

What causes excessive CPU use by taskgated, notifyd, and launchd processes?

I've looked around a lot to try to find the answer to this but have thus far been unsuccessful. I am programming in Python, and I have code that takes a long time to run (hours to months depending on ...
0
votes
0answers
17 views

launchd KeepAlive/OtherJobActive alternative for macOS 10.10+?

I need to write a launchd global daemon that depends on other daemons or agents (similar to After, Before, Requires etc. from systemd). I know about the KeepAlive/OtherJobActive directive, but this ...
0
votes
0answers
38 views

Cannot backup Documents folder using LaunchAgent and bash

I use the open source borg backup tool to make a daily backup of my Documents folder which is also on iCloud drive. I use a LaunchAgent stored in my local library directory to execute a bash script ...
0
votes
0answers
22 views

launchd for starting Virtualbox vm, gives exit code 1. What am I doing wrong?

I have the local.UL20.RESTART.plist file in /Library/LaunchDaemons/ It's permissions are owner: root, group: wheel The system does have VirtualBox running Yet, the system, it just responds with the ...
0
votes
0answers
21 views

How do I enumerate osx launchctl LaunchAgents with their service/domain/blah blah target stuff?

What I did in the past was launchctl list // launchctl unload which is now "legacy." What I want to do is list all items that startup (specifically Adobe) and remove the ones that I don't ...
0
votes
0answers
18 views

rsync “Operation not permitted (1)” error only when run in launchd [duplicate]

Context There is a similar question here, however I feel the answer does not expand on how to "invoke the user environment profile from the launchd script"; and the alternative solution of ...
1
vote
1answer
341 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 /...
1
vote
1answer
43 views

how dangerous is it to give zsh full disk access?

I have a shell script that runs a few (Duplicacy) backup commands. It works fine when I manually run the script from terminal (cd to the directory where it is and then ./backup.sh). To make it run ...
1
vote
1answer
29 views

Permissions errors when using launchd to run rsync between local drive and afp network drive

I am trying to sync a local directory to my NAS that is mounted via the afp protocol as a drive. I am using rsync. When I run the command from the terminal, it works fine. However, when I try to run ...
2
votes
1answer
93 views

How To Use '`launchctl print`' as a Replacement for '`launchctl bslist`?'

man launchctl' remarks that: LEGACY SUBCOMMANDS Subcommands from the previous implementation of launchd are generally available, though some may be unimplemented. Unimplemented subcommands ...
0
votes
1answer
32 views

LaunchAgents runs Python script in version 2

Maybe someone can explain this. I'm having LaunchAgents run a Python script on startup. The relevant part of the plist looks like: <key>ProgramArguments</key> <array> <string&...
1
vote
0answers
68 views

Sleepwatcher needs to be relaunch after every boot on Catalina

I have a .sleep script that I launch with sleepwatcher everytime my MacBook Pro goes to sleep (by closing the lid). On Mojave, everything worked fine. Now on Catalina (10.15.5), every time I boot : I ...
1
vote
1answer
41 views

Can't run launchctl agent in Catalina. Is this a permissions problem?

I have some launchctl scripts on Mojave that I am trying to now run on Catalina, but can't seem to get them to run. I made myself a very simple little plist as follows <?xml version="1.0" ...
1
vote
2answers
1k views

What is could spawn tons of processes called AppleUserHIDDrivers over and over

I see 18 instances of the process AppleUserHIDDrivers running on my MacOS, according to the activity monitor, belonging to the user _driverkit. The parent process is listed as launchd. What could be ...
0
votes
1answer
30 views

Launchd/Launchctl - pre and post scripting

Is there any way with ld/lctrl to execute pre/post commands similar to systemd's ExecStartPre/ ExecStopPost?
5
votes
1answer
2k views

Set the WorkingDirectory to user's home in launchd?

I understand that you can change a LaunchAgent's working directory with a WorkingDirectory key, but is there any way to set the Working Directory to a user's home directory reliably and portably ...
0
votes
0answers
24 views

Know when a file is created (or saved) using bash

I would like to know if there is a command line program that can tell me when a file is created or saved. Suppose I am at ~/Desktop and I want to do something, for example run my_script, when I save (...
0
votes
0answers
17 views

How do I run a script when a particular bluetooth device wakes up?

I use a Microsoft Natural Bluetooth Ergonomic keyboard with my MBP. I remap the Windows & Alt keys on the Windows keyboard to ⌥ and ⌘, respectively, for the keys on both the left & right of ...
1
vote
1answer
47 views

Reproducing execution launchd execution environment

I have a script which runs flawlessly under a normal interactive shell, but which frequently has errors when run as a user LaunchAgent. Is there a way to manually, and ideally interactively, run a ...
1
vote
0answers
38 views

How to display Notification from a LaunchDaemon process?

I have a LaunchDaemon process that needs to run as root user. The process internally calls osascript to display some notifications. Notifications display fine when the process is run manually without ...
0
votes
0answers
7 views

Different dicts for different launchd jobs in the same plist?

I tried to use the following open.close.mail.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www....
1
vote
1answer
75 views

Launch Daemon for NodeJS App Won't start on reboot

I've created the below launch daemon to run a nodejs program on startup (tiddlywiki in this case): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//...
9
votes
5answers
13k views

How to stop OS X from trying to run TeamViewer every 10 seconds

I recently happened to look at my system.log file and noticed the following messages over and over: Mar 4 12:09:32 ix com.apple.xpc.launchd[1] (com.teamviewer.teamviewer[11506]): Service could not ...
2
votes
3answers
1k views

Does changing a daemon's plist file extension prevent it from being loaded?

I particularly want to disable: /private/etc/mach_init.d/dashboardadvisoryd.plist.disabled, but in general for any daemon. Does changing its plist extension prevent it from loading? In the past I ...
0
votes
1answer
3k views

How I can start mongodb automatically?

I'm doing like here is described http://hunterford.me/mongodb-startup-item/ but my file called different and path is here ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist. and mongo is starting ...
3
votes
1answer
6k views

make custom user agent change permanent

I need to navigate a site that makes use of javascript that checks for user agent and only permits IE9.0 (don't ask). I am using safari and can set IE 9 in the user agent submenu of the develop menu. ...
9
votes
1answer
12k views

How to use GUI pinentry program for GPG

I would always like to use the GUI version of entering my GPG passphrase. Currently my pinentry program is set the same on my laptop as my desktop. But the desktop always asks for my passphrase on the ...
4
votes
2answers
430 views

MacUpdate check running every hour?

I have MacUpdate installed (which I got with their Spring Bundle). I noticed that it tries to check for updates every hour for some reason. The app itself is not running so it must be some agent or ...
0
votes
0answers
30 views

How to give permission to daemons launched with launchctl

One of the latest OS upgrades caused a script loaded by launchctl to fail for permissions. my script does this to mirror a mounted path into my disk: rsync -av --delete <mounted-path> <local-...
0
votes
1answer
22 views

Conditioning launchd scheduled job on file existence?

We have a scheduled job that we want to run on both our macOS and Linux hosts. On Linux, with systemd we can just use this: ConditionPathExists=/etc/this_file_must_exist ConditionPathExists=!/etc/...
30
votes
1answer
13k views

What is the difference between a `service-name` and a `service-target`?

Consider the following commands # launchctl stop Usage: launchctl stop <service-name> # launchctl stop com.apple.SomeService # launchctl disable com.apple.SomeService Usage: launchctl disable &...
1
vote
2answers
92 views

Want launchd to run a script weekly, but it is running it daily instead

I wanted to write a simple launchd job that runs a script every Monday morning at 7:00 am. The goal is to pull an image from tapmusic.net that catalogs my last.fm listening habits from the prior week. ...
4
votes
1answer
218 views

Can I have launchctl output stdout/stderr from my application to the system-wide Unified Logging mechanism?

I have set up a custom .plist in ~/Library/LaunchAgents to run a process (offlineimap) on a periodic basis. I've specified both the StandardOutPath and StandardErrorPath keys to point to files in my ...
1
vote
2answers
110 views

launchctl plist has a stderr that talks about how getcwd operation not permitted so how do I fix it?

TLDR for those who googled and found this In Catalina, launchd can't read files or run scripts located inside your ~/Documents folder. Just avoid putting your scripts there and rewrite your scripts ...
8
votes
7answers
4k views

How to run a LaunchAgent that runs a script which causes failures because of System Integrity Protection

After upgrading to Mojave, my rsync based backup script run via a launch agent in ~/Library/LaunchAgents, could no longer read some directories in ~/Library.
2
votes
3answers
306 views

launchctl starts my plist job much later than StartCalendarInterval

I recently tried to switch to launched on my Mac Mini (10.7.5) from cron on a PC. I searched and think I have things set up right, but it seems that the scheduled script starts significantly after the ...
1
vote
1answer
38 views

How do I cleanly remove old Juniper Pulse installation from Mac OSX?

The Console application on the Mac is continuously throwing log messages presumably because fragments of a previous install are still in place. I have tried Googling around for a solution and using ...
0
votes
0answers
45 views

launchd running php script fails under Catalina on exec diskutil

I have a php script that worked perfectly under Mojave from the terminal and as a launchd job. After changing to Catalina, the php script continues fine from the terminal, but the launchd job fails on ...
0
votes
0answers
23 views

Silence launchd's “Service only ran for [x] seconds. Pushing respawn out by [x] seconds.” log message

TL;DR: I have a LaunchAgent that is triggered with WatchPaths that runs a very simple/quick script and exits cleanly. But it ends up generating console log such as this: Apr 25 19:30:45 my-clever-...
1
vote
0answers
20 views

OSX Launch Daemon for Periodic Screenshots

I'm trying to figure out how to create a daemon that will take screenshots every 5 minutes on OSX. The daemon with launchctl seems to run under a separate session so the screenshots I'm getting right ...
0
votes
0answers
22 views

Is it possible to change the sandboxing of the sharingd process?

When attempting to access network shares on a Synology NAS I get an error indicating the original item cannot be found. In the system console there are messages from NetAuthSysAgent indicator that a ...
1
vote
1answer
29 views

make computer wake up at time

I'm working on a project that involves using launchd at a certain time. I have heard that launchd will only work if the computer is awake/logged in. What is the best way to insure that launchd will ...
2
votes
1answer
183 views

Launchd Wont Run Application

I made an app (tested it works) and I want to make it run every day at midnight. Here is my PLIST file: EDIT: after using @user3439894's code here is what I put in my PLIST <?xml version="1.0" ...
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 ...
0
votes
1answer
43 views

Run script through launch agent is failed

I try to run the next script through LaunchAgent: on run argv set current_path to POSIX path of ((path to me as text) & "::") set common to load script (current_path & "common.scpt") ...
0
votes
0answers
28 views

Apple Catalina Error in PLIST, plutil -lint says its OKAY

plutil -lint /Library/LaunchDaemons/net.varela.wesley.borg.plist /Library/LaunchDaemons/net.varela.wesley.borg.plist: OK sudo launchctl load -w /Library/LaunchDaemons/net.varela.wesley.borg.plist /...
0
votes
1answer
124 views

How to use Launchd? [duplicate]

(sorry if this is a bad question. I am new to apple coding) I want to run a .scpt file at a specific time, once a day, every day using launchd (if there is a better way please tell me) I am running ...

1
2 3 4 5
12