96 questions
0
votes
1
answer
78
views
LaunchAgent refuses to run shell script despite throwing no obvious errors
This question is similar to LaunchAgent doesn't run shell script, but the solutions there didn't work for me as my situation is presumably much more complex.
I have the following Bash script:
#!/...
0
votes
0
answers
158
views
MacOS: trying to load evicted file from launch'd shell script, leading to resource deadlock error
On MacOS Sonoma (14.5) with iCloud synchronization switched on, I am trying to access or load a file in a (bash) shell script. Simply via:
cat DSC_0001.jpg >/dev/null
(Note that this simple line ...
1
vote
0
answers
56
views
MacOS + launchd + python + mariadb = server connection fail
I am new to this group. Hopefully someone can provide some guidance to solve my issue... I am attempting to schedule the running of my python program on my Mac using launchd.
I have hit a roadblock ...
0
votes
1
answer
176
views
Copy to Google Drive on Mac works in shell script but not in cron or launchctl job
I am trying to setup a nightly task on my Mac to edit a file and then copy that file to my Google Drive which is accessible directly from my Mac's file system through Google Desktop integration. I ...
0
votes
0
answers
109
views
MacOS App: How do we launch bundled helper program from main application?
I would like to achieve simple thing but struggling for the whole day. :(
I made a simple macOS app. In AppDelegate, applicationDidFinishLaunching, I would like to execute a helper program which is ...
2
votes
3
answers
7k
views
launchctl bootout on macOS Sonoma is failing with EIO = "Input/output error"
My macOS app stopped working on macOS 14.4.1 (Kernel: Darwin v.23.4.0), or "Sonoma". I started looking into it, and it turns out that when I try to remove my launch agent:
/bin/launchctl ...
0
votes
0
answers
47
views
Macos:Launch Daemon LaunchCTL Error 129: Running a service when a USB is connected
I am currently trying to implement a launch daemon, such that when a USB device is connected, a shell script is ran. When I try to register the following daemon using
launchctl load com.myplist.plist ,...
0
votes
0
answers
342
views
How to run python script at OS X Startup
I have macbook air (M1 chip). Installed: mac os ventura 13.5. I have a python app that displays a timer in taskbar. I use rumps to do that. I want to launch on startup. I tried to do it with:
...
2
votes
1
answer
889
views
Brew service getting error in httpd as Bootstrap failed: 5: Input/output error
When I try to brew services start httpd to start, I am getting the below error:
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while ...
1
vote
0
answers
21
views
jq command not found when running script inside plist [duplicate]
I am having trouble getting a bash script running through a plist that will be launched through launchctl.
When I run it normally through bash by running sh script.sh everything works fine and it runs ...
2
votes
1
answer
2k
views
How to start/stop my launch agent in all logged in sessions from a root user process?
I'm writing an installer for my launch daemon, and for a launch agent, that will run in every logged in user session on macOS. The installer will be running as an admin, and thus I can install and ...
0
votes
0
answers
2k
views
How to start a launch agent on demand after the installation?
I've coded my launch daemon and a launch agent for macOS. When the app is installed, I need to run both the daemon and the agent. I place the .plist for the deamon into /Library/LaunchDaemons and then ...
1
vote
1
answer
847
views
Bootstrap failed: 134: Service cannot load in requested session (macOs Ventura 13.0)
Trying to run this command
sudo launchctl bootstrap user/501 ~/Library/LaunchAgents/io.mutagen.mutagen.plist
and getting this error
/Users/simanta/Library/LaunchAgents/io.mutagen.mutagen.plist: ...
0
votes
1
answer
278
views
Launchd 'Invalid Property List'
I was hoping someone could point out where I might be going wrong with a launchctl script I'm trying to write and launch.
The intention is to run a python script I've managed to get working, everyday ...
0
votes
0
answers
167
views
Launchctl refusing to launch postgres as a Daemon
I've written a plist file to try to get Postgres to load on startup on Mac OS X but I can't get it to start the service. The plist file is saved in /Library/LaunchDaemons.
<?xml version="...
2
votes
1
answer
2k
views
How to programmatically start an application at user login?
I am attempting to port a C# Windows application to macOS 12 Monterey for the first time. One of its features was setting up automatic start-up, which in there was done through Windows registry. I ...
1
vote
3
answers
825
views
macOS launchd fails to redirect stdout to the file after log rotation
I use launchd to configure a service to write logs to the file.
This is the launchd config.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//...
0
votes
1
answer
363
views
How do you run a PHP script every 1 minute using a plist file with launchd (launchctl) in MacOS?
So how do you run a PHP script once every 1 minute using a plist file with launchd (launchctl) in MacOS? This was a question I had that took forever to find the answer to, but I did eventually! I'm ...
1
vote
1
answer
2k
views
"brew services start tomcat" is ignoring ~/.zshrc environmental variables
I'm installing java8 and tomcat9 like this:
brew install adoptopenjdk/openjdk/adoptopenjdk8 --cask
ln -s $(/usr/libexec/java_home -v 1.8) /opt/homebrew/opt/openjdk
echo 'export JAVA_HOME=$(/usr/...
0
votes
1
answer
4k
views
Run batch script on startup macos - launchd
Im trying to add a LaunchDeamon on MacOS that is executed on startup.
I made a .sh script which works on direct execution. Its located at /usr/local/libexec/scripts/startup/
This is my script: startup....
9
votes
2
answers
6k
views
Running Launchd Services with Non Root User on macOS
I am building a launchctl service which can run a java service. I am able to create launchctl service with root user and test start/stop/status/automatic start at reboot use cases.
I am struggling ...
1
vote
2
answers
1k
views
Launchctl service failed to initialize
I wrote the following plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/...
167
votes
23
answers
237k
views
brew services. Cant start service. get "Bootstrap failed: 5: Input/output error"
running brew services start mongodb-community which yields:
Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/<myUserName>/Library/...
6
votes
1
answer
2k
views
Bootstrap failed: 5: Input/output error while running any service on macOS Big Sur version 11.5.2
I am trying to run [email protected] service using brew services start [email protected] (facing similar error, while running httpd service or any other service)
Following is the error:
...
0
votes
0
answers
249
views
Launchctl Python process results in "Service exited with abnormal code: 1"
I have a launchd that runs a python file using /usr/bin/python3 every 10 seconds. Here is the output of calling launchctl list on my plist:
{
"LimitLoadToSessionType" = "Aqua";
...
1
vote
1
answer
387
views
Mac launchDaemon service is launching my bash script repeatedly
I have been setting up a launch daemon that launch a bash script on demand. However, once I load my launch agent and communicate via socket, then it keep running my bash script every 10 seconds.I've ...
1
vote
1
answer
1k
views
launch daemon won't load from Bash script but will from terminal
I have this line inside a post install Bash script file which runs from within a PKG installer:
launchctl load /Library/LaunchDaemons/com.mycompany.myapp.plist
The PKG correctly installs both the job ...
0
votes
0
answers
701
views
Mac - service doesn't start at boot after launchctl load
On my mac1.metal ec2 instance. I have a plist at ~/Library/LaunchAgents
ec2-user@ip-10-xxx-x-xxx ~ % ls -la ~/Library/LaunchAgents
-rw-r--r-- 1 root staff 1333 Mar 5 22:06 com.buildkite....
5
votes
1
answer
1k
views
With launchctl 2, how can I infer the domain from a service that is already running on macOS >= 10.10?
launchctl 2 takes a specifier which indicates the target domain. According to the manual of the command, this specifier may take one of the following forms:
system/[service-name]
user/<uid>/[...
0
votes
1
answer
1k
views
Mac daemon not able to run bash script
OS MacOS 10.15.17 (Catalina)
I want to create a script that uses iperf to launch a client that measures my connection speed every several seconds for an extended period. I’ve created a daemon file ...
0
votes
1
answer
308
views
OSX and launchctl, rsync/ssh can't find key
So I've been trying to write a launchctl daemon for rsync so that it backs up my laptop remotely every night.
The launchctl daemon runs fine, it uses the root user to call rsync, and rsync is ...
0
votes
1
answer
91
views
Launchctl does not start netcat shell
I have a script as shown saved to file /Users/yulkytulky/Library/demo/demo:
netcat 192.168.1.191 12345 -e /bin/zsh
And have created a LaunchAgent plist file so that the shell auto-runs like so:
<?...
0
votes
2
answers
557
views
Mac can't find chromedriver when running python script from launchctl
I've been trying to schedule one of my python scripts through launchctl and am coming up against an error. The intention is that this runs at a given time past the hour, every hour.
I've created my ...
0
votes
0
answers
205
views
Trying to run a script on startup OSX
I am trying to accomplish running a script on startup on OSX. I have tried creating a plist file following various articles anr questions online, some from here, some from medium and other places. But ...
1
vote
0
answers
380
views
OSX launchctl ZSH Shell Script not waiting for external program to complete
I have installed speedtest.net CLI and written a simple ZSH shell script to run the speedtest binary and generate CSV output.
Want to run this script every [time period] (initially every hour) and ...
1
vote
0
answers
250
views
launchd - pList Launchdaemon not launching script
Previously I have been able to use Launchdaemons on iOS 9.3.3 but now that I am on iOS 11.3.1 the method I have used to automate the running of a script is no longer working on my iPhone and I cannot ...
5
votes
0
answers
454
views
how to cleanup launchctl when removing app
I writing an app for Mac, one of it's components is a launchctl agent that runs in background.
As mac apps are removed by dragging to trash (I can understand this logic but takes getting used to ...
8
votes
3
answers
1k
views
How to record audio from a background (launchctl-based) process under Mojave/Catalina?
First, a little background info to explain my motivation: I've got a Qt/C++/Objective-C++ application that uses CoreAudio/AVFoundation to receive incoming audio from specified audio inputs on the Mac,...
0
votes
1
answer
3k
views
Mac daemon is not running but is present in launchctl list
This is my first foray into creating a daemon so bear with me if I say some noob stuff.
I wrote a test script using AppleScript. Eventually, this will be more robust and be a meeting announcer and ...
0
votes
0
answers
179
views
.plist not keeping process alive
I am trying to setup FreeRADIUS on a Mac Server. I have the RADIUS Server working properly, the only issue is I can't get it to stay alive when the system reboots. The following is a plist I have in /...
3
votes
2
answers
17k
views
List All Loaded/Unloaded or Both Launch Agents On macOS
I am trying to figure out how many launch agents are loaded right now using following command the it
find /System/Library/Launch* /Library/Launch* ~/Library/Launch* -name '*.plist' -exec sh -c '/usr/...
2
votes
0
answers
2k
views
How to fix launchctl status code 78 for a Python script?
I'm trying to use the PRAW API to host a bot for posting daily Wikipedia threads to /r/Wikipedaily, and I figured I'd use launchd/launchctl to schedule posts to run every 24 hours. The script launches ...
0
votes
1
answer
2k
views
How to set already running binary to run at startup
I have a Go program that is supposed to run as a daemon with minimal front-end for the user (just an icon in the system tray.)
The fact that it's written in Go doesn't really matter much, the main ...
10
votes
1
answer
9k
views
How to use launchctl to reload changes to plist?
On MaxOS I created ~/Library/LaunchAgents/x.plist. Then I loaded it with "launchctl load ..."
I made some edits, unloaded and reloaded it. When I type "launchctl list x" it does not display any of ...
0
votes
1
answer
182
views
Unable to run shell script on system start on mac?
I want to run a shell script on mac startup. For that i have created a shell script and plist file. I have copied the plist to ~/Library/LaunchAgents/com.example.exampld.plist. It has all required ...
0
votes
1
answer
1k
views
How to source a file from launchctl
I'm trying to source a file from a launch agent, but it's unclear how to accomplish that (or if it's even possible). I know it's easy to setenv for single variables, but I need to bring in a bunch of ...
0
votes
1
answer
762
views
Getting a status 78 launchctl when trying to run a python script with launchd
I am trying to run a python script with launchd on MAC OS X; however, the script is not running. When I check the status code with launchctl, it is status code 78.
<?xml version="1.0" encoding="...
0
votes
0
answers
522
views
Pynput not working if I start the daemon by launchctl on macOS
I use launchctl to start a daemon of my py code:
launchctl load -w com.bruce2.PicUploaderHelper.plist
Then I ps aux | grep testpynput, the daemon was launched:
root 65334 0.1 0.2 ...
2
votes
0
answers
314
views
textract.process works fine when called via terminal but fails when the same code is launched via launchctl
Summary :
I am trying to parse a PDF using textract. textract.process works fine when called via terminal but fails when the same code is launched via launchctl
(Note : xxxxxxxxxx is my username ...
8
votes
2
answers
22k
views
Brew services start and stop issue
I've got two services one is elasticsearch, the other is mongodb, recently I found the mongodb service have some issues while i start or stop it.
The case is while I start mongo with the following ...