Questions tagged [launchd]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
16 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?
0
votes
0answers
16 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
37 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
20 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
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 ...
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
1answer
40 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" ...
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 ...
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
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?
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 (...
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 ...
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
36 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....
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/...
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-...
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 "-//...
1
vote
0answers
65 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
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. ...
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 ...
1
vote
1answer
35 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 ...
4
votes
1answer
214 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
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
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 ...
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") ...
2
votes
1answer
180 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" ...
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
121 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 ...
0
votes
1answer
30 views

How to use Launchctl for schedule application

I try to work with Launchctl and have a question: How can I set up an application to run in a few minutes using Launchctl? (for example, open the program MyApp.app with arguments "hello" "world" ...
0
votes
0answers
19 views

How to use Launchctl for runing scheduled command [duplicate]

I try to work with Launchctl and have a question: I know there is a possibility to run commands directly (shell for example) with Launchctl, can someone please add an example on how can I do it with ...
1
vote
1answer
88 views

Can’t load plist. Launchctl says “Invalid property list”, tried plutil, SIP, permissions

I want to use the following plist to run a backup script under macos High Sierra. File name: com.pollux.backup.plist Content: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist ...
1
vote
0answers
33 views

problems resulting from launchd script running when computer is sleeping

I have a Bash script that copies a specified set of files/directories to a remote server via rsync. It is run by launchd as a Global Daemon every day at 3am. The computer is sleeping most of the time ...
0
votes
1answer
40 views

Run Script Atomically

I have a launchd task that runs a bash script periodically, and this works great. However, if I change the script while the task is running, either by editing it directly, or swapping it with an ...
1
vote
1answer
57 views

How to wait until internet connection, before launching “login item”

My Slack and a few other apps will automatically launch at login on my Macbook, since they are listed under "login items". However, some, like Slack, will launch before the internet is connected, and ...
0
votes
0answers
21 views

Is there a way to create a launchctl service using snap?

I am using snap to create a systemd service on Linux - I am wondering if there is a way to use snap to create a launchctl service on MacOS?
3
votes
1answer
155 views

How are brew services different from launchctl services?

On MacOS, how are brew services different from launchctl services? is there a way to use snap on a Mac to run services instead of brew?
0
votes
0answers
19 views

Why does launchd suddenly complain about error 78: Function Not Implemented? [long]

I have an old 2010 MBA which runs High Sierra. It is located at a condo which I visit for a few days each month. The machine runs 24/7 mostly to upload webcam photos to a host every four minutes, to ...
1
vote
1answer
187 views

running macOS UI based Application as root

I'd like to open a specific macOS application which require root privileges (uid=0 or gid=0) in order to access specific files. However, when trying to run with sudo directly I get the following error:...
0
votes
1answer
63 views

Can't authenticate using SSH key when running script via launchd

I have a Bash script that executes an rsync command to sync files with a remote server. #!/bin/bash rsync -auvzP --exclude=.bundle --exclude=node_modules --exclude=tmp '/Volumes/Norman Data/me/....
2
votes
1answer
62 views

Process called “ItYoingm” using over 90% CPU and over 106GB memory - root user

I have recently downloaded Catalina on my Macbook pro and every now and again my fan goes into overdrive, even when I'm hardly using any programs. I opened my Activity Monitor and there is a process ...
1
vote
0answers
67 views

Permissions problems with running rsync via periodic or via launchd in Catalina

So, I've got some scripts that use rsync to periodically backup folders on my MBP, but once I moved to catalina they stopped working when invoked by periodic or by launchd. This is clearly a ...
0
votes
0answers
320 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="...

1
2 3 4 5
12